Repository navigation
Conversation
…ze MP4 files as the MP4 profile (§18) Add `refkv.stream` (conventions §10), one array-to-bytes codec for audio and video streams whose frames depend on earlier ones: a chunk is a varint header giving each coded frame's size and output position (-1 for the lead-in frames a decoder needs first), then the frames, decoded in one pass by ffmpeg's decoders through PyAV, each packet tagged with its index so that every output is placed by the frame it came from, in whatever order the decoder emits it. The `media` extra (PyAV) replaces `audio` (miniaudio). MP3 (breaking): the array is float32 and its codec `refkv.stream` with format mp3. ffmpeg's fixed-point MP3 decoder carries rounding error from frame to frame and miniaudio drops a lead-in frame whose reservoir is missing, so neither can decode a chunk exactly; the float decoder does. MP4 (spec/virtualize/mp4.md, §18): an MP4 or QuickTime file is read through its moov box alone (never the media). Every box is an IR struct with its fields and tables, and every sample a data element; each H.264 track (8-bit 4:2:0, closed groups) becomes Y, U and V planes and presentation times, each AAC-LC or MP3 track float32 samples, under tracks/<id>; other tracks are listed with the reason. A video chunk decodes from the sync sample before it, an AAC chunk from the frame before it. Synthetic fixtures (fixtures/mp4, 17 accepted, 8 rejected, written by ffmpeg) are checked against ffmpeg's decoding by python/tests/ir/test_mp4.py and js/test/mp4/verify.py, value for value but for AAC's noise-substituted bands; corpus_mp4.txt lists a Prelinger film. Assisted-by: ClaudeCode:claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…he MP4 profile becomes §19 Assisted-by: ClaudeCode:claude-opus-5-5 Co-Authored-By: Claude Opus 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.
🤖 AI text below 🤖
This adds
refkv.stream(conventions §10), one Zarr codec for audio and video streams whose frames depend on earlier frames, and moves MP3 onto it. It also adds the MP4 profile: H.264 video tracks become Y, U and V planes with presentation times, and AAC and MP3 tracks become float32 samples, all read through themoovbox alone.What the implementation changed in the design
Verified: the Rust core's tests;
pytest(2149 passed); the Node tests (638);just sections;js/test/mp3/verify.pyandjs/test/mp4/verify.py(0 failures; every video plane, time and audio sample equal to ffmpeg's decoding, except AAC's noise bands);just cli-test;just cli-identical --only mp(558 conversions identical). A picture of the public Prelinger film, read over HTTP through the archive, equals ffmpeg's.Known costs, not changed
python/src/refkv/zarr/codecs.pyimports PyAV inside_av(), deliberately, like the existing imagecodecs import for an optional extra.Stack bookkeeping
Based on main after #91 (MP3) and #92 (User-Agent); independent of other open PRs. Main was merged in after #88 (FITS) took §18, so the MP4 profile is §19. The MP4 and MP3 fixture generators need ffmpeg (and lame), so
just fixturesskips them like NDPI's;just fixtures-of mp4regenerates.🤖 Generated with Claude Code