From e7c239f2035ebaf03420be3805053b7608aa7728 Mon Sep 17 00:00:00 2001 From: Skyler Lehmkuhl Date: Thu, 25 Jun 2026 21:27:06 -0400 Subject: [PATCH] ci: enable VAAPI in the from-source ffmpeg build The libva guard fired: the release ffmpeg had no h264_vaapi. ffmpeg-sys-next configures with --disable-autodetect and only passes --enable-vaapi when its build-vaapi feature is set; ffmpeg-next 8.0 doesn't forward it, so installing libva-dev alone did nothing. Inject a direct ffmpeg-sys-next dependency with the build-vaapi feature (Linux only) in both the GitHub Actions and container build paths. With it, FFmpeg gets --enable-vaapi (and fails loudly if libva-dev is missing rather than silently shipping software-only). Co-Authored-By: Claude Opus 4.8 --- .github/workflows/build.yml | 13 +++++++++++++ packaging/container-build.sh | 3 +++ 2 files changed, 16 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 644bf44..379155f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -118,6 +118,19 @@ jobs: run: | sed -i.bak 's/ffmpeg-next = { version = "8.0", features = \["static"\] }/ffmpeg-next = { version = "8.0", features = ["build", "static"] }/' lightningbeam-ui/lightningbeam-editor/Cargo.toml + # ffmpeg-sys-next configures FFmpeg with --disable-autodetect and only passes --enable-vaapi + # when its build-vaapi feature is set; ffmpeg-next 8.0 doesn't forward it, so depend on the + # sys crate directly. Linux only (the feature is a no-op elsewhere and we only ship VAAPI on + # Linux). With it set, a missing libva-dev makes FFmpeg configure fail loudly instead of + # silently shipping a software-only build. + - name: Enable VAAPI in FFmpeg build (Linux) + if: matrix.platform == 'ubuntu-24.04' + shell: bash + run: | + sed -i '/^ffmpeg-next = /a ffmpeg-sys-next = { version = "8.0", features = ["build-vaapi"] }' \ + lightningbeam-ui/lightningbeam-editor/Cargo.toml + grep -n 'ffmpeg-sys-next' lightningbeam-ui/lightningbeam-editor/Cargo.toml + - name: Setup FFmpeg (Windows) if: matrix.platform == 'windows-latest' shell: pwsh diff --git a/packaging/container-build.sh b/packaging/container-build.sh index e586056..5fae87a 100755 --- a/packaging/container-build.sh +++ b/packaging/container-build.sh @@ -67,6 +67,9 @@ cd /build/src/lightningbeam-ui # Build FFmpeg from source and link statically (no .so bundling needed) sed -i 's/ffmpeg-next = { version = \"8.0\", features = \[\"static\"\] }/ffmpeg-next = { version = \"8.0\", features = [\"build\", \"static\"] }/' lightningbeam-editor/Cargo.toml +# Enable VAAPI: ffmpeg-sys-next configures with --disable-autodetect and only passes +# --enable-vaapi when its build-vaapi feature is set (ffmpeg-next 8.0 doesn't forward it). +sed -i '/^ffmpeg-next = /a ffmpeg-sys-next = { version = "8.0", features = ["build-vaapi"] }' lightningbeam-editor/Cargo.toml export FFMPEG_STATIC=1 # Stage factory presets for packaging