Skip to content

Export, Media: codecs and containers from craft-libs; remove hevcenc, av1enc, vp9enc - #3522

Merged
dylanmtaylor merged 5 commits into
mainfrom
codecs-from-craft-libs
Nov 11, 2026
Merged

dylanmtaylor merged 5 commits into
mainfrom
codecs-from-craft-libs

Conversation

@dylanmtaylor

@dylanmtaylor dylanmtaylor commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Part of storytold/craft-libs#778 (one implementation per format, in craft-libs). Needs storytold/craft-libs#829, which this pins.

What changed

crates/export and crates/media take their codecs and containers from craft-libs instead of FilmCraft's crates and EffectCraft's own encoder crates.

Was Now
filmcraft-h264enc craft_video::h264
filmcraft-prores craft_video::prores
filmcraft-aac (encoder in export, AudioSpecificConfig in media) craft_audio::aac
filmcraft-isobmff (MP4/MOV writer in export, header reads in media) craft_media::isobmff
filmcraft-matroska (header read in media) craft_media::matroska
filmcraft-opus (decoder, test oracle of opusenc) craft_audio::opus
crates/hevcenc, crates/av1enc, crates/vp9enc craft_video::hevc, ::av1, ::vp9; the three crates are deleted

craft-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.rs and av1_encoder/ and run against craft-video.

Code changes beyond the renames: encode returns Result in craft-video's HEVC and AV1 encoders and prores::Frame::new returns Result, so those errors now reach the export error instead of a panic; Head implements craft-media's one ByteSource.

Pins

Every craft-libs crate is on one rev, d946889 (craft-libs main 7f0f352 plus #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-deps and crates/pdf/README.md name the new rev). d946889 is the head of #829's branch, not a commit on craft-libs main. Once #829 merges, move the pins to a main commit.

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 in crates/media): craft-media has no MPEG TS reader.
  • filmcraft-vp9, -hevc, -av1 as 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.
  • The WebM writer in crates/export/src/webm.rs is still EffectCraft's own EBML code; craft_media::matroska has a muxer. Not changed here (Export: WebM writes a Matroska Colour element (#2925) #2926 is open on that file).

Behaviour

  • HEVC, AV1, VP9: a scratch test (not in this PR) encoded the same frames with the deleted crates and with craft-video, in constant-quality and bitrate modes, 8 and 10 bit. All packets and hvcC / av1C records 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.
  • ProRes: the pinned MOV bytes in movie_bytes.rs did not move.
  • H.264: the pinned MP4 hash changes (104,342 to 104,366 bytes). craft-video's encoder is FilmCraft's at a later revision than the d5ead4b pin: the SEI names it craft-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/media reads 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_layout and downmix tests pass.

Related PRs

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 main and the move of the other craft-libs pins (codec crates at #829's first commit): cargo xtask ci ran fmt, clippy and the workspace tests up to the ui-egui test binary: 6,525 passed, 9 failed, all in ui-egui (8 for a missing Japanese system font on this machine, 1 ui_info_tracker_a11y "the analysis ended"). cargo stops at the first failing binary, so crates after ui-egui did 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

  • Updates
    • Movie export now uses craft-libs codec support for H.264, ProRes, HEVC, VP9, AV1, and AAC. Opus support remains available.
    • Exported movie output may differ slightly; the expected H.264 MP4 output has been updated.
  • Documentation
    • Codec information for movie export and PDF support notes have been updated.

…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.
@coderabbitai

coderabbitai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The workspace now uses craft-libs codec and container crates for export and media operations. The local AV1, HEVC, and VP9 encoder crates were removed. Related dependencies, tests, documentation, and PDF dependency pins were updated.

Changes: Codec and media crate migration

Layer / File(s) Summary
Shared dependency pins and workspace configuration
Cargo.toml, crates/pdf/README.md, xtask/src/pdf_deps.rs
Workspace craft-libs dependencies, related patches, and PDF revision references now use revision e7c3dda7f3e339dd2c8d40fc4eb405472be1a1e4. Development optimization settings target craft-video, craft-audio, and craft-media.
Export codec and container integration
crates/export/Cargo.toml, crates/export/src/*, crates/export/tests/it/*, README.md, crates/host/src/lib.rs
Export paths and tests use craft-libs codec and container types. The H.264 byte-pinning expectation changed, and several encoder tests now expect encoding to succeed.
Media parsing and Opus test integration
crates/media/Cargo.toml, crates/media/src/*, crates/media/tests/it/*, crates/opusenc/Cargo.toml, crates/opusenc/README.md, crates/opusenc/tests/it/common/mod.rs
Media parsing and AAC configuration use craft-audio and craft-media. The Opus integration-test decoder now uses craft-audio.
Remove local AV1, HEVC, and VP9 encoder crates
crates/av1enc/*, crates/hevcenc/*, crates/vp9enc/*, docs/architecture.md, xtask/src/main.rs
The three encoder crates and their manifests, implementations, tests, and READMEs were deleted. The architecture table and workspace layer list no longer include them.

Estimated code review effort: 4 (Complex) | ~60 minutes

Change: Refactor

Suggested reviewers: aiongg

Merge Risk: Minimal · up to 3b8d2

This change moves export and media code onto craft-libs codecs and containers and removes the local AV1, HEVC and VP9 encoder crates. No concrete merge-blocking problem was found. Run the wasm build and the full workspace tests in CI before merging.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the two main parts of the change: codecs and containers in crates/export and crates/media now come from craft-libs, and the hevcenc, av1enc, and vp9enc crates are removed. The raw summ…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the two main parts of the change: codecs and containers in crates/export and crates/media now come from craft-libs, and the hevcenc, av1enc, and vp9enc crates are removed. The raw summary confirms both parts. The title does not mention the pin revision bump or the error propagation changes, which are secondary details.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between e1d7ec3 and 3b8d231.

Files ignored due to path filters: 1

  • Cargo.lock is excluded by !**/*.lock
Files selected for processing: 3

  • Cargo.toml
  • crates/pdf/README.md
  • xtask/src/pdf_deps.rs
Files skipped from review as they are similar to previous changes: 1

  • crates/pdf/README.md

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 5 remain after this review.

@sonarqubecloud

Copy link
Copy Markdown

@dylanmtaylor
dylanmtaylor merged commit 79c4274 into main Nov 11, 2026
12 checks passed
nanox333 pushed a commit to nanox333/effectcraft-fork that referenced this pull request Nov 12, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant