Skip to content

Route: a remux declares the source frame rate in the Load - #832

Merged
GLinnik21 merged 3 commits into
mainfrom
fix/remux-declares-source-fps
Oct 18, 2026
Merged

GLinnik21 merged 3 commits into
mainfrom
fix/remux-declares-source-fps

Conversation

@GLinnik21

@GLinnik21 GLinnik21 commented Oct 18, 2026 •

Copy link
Copy Markdown
Collaborator

Cause

With Boost Dialog (or Normalize Loudness) on, a direct-playable file plays as an enhanced remux: PMS copies the video and re-encodes the audio. The route treated every non-direct route as a re-encode and set the stream rate to 0, so engine::sink_envelope kept the 60 fps ceiling. On the dev set (webOS 4.10), a 4K H.264 24p stream declared at 60 is presented at ~13 fps (measured 2026-09-03, documented in player/CLAUDE.md).

Observed on the 0.9.0-nightly-20261017 build, same title, same session:

route load: line presented (sink: displayed= summed per second)
enhanced remux (Boost Dialog) fps=0.000 … max=3840x2160@60 12-20, mostly 15-17
Original direct play fps=24.000 … max=3840x2160@24 24-29

The feed queue was full (qbytes growing) and CPU was ~23%, so the decoder was never starved.

Fix

One rule, route::plan::video_copy_fps(contract, src_fps): the source rate when the contract copies the video (remux && !no_video_copy), else 0. The file's own rate is now kept as src_fps beside src_vcodec on the plan and the session. Three places use the rule: the plan's remux branches, install_original_remux (recovery) and apply_retranscode_outcome_to_projection (audio toggle/pick landing). HLS rungs, no_video_copy and a forced burn still declare no rate.

Tests

Regression tests written first and observed red (left: 0.0, right: 23.976), then green:

  • toggle_on_from_direct_declares_the_source_rate_for_the_remux
  • recovery_to_an_enhanced_remux_declares_the_source_rate
  • enhanced_remux_plan_carries_the_source_rate_and_a_burn_does_not

make check on the committed tree: test result: ok. 701 passed; 0 failed (plx_media stage), last stage test result: ok. 1805 passed; 0 failed; 60 ignored. cargo check --no-default-features clean.

TV verification (dev set, webOS 4.10, ARM_PROFILE=release debug build of this branch)

Synthetic scene, mock PMS: tests/run.py --fps-player --mock --filter boost-remux-declares-source-rate → 1 passed, 0 failed of 1

  • load: v=H264 a="AC3" fps=24.000 … max=3840x2160@24, echo 3840x2160@24
  • presented_rate: declared 24.000 fps; presented median 24.0, min 24.0, max 25.0 over 23 healthy s (145 counter samples); 0 window(s) below 85%

Real server, the reported title (The Boxtrolls, 4K H.264 24p), Guest, Boost Dialog on:

  • enhancement: boost_dialog=true normalize_loudness=false — direct play becomes an enhanced remux
  • load: v=H264 a="AAC" fps=24.000 … max=3840x2160@24, smp_cb type=5 … 24.000000
  • presented frames per second (sink: displayed= summed per heartbeat): 24 24 24 25 24 24 24 24 24 24 24 24 24 24 (the nightly showed 12-20)
  • Guest's watch state on the item was unchanged afterwards (no viewCount/viewOffset).

Synthetic regression scene

fps_scenes gains boost-remux-declares-source-rate (mock only): a 4K H.264 24p + AC3 source, the same stream served as the start.mkv remux, plxnative-audioenh=boost. It grades load_fps: 24.0, load_max/sink_echo 3840x2160@24 and, new for fps scenes, presented_rate (grade_scene_expect now accepts it). The fixtures are generated (commands in the scene comment), not in the repo. Host: python3 tests/test_harness.py → Ran 462 tests, OK, including a test that the pre-fix declaration (fps=0.000 … @60) fails the scene.

🤖 Generated with Claude Code

GLinnik21 and others added 3 commits October 18, 2026 03:38
…e still declares none

An enhanced remux (start.mkv, directStream=1) copies the source video stream, but the route code
set stream fps to 0 for every non-direct route, so engine::sink_envelope kept the 60 class and a
4K H.264 24p file was presented at ~16 fps (24 under Original). video_copy_fps(contract, src_fps)
is now the one rule: the source rate when the contract copies the video, 0 for an HLS rung,
no_video_copy or a forced burn. The plan, the recovery install and the retranscode landing use it;
the file's rate is kept as Plan/PlaybackSession::src_fps beside src_vcodec.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…scene expect grades presented_rate

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…urce-fps

# Conflicts:
#	tests/test_harness.py
@GLinnik21
GLinnik21 merged commit 2f2f5a5 into main Oct 18, 2026
19 checks passed
@GLinnik21
GLinnik21 deleted the fix/remux-declares-source-fps branch October 18, 2026 01:28
RichiL10 added a commit to RichiL10/plx-native that referenced this pull request Oct 18, 2026
Brings the four upstream commits after the 0.9 base 0b0b220:
- plxnative#831 Watchlist: a plex.tv Watchlist tab, catalog page, Detail and hold-menu controls
- plxnative#803 input: a click with no control under it is OK after D-pad navigation
- plxnative#832 Route: a remux declares the source frame rate in the Load
- plxnative#833 tools: make test-crate works on the stable toolchain

One conflict, in the rebuilt-route projection of route/decision.rs: upstream now
declares `video_copy_fps(&applied.contract, p.src_fps)` where the fork had 0, and
clears Dolby Vision where the fork keeps the source's declaration on an HEVC video
copy. Resolved with upstream's rate line and the fork's Dolby Vision block, whose
else-branch clears Dolby Vision exactly as upstream does. No other fork code sets
the stream rate, so every copying remux now follows upstream's rule.
RichiL10 added a commit to RichiL10/plx-native that referenced this pull request Oct 18, 2026
… copy declares its rate

`enhanced_remux_plan_carries_the_source_rate_and_a_burn_does_not` (upstream plxnative#832) expects
the 4K fixture with an embedded subtitle to become upstream's forced burn. The fork never
burns into a 4K/Dolby Vision/HDR source by default (`sub_burn=never4k`), so, as for the
other upstream burn tests on that fixture, the second half now pins upstream's burn with
`set_sub_burn_for_test(Some(true))`.

The fork's own cold-start test on the 4K Dolby Vision copy ("Le due torri") now also
checks plxnative#832's rule on the fork route: the copy declares the film's own 23.976 rate.
GLinnik21 added a commit that referenced this pull request Oct 22, 2026
* Release notes and audit for v0.9.0

Action-required evaluation (README trigger list, read from the PRs, grep not run on a built tree): no hits that need a reader action. Launch links (#853) add an inbound surface (any app that can launch apps), stated in What's new; the 3.4 image cache writes to /media/developer/temp (#667); crash/error reports gain fixed-value fields with POLICY_VERSION unchanged (#632), stated under Changed; Watchlist and PMS notifications use hosts the app already reaches.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Release notes v0.9.0: coverage and accuracy pass

Note: correct the Collections surfaces (no TYPE menu; collection shelf
headings live on Home and a library's Recommended page), the Watchlist
hold-menu rows, the launch-link sign-in behaviour and platform-release
numbering, the notification-feed sentence and the per-profile settings
list (no stale "nine"). Add #832, #808, #750/#762, #709 (#628), #641,
#647, #793, #871, #877 (#679), #876 and the key-press frame work;
credit RichiL10 and Shakil Choudhury. #862 moves from Known issues to
the webOS 3.x lines as fixed by #578; the 3.9.3 source-build report
(#700) is kept in Compatibility. Compatibility links reports, not
reporters' profiles.

Audit: #862 provenance (attributed usage-report reading, no counts),
contributor list wording.

Action-required section: not owed. The README grep over
v0.8.0..origin/main (rust-modules/src src ci) hits only CI tooling,
test-only loopback listeners and fixture tokens, and the dev-only
/tmp/plxnative-trackmemory trigger; the audit's PR-by-PR reading in
"Deliberately not done" stands.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Release audit v0.9.0: name the toolchain by its pin file, not its version

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant