From 669d40ae218207cd26be4388f180c60c30ff05da Mon Sep 17 00:00:00 2001 From: enricobuehler Date: Tue, 9 Jun 2026 18:13:40 +0000 Subject: [PATCH] build: migrate to ffmpeg-next 8 (FFmpeg 8.x / libavcodec 62) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ubuntu 26.04 ships FFmpeg 8.0 (libavcodec 62); bump ffmpeg-next 7.1 -> 8.1 to bind it as the intended pairing. No source changes needed — the encode API surface we use (avcodec_send_frame, hwframe contexts, AV_PIX_FMT_CUDA, av_log) is stable across 7->8. Workspace builds + all tests green; clippy/fmt clean. Refresh the 7.x doc references. Co-Authored-By: Claude Opus 4.8 (1M context) --- CLAUDE.md | 3 +- Cargo.lock | 44 ++++++--------------------- crates/lumen-host/Cargo.toml | 2 +- crates/lumen-host/src/encode/linux.rs | 2 +- docs/linux-setup.md | 4 +-- 5 files changed, 16 insertions(+), 39 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 90b67fd..0d9447a 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -73,7 +73,8 @@ scripts/headless/prepare-session.sh` (shell 2), then `cargo run -p lumen-host -- M0 uses the **CPU-copy capture path** (portal → PipeWire shm, packed `RGB` on wlroots → NVENC `rgb0`); dmabuf→NVENC zero-copy is deferred (plan §9). Pinned crate facts (the setup doc has the why): `ashpd` **0.13** (`screencast` feature, options-struct API, multi-thread -tokio runtime) + `pipewire` **0.9** (must match ashpd's; not 0.10) + `ffmpeg-next` **7.x**. +tokio runtime) + `pipewire` **0.9** (must match ashpd's; not 0.10) + `ffmpeg-next` **8.x** +(binds the system FFmpeg **8.x** / libavcodec 62 on Ubuntu 26.04; bumped from 7.x). ## Next: M2 — P1 host to a stock Moonlight client diff --git a/Cargo.lock b/Cargo.lock index 6ab133e..8166486 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -340,24 +340,6 @@ version = "1.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06" -[[package]] -name = "bindgen" -version = "0.70.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f49d8fed880d473ea71efb9bf597651e77201bdd4893efe54c9e5d65ae04ce6f" -dependencies = [ - "bitflags", - "cexpr", - "clang-sys", - "itertools", - "proc-macro2", - "quote", - "regex", - "rustc-hash 1.1.0", - "shlex 1.3.0", - "syn", -] - [[package]] name = "bindgen" version = "0.72.1" @@ -372,7 +354,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "rustc-hash 2.1.2", + "rustc-hash", "shlex 1.3.0", "syn", ] @@ -849,9 +831,9 @@ dependencies = [ [[package]] name = "ffmpeg-next" -version = "7.1.0" +version = "8.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da02698288e0275e442a47fc12ca26d50daf0d48b15398ba5906f20ac2e2a9f9" +checksum = "f7c4bd5ab1ac61f29c634df1175d350ded29cf74c3c6d4f7030431a5ae3c7d5d" dependencies = [ "bitflags", "ffmpeg-sys-next", @@ -860,11 +842,11 @@ dependencies = [ [[package]] name = "ffmpeg-sys-next" -version = "7.1.3" +version = "8.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9e9c75ebd4463de9d8998fb134ba26347fe5faee62fabf0a4b4d41bd500b4ad" +checksum = "a314bc0e022a33a99567ed4bd2576bd58ffd8fcff7891c29194cfecc26a62547" dependencies = [ - "bindgen 0.70.1", + "bindgen", "cc", "libc", "num_cpus", @@ -1430,7 +1412,7 @@ version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "901049455d2eb6decf9058235d745237952f4804bc584c5fcb41412e6adcc6e0" dependencies = [ - "bindgen 0.72.1", + "bindgen", "cc", "system-deps", ] @@ -1862,7 +1844,7 @@ version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb028afee0d6ca17020b090e3b8fa2d7de23305aef975c7e5192a5050246ea36" dependencies = [ - "bindgen 0.72.1", + "bindgen", "libspa-sys", "system-deps", ] @@ -1994,7 +1976,7 @@ dependencies = [ "pin-project-lite", "quinn-proto", "quinn-udp", - "rustc-hash 2.1.2", + "rustc-hash", "rustls", "socket2", "thiserror 2.0.18", @@ -2015,7 +1997,7 @@ dependencies = [ "lru-slab", "rand 0.9.4", "ring", - "rustc-hash 2.1.2", + "rustc-hash", "rustls", "rustls-pki-types", "rustls-platform-verifier", @@ -2265,12 +2247,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - [[package]] name = "rustc-hash" version = "2.1.2" diff --git a/crates/lumen-host/Cargo.toml b/crates/lumen-host/Cargo.toml index f5b06f6..711dee0 100644 --- a/crates/lumen-host/Cargo.toml +++ b/crates/lumen-host/Cargo.toml @@ -36,7 +36,7 @@ rusty_enet = "0.4" # `open_pipe_wire_remote` is unconditional, so ashpd's own `pipewire` feature is not # needed — we drive PipeWire with the `pipewire` crate below. ashpd = { version = "0.13", features = ["screencast", "remote_desktop"] } -ffmpeg-next = "7" +ffmpeg-next = "8" libc = "0.2" # Must match the pipewire crate ashpd 0.13 links (libspa/pipewire-sys `links` key is # unique per build), i.e. 0.9 — NOT the 0.10 the setup doc mentions. diff --git a/crates/lumen-host/src/encode/linux.rs b/crates/lumen-host/src/encode/linux.rs index 454ed4e..7bc3633 100644 --- a/crates/lumen-host/src/encode/linux.rs +++ b/crates/lumen-host/src/encode/linux.rs @@ -1,4 +1,4 @@ -//! NVENC encoder via `ffmpeg-next` (binds the system FFmpeg 7.x / libavcodec 61). +//! NVENC encoder via `ffmpeg-next` (binds the system FFmpeg 8.x / libavcodec 62). //! //! Input is a packed RGB/BGR CPU frame; `*_nvenc` accepts `rgb0`/`bgr0`/`rgba`/`bgra` //! directly and does the RGB→YUV conversion on the GPU, so the host stays off the diff --git a/docs/linux-setup.md b/docs/linux-setup.md index b836052..2428815 100644 --- a/docs/linux-setup.md +++ b/docs/linux-setup.md @@ -130,8 +130,8 @@ Crate choices, verified current: `AvailableSourceTypes` is `1` (Monitor only); asking for `Window`/`Virtual` invalidates the session. Set `XDG_CURRENT_DESKTOP=sway` so the wlr portal backend is chosen, and import it into the portal's environment (see "Portal bring-up" below). -- **Encode:** [`ffmpeg-next`](https://crates.io/crates/ffmpeg-next) **7.x** (binds the - system FFmpeg 6.1.1 via pkg-config; needs `clang`/`libclang`). Select the encoder by +- **Encode:** [`ffmpeg-next`](https://crates.io/crates/ffmpeg-next) **8.x** (binds the + system FFmpeg 8.x via pkg-config; needs `clang`/`libclang`). Select the encoder by name — `encoder::find_by_name("hevc_nvenc")`, *not* by codec id (that's the SW encoder). Low-latency opts: `preset=p1`, `tune=ull`, `rc=cbr`, `bf=0`, `delay=0`, large `g`. If your FFmpeg is in a non-standard prefix, `export FFMPEG_DIR=/that/prefix`.