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 <noreply@anthropic.com>
This commit is contained in:
Skyler Lehmkuhl 2026-06-25 21:27:06 -04:00
parent 7ebd64391c
commit e7c239f203
2 changed files with 16 additions and 0 deletions

View File

@ -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

View File

@ -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