Skip to content

Dolby Vision: direct-play Profile 7, converted to 8.1 in-app - #825

Merged
GLinnik21 merged 2 commits into
plxnative:mainfrom
RichiL10:feature/upstream-dv-p7
Oct 18, 2026
Merged

GLinnik21 merged 2 commits into
plxnative:mainfrom
RichiL10:feature/upstream-dv-p7

Conversation

@RichiL10

Copy link
Copy Markdown
Contributor

Profile 7 (a dual layer: base layer + enhancement layer + RPU, the shape of every UHD Blu-ray remux) is refused by Dovi::presentation as dual-layer, and because base_layer_unusable is also true for it, the server's permission to copy the video is withdrawn: PMS re-encodes 4K HEVC for a file whose base layer is an ordinary HDR10 picture.

The feed path now converts such a stream to Profile 8.1 on the way to the pipeline, as dovi_tool -m 2 does. When the demuxer's configuration record says Profile 7 with an enhancement layer and a cross-compatible base layer (ff::dovi_converts_to_p81), packet_to_annexb drops every enhancement-layer NAL (the UNSPEC63 wrapper a single-track dual layer stores each one in, and any NAL with nuh_layer_id > 0) and rewrites every RPU (UNSPEC62) to 8.1 with quietvoid's dolby_vision crate (parse_unspec62_nalu, convert_with_mode(To81), write_hevc_unspec62_nalu). An RPU that does not parse or convert is dropped, never forwarded as Profile 7.

Dovi::converts_to_p81 is the same test on the server's DOVI fields: such a stream is declared as what is fed (DolbyHdrInfo profileId 8, trackType single) on a set with confirmed Dolby Vision support, plays as its HDR10 base layer without a node otherwise, and is no longer base_layer_unusable. A dual layer without a cross-compatible base layer is still refused; Profile 5 is untouched. What the conversion discards is a full enhancement layer's residual detail above the base layer, as dovi_tool -m 2 does.

Tests: the route/payload decision for a converted and an unconvertible Profile 7, the configuration-record test, enhancement-layer NAL detection and dropping, and the RPU rewrite held byte for byte to dovi_tool's own MEL mode-2 fixture (plus a FEL RPU that must read back as profile 8). The three fixtures are dovi_tool test assets (MIT), attributed in THIRD-PARTY-NOTICES.md and tests/fixtures/README.md.

The dependency adds 13 third-party packages to the ARM graph (dolby_vision 3.4.0 and its tree). Each has a row with its licence and copyright holder in ci/third-party-crates.json, and THIRD-PARTY-NOTICES.md section 2.4 is regenerated from it (make notices). The two package-count budgets move from limit 72 (measured 71 on this base) to 87 (measured 84).

RichiL10 and others added 2 commits October 17, 2026 00:54
Profile 7 (a dual layer: base layer + enhancement layer + RPU, the shape of every UHD Blu-ray
remux) is refused by `Dovi::presentation` as `dual-layer`, and because `base_layer_unusable` is
also true for it, the server's permission to copy the video is withdrawn: PMS re-encodes 4K HEVC
for a file whose base layer is an ordinary HDR10 picture.

The feed path now converts such a stream to Profile 8.1 on the way to the pipeline, as
`dovi_tool -m 2` does. When the demuxer's configuration record says Profile 7 with an
enhancement layer and a cross-compatible base layer (`ff::dovi_converts_to_p81`),
`packet_to_annexb` drops every enhancement-layer NAL (the UNSPEC63 wrapper a single-track dual
layer stores each one in, and any NAL with nuh_layer_id > 0) and rewrites every RPU (UNSPEC62)
to 8.1 with quietvoid's `dolby_vision` crate (`parse_unspec62_nalu`, `convert_with_mode(To81)`,
`write_hevc_unspec62_nalu`). An RPU that does not parse or convert is dropped, never forwarded
as Profile 7.

`Dovi::converts_to_p81` is the same test on the server's DOVI fields: such a stream is declared
as what is fed (`DolbyHdrInfo profileId 8, trackType single`) on a set with confirmed Dolby
Vision support, plays as its HDR10 base layer without a node otherwise, and is no longer
`base_layer_unusable`. A dual layer without a cross-compatible base layer is still refused;
Profile 5 is untouched. What the conversion discards is a full enhancement layer's residual
detail above the base layer, as `dovi_tool -m 2` does.

Tests: the route/payload decision for a converted and an unconvertible Profile 7, the
configuration-record test, enhancement-layer NAL detection and dropping, and the RPU rewrite
held byte for byte to dovi_tool's own MEL mode-2 fixture (plus a FEL RPU that must read back
as profile 8). The three fixtures are dovi_tool test assets (MIT), attributed in
THIRD-PARTY-NOTICES.md and tests/fixtures/README.md.

The dependency adds 13 third-party packages to the ARM graph (`dolby_vision` 3.4.0 and its
tree). Each has a row with its licence and copyright holder in ci/third-party-crates.json, and
THIRD-PARTY-NOTICES.md section 2.4 is regenerated from it (`make notices`). The two
package-count budgets move from limit 72 (measured 71 on this base) to 87 (measured 84).

Signed-off-by: RichiL10 <[email protected]>
Resolve packet_to_annexb against plxnative#822: the Dolby Vision P7 enhancement-layer
drop and RPU rewrite run first, then strip_hdr10plus_sei.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@GLinnik21
GLinnik21 merged commit 17eb48b into plxnative:main Oct 18, 2026
14 checks passed
@GLinnik21

Copy link
Copy Markdown
Collaborator

Thanks, this is great. Merged.

I merged main in to resolve the conflict with #822 (your EL drop/RPU rewrite runs first, then the HDR10+ strip) and checked it on the TV: Stardust's P7 now direct-plays and the panel switches to Dolby Vision.

RichiL10 added a commit to RichiL10/plx-native that referenced this pull request Oct 18, 2026
Brings in the upstream commits since 84759b9:
- plxnative#822 HEVC: strip HDR10+ wherever it sits in an SEI NAL
- plxnative#817 Direct play: recover a plain-http body that ends early, goes silent or cannot be crossed
- plxnative#825 Dolby Vision P7 -> 8.1 (the fork's own b0856d6, squashed upstream with the author's
  resolution against plxnative#822)
- plxnative#835 Hungarian UI language, plxnative#836 ARM binary size budget re-baseline, plxnative#666 webOS 1-3 opt-in
  interface resolution

Conflict in rust-modules/media/src/ff.rs only:
- the DV definitions and packet_to_annexb are taken from upstream, which is the author's own
  resolution of plxnative#825 against plxnative#822 (EL drop and RPU rewrite first, then strip_hdr10plus_sei);
  packet_to_annexb is now identical to upstream main
- the fork keeps its video-copy remux fallback that arms the P7 conversion from the route's
  frozen source facts when PMS's Matroska remux omits the DOVI configuration record (remux_dv)
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.

2 participants