Skip to content

feat(probe): detect HDR Vivid (CUVA) carriage (#699) - #701

Merged
superuser404notfound merged 1 commit into
mainfrom
feat/699-hdr-vivid-probe
Oct 6, 2026
Merged

superuser404notfound merged 1 commit into
mainfrom
feat/699-hdr-vivid-probe

Conversation

@superuser404notfound

Copy link
Copy Markdown
Owner

What

The follow-up promised in #699: HDR Vivid detection in the opt-in probe, analogous to HDR10+.

  • ProbeDetail.hdrVivid (new) and SourceProbe.carriesHDRVividMetadata (new, same contract as carriesHDR10PlusMetadata: only ever set, false is never "proven absent").
  • Runs in the same packet pass as .hdr10Plus, under the same HDR10PlusDetectionOptions budget. The pass now stops once every requested target is confirmed; a cap that ends it after one of two keeps that confirmation (HDR10PlusDetectionOutcome.found).
  • HDRVividMetadataScan: libavcodec's CUVA parser is internal (ff_parse_itu_t_t35_to_dynamic_hdr_vivid), so the body is walked here with the same field widths, on top of the existing NAL/SEI walk (now parameterized by the T.35 payload validator). It counts only a complete message with system_start_code 1 to 7 and zero bits after the last field. HEVC only, like libavcodec.
  • videoFormat does not move: Vivid rides an HLG or PQ base, which stays the label. No playback change, the SEI was already stream-copied.
  • aetherctl probe --detect-hdr-vivid, and Scripts/make-hdr10plus-fixture.py --vivid (self-verifies against ffprobe's HDR Dynamic Metadata CUVA side data).

Verification

  • aetherctl probe --detect-hdr10plus --detect-hdr-vivid: the reporter's CUVA conformance stream B.1-04.mp4 and the new fixture report Vivid with format: hlg; the HDR10+ fixture reports HDR10+ only (format: hdr10Plus); a plain HEVC file reports neither.
  • The conformance stream's CUVA body is exactly 336 bits in 42 bytes across all 40 SEIs read, so the exact-fill rule matches real data.
  • HDRVividProbeTests: validator (complete, truncated, set padding bit, start-code range), outcome partial-finding semantics, base probe stays opt-in, .hdrVivid end to end, both targets on both fixtures.
  • swift test: 4073 swift-testing + 17 XCTest, exit 0. Strict concurrency clean on the touched files. check-doc-links.py clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WJcXkGQrMiBPixVEFTSBJS

ProbeDetail.hdrVivid scans HEVC packets for the CUVA T/UWA 005.1 T.35 SEI
and sets SourceProbe.carriesHDRVividMetadata. It shares the HDR10+ packet
pass and its HDR10PlusDetectionOptions budget, so asking for both opens
one connection, and a cap after one confirmation keeps it.

libavcodec's CUVA parser is internal, so HDRVividMetadataScan walks the
body with the same field widths over the shared NAL/SEI walk and counts
only a complete message with a defined system_start_code and zero bits
after its last field. videoFormat does not move: Vivid rides an HLG or PQ
base, which stays the label. Playback is unchanged.

aetherctl probe gains --detect-hdr-vivid; make-hdr10plus-fixture.py gains
--vivid, verified against ffprobe's CUVA side data. Measured: the CUVA
conformance stream B.1-04 and the new fixture report Vivid, the HDR10+
fixture reports HDR10+ only, a plain HEVC file neither.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WJcXkGQrMiBPixVEFTSBJS
@superuser404notfound
superuser404notfound merged commit 7fb0e77 into main Oct 6, 2026
5 of 8 checks passed
@superuser404notfound
superuser404notfound deleted the feat/699-hdr-vivid-probe branch October 6, 2026 03:17
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