test(engine): write HDR fixture color tags into the H.264 VUI#2389
Merged
Conversation
The SDR-to-HDR extraction tests synthesize their HDR fixture with -color_trc/-color_primaries flags and rely on the encoder propagating them into the bitstream. The pinned Windows CI ffmpeg build drops the transfer on that path, so after #2377 narrowed HDR detection to the transfer function, the fixture probes as SDR on Windows and both tests fail (hdrPreflightCount 0). Write the VUI directly with the h264_metadata bitstream filter so the tag survives on every build.
This was referenced Jul 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Tag the synthetic HDR test fixture's color metadata directly in the H.264 bitstream (
h264_metadataBSF) instead of relying on the encoder to propagate the-color_*CLI flags into the VUI.Why
Tests on windows-latest(Windows render verification) has been red on main and on every code PR since #2377 merged. #2377 correctly narrowed HDR detection to the transfer function (PQ/HLG) — BT.2020 primaries alone are not HDR — but the SDR→HDR extraction tests synthesize their fixture with-color_trc smpte2084and depend on the encoder writing that into the bitstream. The pinned Windows CI ffmpeg build drops the transfer on that path, so the fixture probes as SDR there, no SDR→HDR preflight runs, and both tests fail withhdrPreflightCount0 (expected 1). Linux/macOS builds propagate the flag, which is why only Windows went red — and #2377's own Windows run was cancelled by a rapid main push, so it merged without ever seeing it.How
One change in
synthHdrTaggedClip: add-bsf:v h264_metadata=colour_primaries=9:transfer_characteristics=16:matrix_coefficients=9(bt2020 / PQ / bt2020nc). The BSF writes the VUI into the SPS itself, so the probe reportscolor_transfer=smpte2084regardless of encoder negotiation. The existing-color_*flags stay for container-level tagging.Test plan
bunx vitest run src/services/videoFrameExtractor.test.tsinpackages/engine: 67/67 pass locally (both previously failing SDR→HDR tests included).-color_*flags still probes ascolor_transfer=smpte2084, proving the tag no longer depends on encoder passthrough.Tests on windows-latestrun — it fails on main, so green here is the proof.Not covered