Repository navigation
Export, Media: codecs and containers from craft-libs; remove hevcenc, av1enc, vp9enc - #3522
Conversation
…ome from craft-libs crates/export and crates/media use craft-video, craft-audio and craft-media (one craft-libs rev) instead of filmcraft-h264enc, -prores, -aac, -isobmff, -matroska and -opus. The av1enc, hevcenc and vp9enc crates are removed: craft-video carries the same encoders, with the later changes merged in storytold/craft-libs#829. Their round-trip tests move to crates/export/tests and run against craft-video. opusenc stays (craft-libs has no Opus encoder yet), as do filmcraft-mpegts and the filmcraft-vp9, -hevc and -av1 decoders the tests use as oracles.
origin/main changed crates/vp9enc (short planes, #2995) and the av1enc oracle's temporary directory (#3497) after this branch removed those crates: craft-video has the same VP9 check (storytold/craft-libs#832) and the moved AV1 test keeps the tempfile change. All craft-libs crates (craft-media, -audio, -video, -pdf, -docpath, -quit, -ecproj-format, -update, -ui and the hayro patches) now pin d946889, which is craft-libs main 7f0f352 plus storytold/craft-libs#829. craft-video's encoder features are named h264-encode, hevc-encode and vp9-encode there.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
Main moved the codecs and containers to craft-libs (storytold#3522) and changed the FilmCraft crates; the conflicts were the pin, the lock file and the H.264 pinned-bytes test. The merged tree is the tested one: the FilmCraft pin at 142fddc1 for the AC-3 dac3 fix, the Box::new call sites, CONFORM_VERSION 4 and the regression test. The pinned-bytes test needs no change any more, since the encoder is now craft-video's.



Part of storytold/craft-libs#778 (one implementation per format, in craft-libs). Needs storytold/craft-libs#829, which this pins.
What changed
crates/exportandcrates/mediatake their codecs and containers from craft-libs instead of FilmCraft's crates and EffectCraft's own encoder crates.filmcraft-h264enccraft_video::h264filmcraft-prorescraft_video::proresfilmcraft-aac(encoder in export,AudioSpecificConfigin media)craft_audio::aacfilmcraft-isobmff(MP4/MOV writer in export, header reads in media)craft_media::isobmfffilmcraft-matroska(header read in media)craft_media::matroskafilmcraft-opus(decoder, test oracle ofopusenc)craft_audio::opuscrates/hevcenc,crates/av1enc,crates/vp9enccraft_video::hevc,::av1,::vp9; the three crates are deletedcraft-video's HEVC, AV1 and VP9 encoders are these three crates, moved there in craft-libs #706–#708. The two changes EffectCraft made afterwards (colour description #2879, AV1 motion search #2406) are merged into craft-video in storytold/craft-libs#829; the VP9 short-plane check (#2995) is there as storytold/craft-libs#832. The encoders' round-trip tests (FilmCraft's decoders and ffmpeg as oracles) move to
crates/export/tests/it/hevc_encoder.rsandav1_encoder/and run against craft-video.Code changes beyond the renames:
encodereturnsResultin craft-video's HEVC and AV1 encoders andprores::Frame::newreturnsResult, so those errors now reach the export error instead of a panic;Headimplements craft-media's oneByteSource.Pins
Every craft-libs crate is on one rev,
d946889(craft-libs main7f0f352plus #829): craft-media, craft-audio, craft-video, and the ones that were already here (craft-pdf, craft-docpath, craft-quit, craft-ecproj-format, craft-update, craft-ui, the hayro patches;xtask pdf-depsandcrates/pdf/README.mdname the new rev).d946889is the head of #829's branch, not a commit on craft-libsmain. Once #829 merges, move the pins to amaincommit.What stays, and why
crates/opusenc: craft-libs has no Opus encoder yet. craft-audio: Opus encoder (8/10) craft-libs#446 is this crate moved to craft-audio; switch when it merges.filmcraft-mpegts(LATM header read incrates/media): craft-media has no MPEG TS reader.filmcraft-vp9,-hevc,-av1as dev-dependencies: decoder oracles for the encoder tests.filmcraft-codecs,-media,-frame,-color,-time,-interchange,-project,-geom: footage decoding and timeline interchange through FilmCraft, not changed here. FilmCraft at the pinned rev still links its own isobmff, matroska, aac, opus and prores, so those are compiled twice until FilmCraft itself moves to craft-libs.crates/export/src/webm.rsis still EffectCraft's own EBML code;craft_media::matroskahas a muxer. Not changed here (Export: WebM writes a Matroska Colour element (#2925) #2926 is open on that file).Behaviour
hvcC/av1Crecords were identical, except HEVC in bitrate mode with a key frame every frame, where craft-video gives an IDR the average picture budget instead of four times it.movie_bytes.rsdid not move.d5ead4bpin: the SEI names itcraft-h264enc 0.1.0, and in a 20-frame comparison with the export settings the first ten packets after the SEI matched the old encoder and later ones differed in size by a few bytes. The exported files decode in the round-trip tests.crates/mediareads MP4 and Matroska headers with craft-media to find the AAC configuration of the track FilmCraft will play, while FilmCraft itself still opens the file with its own demuxers. The two are the same code at different revisions; if they ever disagree on a file, the channel order falls back to the channel count.aac_layoutanddownmixtests pass.Related PRs
craft-hevcenc,craft-av1enc,craft-vp9enc,craft-codecs) that do not exist; what landed in craft-libs is onecraft-videocrate with a feature per codec. That document needs updating; this PR does not touch it.crates/export/src/encode.rs,webm.rsand the encoder tests and will conflict.crates/vp8enc; under #372: uncompressed QuickTime (raw RGB / ARGB) output module format #778 that encoder belongs in craft-video.What I ran (Linux, ffmpeg 9.0.2 on the PATH)
On the final tree:
cargo fmt --check: clean.cargo clippy --workspace --all-targets -- -D warnings: clean.cargo xtask layers,assets,pdf-deps,lock-patches: ok.cargo test -p effectcraft-export -p effectcraft-media -p effectcraft-opusenc -p effectcraft-pdf: export 44 + 120 (6 ignored benches), media 80 + 53, opusenc 27 + 12, pdf 143; 0 failed.Before the last merge of
mainand the move of the other craft-libs pins (codec crates at #829's first commit):cargo xtask ciran fmt, clippy and the workspace tests up to theui-eguitest binary: 6,525 passed, 9 failed, all inui-egui(8 for a missing Japanese system font on this machine, 1ui_info_tracker_a11y"the analysis ended"). cargo stops at the first failing binary, so crates afterui-eguidid not run.Not run: the full workspace tests on the final tree (the build ran out of disk here), so the craft-ui bump is checked by clippy only;
cargo xtask wasm(no wasm32 target for this toolchain here). CI has to cover both.Summary by CodeRabbit