Repository navigation
fix(mux): preserve Opus timing in fMP4 exports - #7118
Conversation
Co-Authored-By: GPT-6 <noreply@openai.com>
|
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 36 minutes. 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 |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed commit: 313b59e
No actionable bugs found. Adding the Opus-only edit in final init assembly is a focused correction: both synthesized and source-CMAF tracks use the settled media timescale, source edits remain stripped, and the mapping agrees with the importer's pre-skip adjustment. This is simpler than changing packet timestamps and avoids changing the Hang wire/API. The regression covers zero/maximum pre-skip, both timescales and init paths, and the inverse import mapping.
Verification: static inspection of the diff, init/export/muxer paths and edit handling only; I did not run Rust tests, FFmpeg controls or browser playback, and have not independently verified the PR's reported validation.
|
Merge summary for head 313b59e:
(Written by Claude Opus 5.5) |
fix(mux): preserve Opus timing in fMP4 exports (backport #7118)
Problem
An Opus fMP4 export presents decoded samples one pre-skip late. The stable current/current and released/released Rust controls in moq-dev/moq#7061 both fail the unchanged tone check by 321us with a 312-sample pre-skip. Deleting only the source MP4 edit list reproduces that exact error; retaining it passes.
Hang timestamps place every decoded Opus sample one pre-skip before its packet timestamp. Import applies source edits to that timeline. Export drops those source edits, keeps
dOps.pre_skip, and writes the normalized timestamps intotfdt;dOpsalone does not express the inverse presentation shift to an MP4 reader.Approach
At final fMP4 init assembly, emit an Opus-only edit starting at the pre-skip converted to the output media timescale. Its zero segment duration follows the existing live implicit-duration convention. Do this after track timescales settle, for both synthesized and source CMAF tracks. Keep source-edit stripping and frame timestamps unchanged.
Impact
Alternatives
Shifting unsigned packet timestamps cannot represent the priming before a stream starting at zero. Adjusting the tone checker or normalizing FFmpeg output would conceal an actual export defect.
Validation
quest gate just ci: passed in 445s, including 4,140 Rust tests and the selected feature, boundary, and metadata checks.git diff --check: passed.just test interop --all: passed, all 180 media, authorization, finished-media, FETCH, and tail checks.export fmp4decoded by FFmpeg with-copytspasses the unchanged tone/phase assertion and its swapped-tone negative control. The decode-command repair is tracked separately in moq-dev/moq#7061.-copytsgives first kept PTS 0, next 13500us, and phase errors +3us/+1us. Removing onlyedtsfrom those exact bytes gives PTS 6500/20000us and fails at +321us. Movie/track/edit duration and atom-order probes did not fix the old decode command: FFmpeg's default timestamp sanitization caused that separate driver error.Follow-ups
Recommend evaluating a release backport after this fix lands. Exact published moq-cli 0.14.9/moq-relay 0.17.9 still fail their stable control with
-copyts, now at +781us; that complete cause remains unverified. moq-dev/moq#7061 needs the released controls rerun after a corrected CLI is published, followed by a full wire remeasurement. No release, merge, or compatibility-policy change is made here. No new quests created.(Written by GPT-6)