Skip to content

Add libaom to support AV1 codec#13

Merged
JonnyBurger merged 9 commits into
mainfrom
feature/av1
Mar 20, 2026
Merged

Add libaom to support AV1 codec#13
JonnyBurger merged 9 commits into
mainfrom
feature/av1

Conversation

@samohovets
Copy link
Copy Markdown
Member

@samohovets samohovets commented Mar 3, 2026

Use a stable CMake toolchain setup, make pkg-config discovery robust for lib/lib64, and stop masking arm build failures in Docker so ffmpeg AV1 configuration errors surface directly.

Made-with: Cursor
Switch deprecated macOS 13 labels to supported macOS 15 arm64/intel runners and make the libX11 cleanup step non-fatal so jobs can start reliably.

Made-with: Cursor
Disable NASM only on darwin/x64 to avoid libaom CMake failures on GitHub runners that report unsupported NASM multipass optimization.

Made-with: Cursor
Build libaom in 8-bit mode and rely on dav1d for AV1 decoding to trim artifact size while keeping AV1 encode support.

Made-with: Cursor
@samohovets samohovets requested a review from JonnyBurger March 18, 2026 12:50
Copy link
Copy Markdown
Member

@JonnyBurger JonnyBurger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-> Downloaded the binaries and put them in remotion-dev/rust-ffmpeg-sys
-> Updated Cargo.toml in remotion-dev/rust-ffmpeg
-> Updated Cargo.toml in remotion-dev/remotion
-> Ran bun build.ts --all in packages/compositor

Unfortunately remotion-dev/remotion does not compile, whereas it did before:

   Updating git repository `https://github.com/remotion-dev/rust-ffmpeg`
    Updating git repository `https://github.com/remotion-dev/rust-ffmpeg-sys`
     Locking 2 packages to latest compatible versions
      Adding ffmpeg-next v7.1.0 (https://github.com/remotion-dev/rust-ffmpeg?rev=8f113e914929e0f0ca14017701bb3b51a471843c#8f113e91)
      Adding ffmpeg-sys-next v7.1.0 (https://github.com/remotion-dev/rust-ffmpeg-sys?rev=e92611248be5b8dbc07831e531b688882a94a238#e9261124)
cargo build --release --target=aarch64-apple-darwin
   Compiling ffmpeg-sys-next v7.1.0 (https://github.com/remotion-dev/rust-ffmpeg-sys?rev=e92611248be5b8dbc07831e531b688882a94a238#e9261124)
error: failed to run custom build command for `ffmpeg-sys-next v7.1.0 (https://github.com/remotion-dev/rust-ffmpeg-sys?rev=e92611248be5b8dbc07831e531b688882a94a238#e9261124)`

Caused by:
  process didn't exit successfully: `/Users/jonathanburger/remotion/packages/compositor/target/release/build/ffmpeg-sys-next-1cd3941a4f03cfd3/build-script-build` (exit status: 101)
  --- stdout
  cargo:rustc-env=TARGET=aarch64-apple-darwin
  cargo:rustc-link-search=native=/Users/jonathanburger/.cargo/git/checkouts/rust-ffmpeg-sys-c5933b9ebbab4aba/e926112/extracted/aarch64-apple-darwin/remotion/lib
  cargo:rustc-link-lib=dylib=avcodec
  cargo:rustc-link-lib=dylib=avdevice
  cargo:rustc-link-lib=dylib=avfilter
  cargo:rustc-link-lib=dylib=avformat
  cargo:rustc-link-lib=dylib=avutil
  cargo:rustc-link-lib=dylib=swresample
  cargo:rustc-link-lib=dylib=swscale
  OPT_LEVEL = Some(3)
  OUT_DIR = Some(/Users/jonathanburger/remotion/packages/compositor/target/aarch64-apple-darwin/release/build/ffmpeg-sys-next-9d7364709ac0aa02/out)
  HOST = Some(aarch64-apple-darwin)
  cargo:rerun-if-env-changed=CC_aarch64-apple-darwin
  CC_aarch64-apple-darwin = None
  cargo:rerun-if-env-changed=CC_aarch64_apple_darwin
  CC_aarch64_apple_darwin = None
  cargo:rerun-if-env-changed=HOST_CC
  HOST_CC = None
  cargo:rerun-if-env-changed=CC
  CC = None
  cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
  RUSTC_WRAPPER = None
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some(false)
  cargo:rerun-if-env-changed=MACOSX_DEPLOYMENT_TARGET
  MACOSX_DEPLOYMENT_TARGET = None
  cargo:rerun-if-env-changed=CFLAGS_aarch64-apple-darwin
  CFLAGS_aarch64-apple-darwin = None
  cargo:rerun-if-env-changed=CFLAGS_aarch64_apple_darwin
  CFLAGS_aarch64_apple_darwin = None
  cargo:rerun-if-env-changed=HOST_CFLAGS
  HOST_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = None

  --- stderr
  check.c:3:22: fatal error: 'libavutil/avutil.h' file not found
      3 |             #include <libavutil/avutil.h>
        |                      ^~~~~~~~~~~~~~~~~~~~
  1 error generated.

  thread 'main' panicked at /Users/jonathanburger/.cargo/git/checkouts/rust-ffmpeg-sys-c5933b9ebbab4aba/e926112/build.rs:263:9:
  Compile failed
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
255 | 
256 |   const optimizations = all
257 |           ? `-C opt-level=3 -C lto=fat -C strip=debuginfo -C embed-bitcode=yes ${rPathOrigin} ${macOSHeaderPad}`
258 |           : macOSHeaderPad;
259 | 
260 |   execSync(command, {
       ^
error: Command failed: cargo build --release --target=aarch64-apple-darwin
 signal: null,
 status: 101,
 output: [ null, null, null ],
    pid: 2354,
 stdout: null,
 stderr: null,

      at genericNodeError (node:child_process:998:13)
      at checkExecSyncError (node:child_process:458:27)
      at execSync (node:child_process:278:31)
      at /Users/jonathanburger/remotion/packages/compositor/build.ts:260:2
      at loadAndEvaluateModule (2:1)

Bun v1.3.3 (macOS arm64)

@JonnyBurger JonnyBurger merged commit a7ef15f into main Mar 20, 2026
8 checks passed
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.

2 participants