Repository navigation
Conversation
Quest-Claim: 45a3c691cf93d56c
Export::finish and repair take a list of chapters and write them into the finished moov as a chpl box and a QuickTime chapter text track. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Completes
quest/m1/mp4-chapters.md.Summary
container::mp4'sExport::finishandrepairtake a list ofChapter { time: Timestamp, title: String }and write them into the finishedmoovin both forms the quest decided on:chplbox in themoov'sudta.hdlrtext, atx3gsample entry,nmhd), linked from the first track (the video track when there is one) bytref chap. Each sample is a 16-bit length, the UTF-8 title, and anencdatom as ffmpeg writes it. A chapter lasts until the next starts, the last until the movie ends, and a first chapter after the movie's start sits behind an empty edit. The track is not enabled, so a player lists it instead of drawing it.The text lies in an
mdatbetween the media and themoov, so a finish still ends with themoovandrepairstops at thatmdatas it does at themoov.Finish::moovbecametail(the textmdatif any, then themoov), so a repair compares the whole trailer and a file finished with other chapters is finished again.Each chapter's time maps onto the movie's time through the earliest track start, which only moq-mux knows; a chapter before the first sample or at or after the movie's end is dropped, not clamped. Chapters are sorted by start (stable). Moq-cli passes none.
Impact
Breaking, Rust only (no wire or JS counterpart:
moq-muxMP4 export has none).container::mp4::Export::finish(self)is nowfinish(self, chapters: &[Chapter]).container::mp4::repair(file)is nowrepair(file, chapters: &[Chapter]).container::mp4::Chapter, andfmp4::Error::{TooManyChapters, ChapterTitleTooLong}.Migration: pass
&[]to keep today's output byte for byte.Validation
cargo test -p moq-mux --lib container::(1431 passed) andcargo clippy -p moq-mux -p moq-cli --all-targetsclean.Intro0.0-0.9 s andCafé 🎬0.9-2.97 s, and the files are byte-identical. Withchplrenamed away, or withtref chaprenamed away, ffprobe still lists both chapters, so each form works alone. The unfinished file lists none.Decisions
Recommendations taken for review to undo:
Chapter.timeis amoq_net::Timestamp(the clock frames use) andfinish/repairtake a slice, since markers are only known when the recording ends. No builder method.chplbox's one-byte counts) fails the finish with an error instead of truncating or dropping, per fail loud. A caller can finish again without them, or repair.tx3gsample entry under atexthandler, because mp4-atom cannot encode QuickTime'stextentry. ffmpeg reads it; Apple's reader is the follow-up.chplis derived from the same ticks.mdatbefore themoovrather than after themoov, so themoovstays last and its chunk offset needs no second pass.Follow-ups
Models
Size: S
Implementer: Claude, claude-sonnet-5-5, high effort (arm B)
(Written by Claude Sonnet 5.5 with high effort)
🤖 Generated with Claude Code
Review
Rewritten by
quest reviewafter each round.Head: 12b1ead, named in full once no reviewer reports a finding
Base: origin/main at 3728b96
Risk: high,
Changing the public Rust finish and repair signatures breaks downstream callers, and changing exported MP4 structure can affect players consuming recordings; reverting restores the code but does not undo files already written.Classified: high by Codex, gpt-6.1-sol, low effort, session
01a1fc0a-fc64-7c52-b49a-6ba8a7413141Reviewer: Codex, gpt-6.1-sol, medium effort
Session:
01a1fc0b-1492-79f2-9db6-7b0a8043baad, round 1Score: 7/10,
The chapter track needs an independent, lower timescale so valid long recordings can finish and repair successfully.Rounds: 1; first round 1 (medium 1); findings 1 (medium 1): fixed 0, refuted 0, open 1
Findings, open until the next round settles them:
rs/moq-mux/src/container/mp4.rs:766:Give chapter samples an independent, lower timescaleReviewer: Codex, gpt-6.1-sol, low effort, shadow
Session:
01a1fc0b-14a5-7e81-a500-f5588db989ab, round 1Score: 7/10,
The chapter export is largely coherent, but repair must preserve existing chapter metadata before landing.Rounds: 1; first round 1 (high 1); findings 1 (high 1): fixed 0, refuted 0, open 1
Findings, open until the next round settles them:
rs/moq-cli/src/repair.rs:61:Preserve existing chapters when repairing from the CLI