Repository navigation
fix(tonemap): transcode HLG files tagged with BT.709 primaries - #2531
Conversation
ResolveSource classified every HLG source as SourceHLG, the BT.2020 kind. An HLG file tagged with BT.709 primaries then failed the metadata check, the start ran the source preflight, and the preflight rejected the decoded BT.709 frames, so the transcode never started. Choose SourceHLGBT709 when both the primaries and the matrix are tagged BT.709. That kind declares a BT.709 matrix to the converter, and its preflight also accepts frames with a BT.2020 matrix, so any other mix keeps the BT.2020 kind and the preflight that rejects it, as before. Closes #2528 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 1 minute. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
The four listed C3 cases in #1172–#1175 are all Suggested correction: Automated check: Macroscope check run agent (gpt-6-luna). No validation was performed. Posted via Macroscope — v1 validation impact |
Problem
Closes #2528
Related issue: N/A
Validation tasks: none
The server could not transcode HLG files tagged with BT.709 primaries, a format some cameras record. Any client that needed the server to convert one, such as a browser on an SDR display, got "Failed to start the playback transport." This change classifies those files as BT.709-gamut HLG, so the tone-mapped transcode starts and converts them with their own primaries.
tonemap.ResolveSourcemapped every HLG source toSourceHLG, the BT.2020 kind, without reading the primaries. The file's tags then contradicted that kind, so the start ran the source preflight, which rejected the BT.709 frames it decoded (decoded frame metadata does not match hlg fallback) and ended the start withtranscode_start_failed.Approach
The HLG branch of
ResolveSourcenow chooses the existingSourceHLGBT709kind when both the primaries and the matrix are tagged BT.709. Dolby Vision compatibility id 3 andsourceKindFromColorMetadataalready use this kind for BT.709-gamut HLG, and every executor's capability probe already covers it. Native playback, jellycompat transcodes, HDR-to-SDR downloads and seek-preview sheets all classify sources throughResolveSource, so all four pick up the change.The matrix has to match too because
SourceHLGBT709declares a BT.709 matrix to the converter, while its metadata check, and the preflight's frame check, also accept a BT.2020 matrix. Any other mix (an untagged, BT.2020 or BT.601 matrix) keeps the BT.2020 kind and its preflight, which rejects the file as it does today, rather than decoding it with the wrong matrix. Every HLG file that is not tagged BT.709 for both resolves exactly as before.One sentence in
docs/architecture/playback-protocol-v3.mdrecords the rule. There is no API contract change, so the Apple and Android apps need nothing.Validation
transcode_start_failedand the log line from the issue. The same clips with BT.2020 primaries played.go vet,make lint-changed,make test-goandmake verify-local-pathspass. No web files changed.Evidence
Evidence: https://evidence.siloserver.org/r/silo-server/issue-2528/
Risks
hdr_transcode_unsupported, where before they failed at start.Checklist
AI Disclosure
sonnetalias (two review subagents, exact version not reported); gpt-6.1-sol (background review)🤖 Generated with Claude Code