Repository navigation
feat(dv): recognise a recordless Dolby Vision Profile 5 from its first RPU - #567
Conversation
…t RPU A Matroska release can be Profile 5 (IPT-PQ-c2, no base layer) with the dvcC/dvvC BlockAdditionMapping dropped and an unspecified VUI. The engine reads Dolby Vision only from the container record, so it loaded as SDR hvc1 and the IPT picture was decoded as YCbCr. For untagged 10-bit HEVC with no record, the demuxer now reads the first RPU and, only if libdovi reads exactly profile 5, adds the record a genuine Profile 5 container would carry, so every downstream reader follows the existing Profile 5 paths. Co-Authored-By: Claude Sonnet 5 <[email protected]>
…ized The P5 colr override (nclx BT.2020 / PQ / BT.2020 NCL) exists for MP4 sources that lost their VUI. A record synthesized from the RPU belongs to a file whose VUI says nothing on purpose (IPT-PQ-c2 has no VUI code point), and the reference `ffmpeg -c copy -tag:v dvh1` output for the same file carries no colr at all, so the tuple stays unspecified there. Kept as its own commit: it is not shown to be necessary, only that playback is correct with it absent. Co-Authored-By: Claude Sonnet 5 <[email protected]>
fcd0521 to
7f10ec0
Compare
feat(dv): recognise a recordless Dolby Vision Profile 5 from its first RPU Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015PM3xUJB6ZQyqnmGK1fp6F
…#567) PR #567 skipped the Profile 5 `colr nclx` override for a record the engine synthesizes from the RPU. That override is the #19 repair, and the shape it repairs is exactly the one the new detection gates on: a Profile 5 whose VUI says nothing, which is every genuine Profile 5, IPT-PQ-c2 having no VUI code point. Measured on one bitstream in two containers, 8 s of Dolby's own P5 asset with its `dvcC` block addition mapping intact and with it renamed away: with the record, `init.mp4` is 883 B and carries `colr nclx` 9 / 16 / 9 with the full-range flag; with the record stripped and the skip in place, 864 B and no `colr`. One picture, two deliveries, decided by what the container happened to write down. With this the recordless file is served byte for byte like the recorded one. That leaves `Demuxer.synthesizedDolbyVisionRecord` with no reader, so it goes with it. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015PM3xUJB6ZQyqnmGK1fp6F
…567) The #532 budget is spent by sources that are broken before a packet is read: a Profile 5 record over a BT.2020 YCbCr VUI states its own contradiction, so walking sixteen packets for it costs nothing anyone else pays. The recordless gate from #567 is met by every untagged 10-bit HEVC, and an SDR encode with no colour description is a common shape that walks the whole budget to learn nothing. Measured against an origin at 150 ms latency and 1 MB/s, on a 30 MB untagged 10-bit SDR Matroska: `probe` costs 0.50 s with no audit, 2.75 s at a budget of 16, 1.21 s at 4 and about 1.2 s at 2. A Profile 5 carries an RPU in every frame and answers in the first video packet, which the recordless Profile 5 fixture still does at this budget, so four is slack rather than budget. The two gates now name their own. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015PM3xUJB6ZQyqnmGK1fp6F
…ike a recorded one, and its gate reads four packets (#567) Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015PM3xUJB6ZQyqnmGK1fp6F
|
Merged, thank you. The detection is the right shape: the record goes onto the demuxed stream before classification, so the route, the display criteria, the segment muxer's Reproduced here before merging, on a recordless Profile 5 built from Dolby's own P5 asset (the Two things I pulled in afterwards rather than sending the PR back. The The recordless arm reads fewer packets. 16 is right for #532, where the record-over-VUI pairing already proves the source is broken before a packet is read. Here the budget is spent mostly by sources that were never Dolby Vision: an untagged 10-bit HEVC SDR encode is a common shape. Measured against an origin with 150 ms of latency and 1 MB/s, on a 30 MB untagged 10-bit SDR MKV, Thanks for the write-up as well: the synthetic repro and the before and after lines made this reviewable without the source file. |
Summary
Some Matroska releases are Dolby Vision Profile 5 but carry no DV record in the container (and an
unspecified VUI), so the engine loads them as plain SDR and the IPT picture is decoded as YCbCr: a
violet/green cast. This reads the first RPU for that narrow case and adds the missing record, so the
existing Profile 5 paths take over.
What changed
AV_PKT_DATA_DOVI_CONF, and has transfer, matrixand primaries all unspecified, the demuxer reads the first RPU (
rpuProfileOfSource, libdovi'sguessed_profile). Only if it reads exactly profile 5 does it add a Profile 5 record (level 6, RPUpresent, no EL, BL present, compat 0) to the stream's
coded_side_data. Route, display criteria andthe segment muxer's
dvcC/dvh1then follow the existing Profile 5 paths; the load, the HLS producer'sown open and rebuilds agree with no verdict to carry.
record never reaches a packet read; a failed or non-5 read leaves the source as it was. URL sources only
(non-live, non-disc); cost is one extra open and up to 16 packets, for candidates only.
instead of playing with a cast.
colroverride for a synthesized record (the source deliberately saysnothing about colour; a plain
ffmpeg -c copy -tag:v dvh1copy carries nocolr). It is not shown to benecessary, only that playback is correct without it; happy to drop it.
Test plan
aetherctlon macOS.full range, colour tags unspecified / AC-3 5.1 / Dolby Vision Profile 5 with no container record
(streaming-service WEB-DL; every frame carries a profile 5 RPU).
recordless-p5-synthetic.mp4.
aetherctl probereportsformat: sdron unmodifiedmainandAE#recordless: DV profile 5 .../format: dolbyVisionwith this change. It shows the detection, notthe colour cast.
visible, on request.
prepared: codec=hvc1 ... range=SDR DV=none. After,AE#recordless: DV profile 5 from the first RPU,DV source: profile=5 compat=0 level=6,prepared: codec=dvh1.05.06 ... range=PQ DV=profile5, masterCODECS="dvh1.05.06" VIDEO-RANGE=PQ, and the servedinit.mp4carriesdvh1>hvcC,dvcC. Played on the Apple TV with correct colours. 7 new unit tests; 32 pass, 4 skipped forfixtures not in-repo.
recordless-p5-synthetic.mp4
Checklist
CHANGELOG.mdupdatedfeat(...),fix(...),chore(...))