Skip to content

fix(mux): populate display aspect across known-SPS importers - #5755

Merged
kixelated merged 6 commits into
mainfrom
quest/m2/display-aspect
Oct 17, 2026
Merged

kixelated merged 6 commits into
mainfrom
quest/m2/display-aspect

Conversation

@kixelated

@kixelated kixelated commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

H.264 VUI sample aspect and H.265 hvcC metadata were lost through codec, Matroska, and fMP4 import, leaving anamorphic pictures with the wrong catalog display shape.

Approach

Share SPS metadata across Annex-B, decoder configuration records, Matroska CodecPrivate, and avc1/avc3/hvc1/hev1 initialization. One apply_hvcc_sps helper serves both the Matroska and fMP4 hvcC paths. Square samples leave the display aspect unset, so the encode hint stays the fallback. AV1 render size is per-frame and does not establish a rendition-wide aspect, so AV1 is left out (documented in codec::av1).

Completes and deletes quest/m2/display-aspect.md.

Impact

  • Public API: no shape changes; the existing FFI coded and display_aspect fields gain doc lines.
  • Wire: existing catalog display-aspect and fixed-frame-rate fields are populated in more import paths; no format change.
  • Behavior: an fMP4 hvc1/hev1 or Matroska HEVC initializer whose listed SPS fails to parse now errors instead of importing without metadata. H.264 stays lenient, as Avcc::parse already was.

Decisions

Settled unattended by the iterating agent, recommended option taken:

Should headerless avc3/hev1 initializers (SPS only inside later CMAF media) get their aspect in this PR?

  • ✅ No: land the known-SPS fix, complete this quest, and plan the in-band acquisition separately. It needs media-payload inspection and a catalog update after the first keyframe, a different shape from this change.
  • Extend this quest to inspect fMP4 media payloads before closing it.

Validation

Regression tests cover non-square and square SPS fixtures through the codec, Matroska, and all four fMP4 sample entries, plus headerless avc3/hev1 controls; each fails before its fix. Scoped just check passes, and just test interop --all passed on the earlier head.

Follow-ups

  • Container aspect signals: fMP4 pasp and Matroska DisplayWidth/DisplayHeight are not read. They are the only rendition-wide aspect for AV1, and cover headerless avc3/hev1 initializers that carry pasp.
  • In-band SPS acquisition for headerless avc3/hev1 fMP4 initializers.

🤖 Generated with Claude Code

(Written by GPT-6 and Claude Opus 5.5)

kixelated and others added 5 commits October 16, 2026 11:09
Co-Authored-By: GPT-6 <noreply@openai.com>
…lay aspect quest

The known-SPS fix lands here; headerless avc3/hev1 acquisition and container
aspect signals (pasp, Matroska DisplayWidth) are left for follow-ups.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated
kixelated marked this pull request as ready for review October 17, 2026 04:32
@coderabbitai

coderabbitai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You'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 18 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a7d194b3-f75e-43d2-9f66-3806f28b420e
📥 Commits

Reviewing files that changed from the base of the PR and between 32999bc and d03ec14.

📒 Files selected for processing: 13
  • quest/m2/README.md
  • quest/m2/display-aspect.md
  • rs/moq-ffi/src/media.rs
  • rs/moq-mux/src/codec/av1/mod.rs
  • rs/moq-mux/src/codec/h264/import.rs
  • rs/moq-mux/src/codec/h264/mod.rs
  • rs/moq-mux/src/codec/h265/import.rs
  • rs/moq-mux/src/codec/h265/mod.rs
  • rs/moq-mux/src/codec/video.rs
  • rs/moq-mux/src/container/fmp4/import.rs
  • rs/moq-mux/src/container/fmp4/import_test.rs
  • rs/moq-mux/src/container/mkv/import.rs
  • rs/moq-mux/src/container/mkv/import_test.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-17T04:37:23.617858Z 6c2cfb8 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@kixelated

Copy link
Copy Markdown
Collaborator Author

Merging per maintainer approval, ahead of #5846.

  • Lands display aspect (and fixed frame rate) for every known-SPS H.264/H.265 import path: Annex-B, avcC/hvcC, Matroska, and fMP4 avc1/avc3/hvc1/hev1. AV1 is left out because its render size is per-frame.
  • Matroska and fMP4 share one apply_hvcc_sps helper for the hvcC SPS read.
  • Scope decision: headerless avc3/hev1 initializers (SPS only in later media) are a follow-up; the quest is complete and deleted.
  • Planned follow-up: read container aspect signals (fMP4 pasp, Matroska DisplayWidth/DisplayHeight), the only rendition-wide aspect for AV1.
  • Codex reviewed 6c2cfb8 with no findings; the new head only merges main (no conflicts) and passes scoped just check. TS validation is not required and is fixed separately by fix(mux): put a live export's budget on its first SUBSCRIBE #5854.

(Written by Claude Opus 5.5)

@kixelated
kixelated enabled auto-merge October 17, 2026 14:44
@kixelated
kixelated added this pull request to the merge queue Oct 17, 2026
Merged via the queue into main with commit 88ccdec Oct 17, 2026
12 checks passed
@kixelated
kixelated deleted the quest/m2/display-aspect branch October 17, 2026 15:53
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