Skip to content

fix(mux): start fMP4 passthrough video at a sync sample - #6743

Merged
kixelated merged 3 commits into
mainfrom
quest/m1/fmp4-passthrough-sync
Oct 25, 2026
Merged

kixelated merged 3 commits into
mainfrom
quest/m1/fmp4-passthrough-sync

Conversation

@kixelated

@kixelated kixelated commented Oct 25, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

An fMP4 passthrough video track that joined mid-GOP published its leading non-sync samples as the start of a group, frames a decoder cannot use. The unwrapped path already skipped them.

Both modes now share one rule, the Fmp4Track::orphaned flag from moq-dev/moq#6686: a video track starts orphaned, so run drops every sample until the first sync sample. A fragment that starts mid-GOP and reaches a sync sample is trimmed through the existing kept rewrite, so passthrough opens its group on the sync sample.

Choices made without asking:

  • Import::seek orphans video tracks too, since a seek is the other mid-stream join. Before, passthrough opened the seeked group on whatever fragment came next; unwrapped skipped via MissingKeyframe.
  • With both joins covered, the unwrapped path's MissingKeyframe swallow is unreachable, so it is gone and an unexpected one now fails loud. unwrap no longer reports whether a group opened; a skipped fragment never reaches it.
  • Audio stays un-orphaned at the start: its samples decode alone whatever their sync flags say.
  • A wholly dropped leading fragment no longer anchors the catalog clock, the same as a fragment the edit list drops.

Impact

  • Public API: none. fmp4::Import::seek docs now say video resumes at its next sync sample.
  • Wire: none.

Tests

  • New video_joined_mid_gop_starts_at_a_sync_sample covers both modes: a fully non-sync first fragment, a fragment whose sync sample is in the middle, and a mid-GOP fragment after seek. Before the fix, passthrough failed it.
  • just rs test -p moq-mux: 1743 passed.
  • just check: passed (the one shear warning, an unlinked moq-audio file, predates this branch).

Closes the quest quest/m1/fmp4-passthrough-sync.md.

(Written by Claude Opus 5.5)

🤖 Generated with Claude Code

kixelated and others added 2 commits October 24, 2026 23:37
A passthrough video track joined mid-GOP, at the start or after a seek,
published its leading non-sync samples as the start of a group. Video
tracks now start orphaned, and seek orphans them again, so both modes
drop samples until the next sync sample through the edit-list rule.
The unwrapped path's MissingKeyframe skip is unreachable and goes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated kixelated changed the title fMP4 passthrough starts at a sync sample fix(mux): start fMP4 passthrough video at a sync sample Oct 25, 2026
@kixelated
kixelated marked this pull request as ready for review October 25, 2026 07:08
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 25, 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-25T18:09:43.071455Z 279225a New commits
ℹ️ 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 kixelated left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review by review (OpenAI)

Reviewed commit: 78dac27

No actionable bugs found in the changed code. Reusing the orphaned-sample filter for initial joins and seeks is a focused fix: both output modes wait for a sync sample, while passthrough trimming preserves retained samples' decode/composition timing. Removing the downstream MissingKeyframe swallow follows from that shared invariant without a second mechanism.

Verification: static review of the patch and surrounding filtering, fragment rewriting, grouping and producer code. The regression covers whole-fragment drops, a sync sample inside a fragment and post-seek drops in both modes. I did not run tests or independently verify reported test results.

@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

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 30 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
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 00b3594d-6d2f-48e4-b51b-d3bd5cc26d5a
Commits

Reviewing files that changed from the base of the PR and between 78dac27 and 279225a.

Files selected for processing: 4
  • quest/m1/README.md
  • quest/m1/fmp4-passthrough-sync.md
  • rs/moq-mux/src/container/fmp4/import.rs
  • rs/moq-mux/src/container/fmp4/import_test.rs

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2db5fdc6-6662-4a6e-bb33-1979fdc63b5c
Commits

Reviewing files that changed from the base of the PR and between e8f3bed and 78dac27.

Files selected for processing: 4
  • quest/m1/README.md
  • quest/m1/fmp4-passthrough-sync.md
  • rs/moq-mux/src/container/fmp4/import.rs
  • rs/moq-mux/src/container/fmp4/import_test.rs
Files with no reviewable changes: 2
  • quest/m1/README.md
  • quest/m1/fmp4-passthrough-sync.md

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 0 remain after this review.

Walkthrough

The fMP4 importer now starts video tracks in an orphaned state and drops video samples until a sync sample. Audio tracks start non-orphaned. Seeking marks video tracks orphaned again. The importer updates the current segment after processing a returned run, and unwrap propagates errors from producer.write. A new test checks startup and post-seek behavior in passthrough and non-passthrough modes. The related m1 planning entry and document were removed.

Priority: Normal

Merge Risk: Minimal · up to 78dac

No merge-blocking issue was established for the sync-sample gating change. The identified failed-seek path does not publish samples from the partially changed state.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 57.14% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly summarizes the main change: fMP4 passthrough video now starts at a sync sample.
Description check Passed The description directly explains the sync-sample behavior, orphaned video tracks, seek handling, tests, and impact of the changes.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Finishing Touches
✨ Simplify code
  • Commit to this branch
  • Create a new PR
  • 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.

@kixelated

Copy link
Copy Markdown
Collaborator Author

Landing as is: CI is green, Codex and the OpenAI review of 78dac27 found nothing actionable, and quest check --base origin/main passes.

(Written by Claude Opus 5.5)

@kixelated
kixelated added this pull request to the merge queue Oct 25, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 25, 2026
# Conflicts:
#	quest/m1/README.md
@kixelated
kixelated added this pull request to the merge queue Oct 25, 2026
@kixelated

Copy link
Copy Markdown
Collaborator Author

Left the merge queue on a conflict with main. Merged main: only quest/m1/README.md conflicted, and the fMP4 edit-list change in import.rs merged cleanly with moq-mux fmp4 tests and clippy passing. Re-queued after a Codex thumbs-up on 279225a.

(Written by Claude Opus 5.5)

Merged via the queue into main with commit b797848 Oct 25, 2026
11 checks passed
@kixelated
kixelated deleted the quest/m1/fmp4-passthrough-sync branch October 25, 2026 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant