Repository navigation
Conversation
extract, inject and remove accept AV1: raw OBU streams and IVF files, and for extract and remove also Matroska and piped input. Reading, placing and writing the metadata OBUs is av1_parser's job, shaped after hevc_parser; src/core/av1.rs only picks out the ST 2094-40 messages, by the same test st2094_40_sei_msg applies to SEI messages, and encodes entries with Hdr10PlusMetadata::encode_with_opts. The hdr10plus library is unchanged. Extraction goes through Parser as for HEVC, so gap filling, validation, --verify and the JSON output are shared. The HEVC path is unchanged apart from stdin: its leading bytes are read to tell AV1 from HEVC, and Parser and Remover now take that reader rather than opening stdin again. Tests mirror the HEVC ones on the metadata of regular.hevc, in a 259 frame AV1 stream stored raw, as IVF and in Matroska: extraction gives the SceneInfo of regular_metadata.json, injection gives the stream it was made from, removal gives the base layer back. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Replaces #117.
Following your feedback on #116, AV1 now lives in a separate crate,
av1_parser, built afterhevc_parser. It parses OBUs, temporal units, the sequence header and metadata OBUs. With theav1_iofeature it owns the I/O: raw OBU streams, IVF, Matroska and stdin, throughAv1Processorand anIoProcessortrait with the same options (limit, Matroska track number). Units are written back in the container they came in.In hdr10plus_tool, only
src/core/av1.rsknows about AV1: it picks out the ST 2094-40 messages by the same testst2094_40_sei_msgapplies to SEI messages, and encodes entries withHdr10PlusMetadata::encode_with_opts. Thehdr10pluslibrary is unchanged.Changes
extract,injectandremoveaccept AV1 as an OBU stream or IVF.extractandremovealso take Matroska and piped input.injectrefuses Matroska and pipes, as it does for HEVC.Parser, so gap filling, validation,--verifyand the JSON output are the same as for HEVC.trailing_bits()and go after the sequence header, right before the first frame. FFmpeg's CBS parser accepts the output.ParserandRemovertake that reader instead of opening stdin again.av1_parseruses anyhow, bitvec_helpers and matroska-demuxer, and accepts the matroska-demuxer 0.7 thathevc_parser0.6.11 brings.extract,injectandremove.Tests
The AV1 tests mirror the HEVC ones on the metadata of
regular.hevc, in a 259 frame AV1 stream (64x64, ffmpegtestsrc2) stored as OBU stream, IVF and Matroska:extractgives the SceneInfo ofregular_metadata.jsonfrom all three and from stdin.injectgives the stream back byte for byte, also when metadata is already in it.removegives the base layer back byte for byte.--verifyand a stream without metadata behave as for HEVC.All CI steps pass on Linux:
cargo fmt --all --check,cargo clippy --workspace --all-targets --tests -- --deny warnings, and the tests.If you would rather maintain the crate yourself, I'm happy to transfer the repository to you.
🤖 Generated with Claude Code