Skip to content

fix(reader): colour the header does not state is read from the first sample for VP9, AV1 and HEVC alike - #35

Merged
gravity-zero merged 4 commits into
masterfrom
fix/vp9-feature-metadata-inband-colour
Nov 20, 2026
Merged

gravity-zero merged 4 commits into
masterfrom
fix/vp9-feature-metadata-inband-colour

Conversation

@gravity-zero

Copy link
Copy Markdown
Owner

Under the first-sample fallback (WithInBandColourFallback, -in-band, mp4.Options.InBandColour), some video tracks whose header names no colour never got it from their first sample. Reported by the downstream consumer on a real VP9 file, which it then sent to its second prober.

  • b96b03e - a VP9 track whose CodecPrivate holds the Matroska feature records (profile, bit depth, chroma, no colour) and that has no Colour element: the keyframe header was read only when the profile was missing.
  • ac5a9de - the same hole, looked for in the other codecs:
    • a VP9 Colour element that states the range alone left the colour "determined" and empty;
    • an AV1 track whose av1C holds no sequence header: a PQ video read as having no colour;
    • an HEVC track whose hvcC holds arrays but no SPS.

The rule is now one: no colour named by the container, and a codec record that states none. A track whose header states its colour reads no sample more; a VP9 Matroska file with no colour anywhere costs one more bounded read under the option.

Checks, on ac5a9de:

  • each case reproduced by a failing test before its fix;
  • make preflight RELEASE=v0.71.1 exit 0 in a container (gorelease asks for v0.71.1); FuzzReadMeta and FuzzCodecColour, 20 s each, exit 0;
  • 15 files encoded with ffmpeg (HEVC, H.264, AV1, VP9, VP8, MPEG-2, in Matroska and MP4): same colour fields before and after, and as ffprobe reads them; two AV1 PQ files whose record was stripped of its sequence header read as ffprobe reads them, where they had no colour;
  • the consumer measured b96b03e on the real file and ran its Go suite against it: exit 0.

Not covered: the consumer's suite on ac5a9de (asked); H.264 with no SPS in its record (not an HDR codec, left as is).

@gravity-zero
gravity-zero merged commit 414c879 into master Nov 20, 2026
13 checks passed
@gravity-zero
gravity-zero deleted the fix/vp9-feature-metadata-inband-colour branch November 20, 2026 19:11
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