From 0825b41de4d3941ceba9cabdaf100b20e41f4676 Mon Sep 17 00:00:00 2001 From: Ruben Gonzalez Date: Mon, 12 Oct 2026 13:10:47 +0200 Subject: [PATCH 1/3] feat: add Ubuntu 26.04 support to the Docker image Ubuntu 26.04 ships the default `ubuntu` user at UID 1000, so the image build failed at user creation because the removal step was gated to 24.04. The same version checks also selected the wrong Python package path (26.04 is PEP 668 externally managed, so `pip3 install --upgrade` fails) and skipped the non-root meson install. Replace the hard-coded 24.04 checks with `dpkg --compare-versions` so 24.04 and newer take the modern path, and make 26.04 the default base. On 26.04, install the distro `nvidia-vaapi-driver` instead of building it from source, and use libvpl (oneVPL) instead of the removed libmfx when building FFmpeg or GStreamer from source. Also update the wrapper script and documentation to list 26.04. --- README.md | 2 +- docker/Dockerfile | 30 +++++++++++++---------- docker/README.md | 58 +++++++++++++++++++++++++------------------- docker/run-docker.sh | 8 +++--- 4 files changed, 55 insertions(+), 43 deletions(-) diff --git a/README.md b/README.md index 987c0566..12b0a15d 100644 --- a/README.md +++ b/README.md @@ -98,7 +98,7 @@ welcome. ## Docker Support -Fluster includes Docker support for testing decoders in isolated, reproducible environments with **hardware acceleration support** (VAAPI, VDPAU, NVDEC, QuickSync). Multiple Ubuntu versions are supported (20.04, 22.04, 24.04) with corresponding system FFmpeg and GStreamer packages. +Fluster includes Docker support for testing decoders in isolated, reproducible environments with **hardware acceleration support** (VAAPI, VDPAU, NVDEC, QuickSync). Multiple Ubuntu versions are supported (20.04, 22.04, 24.04, 26.04) with corresponding system FFmpeg and GStreamer packages. **All Docker commands must be run from the `docker/` directory.** diff --git a/docker/Dockerfile b/docker/Dockerfile index 5fd17a43..1db29443 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -18,10 +18,10 @@ # Fluster Docker Image with Hardware Acceleration Support # Supports VAAPI, VDPAU, NVDEC, and Intel QuickSync -ARG UBUNTU_VERSION=24.04 +ARG UBUNTU_VERSION=26.04 FROM ubuntu:${UBUNTU_VERSION} -# A user is required by Ubuntu 24.04 to install meson as non-root +# A user is required by Ubuntu 24.04+ to install meson as non-root ARG USERNAME='mock' ARG PASSWORD='mock' @@ -81,9 +81,10 @@ RUN apt-get update && apt-get install -y \ apt-get install -y intel-media-va-driver || true) \ && rm -rf /var/lib/apt/lists/* -# VAAPI driver for NVIDIA (Ubuntu 24.04+) +# VAAPI driver for NVIDIA # apt's nvidia-vaapi-driver defaults to the broken EGL backend (driver >=525, -# elFarto/nvidia-vaapi-driver#207). Build from source instead (direct backend). +# elFarto/nvidia-vaapi-driver#207), so on Ubuntu 24.04 build from source instead +# (direct backend). Ubuntu 26.04+ ships a fixed driver, use the distro package. RUN if [ "${UBUNTU_VERSION}" = "24.04" ]; then \ apt-get update && \ apt-get install -y meson ninja-build git pkg-config \ @@ -96,6 +97,10 @@ RUN if [ "${UBUNTU_VERSION}" = "24.04" ]; then \ ninja -C /tmp/nvidia-vaapi-driver/build install && \ rm -rf /tmp/nv-codec-headers /tmp/nvidia-vaapi-driver && \ rm -rf /var/lib/apt/lists/*; \ + elif dpkg --compare-versions "${UBUNTU_VERSION}" ge 26.04; then \ + apt-get update && \ + (apt-get install -y nvidia-vaapi-driver || true) && \ + rm -rf /var/lib/apt/lists/*; \ fi # VDPAU support and GPU drivers @@ -166,7 +171,6 @@ RUN if [ "${FFMPEG_INSTALL_METHOD}" = "source" ]; then \ libvpx-dev \ libfdk-aac-dev \ libopus-dev \ - libmfx-dev \ libunistring-dev \ && rm -rf /var/lib/apt/lists/* && \ mkdir /tmp/aom && \ @@ -191,6 +195,7 @@ RUN if [ "${FFMPEG_INSTALL_METHOD}" = "source" ]; then \ cd /tmp/ffmpeg && \ export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/lib/${ARCH}-linux-gnu/pkgconfig:${PKG_CONFIG_PATH:-} && \ export LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib/${ARCH}-linux-gnu:${LD_LIBRARY_PATH:-} && \ + if dpkg --compare-versions "${UBUNTU_VERSION}" ge 26.04; then QSV_OPT="--enable-libvpl"; else QSV_OPT="--enable-libmfx"; fi && \ ./configure \ --prefix=/usr/local \ --pkg-config-flags="--static" \ @@ -205,7 +210,7 @@ RUN if [ "${FFMPEG_INSTALL_METHOD}" = "source" ]; then \ --enable-nonfree \ --enable-libx264 \ --enable-libx265 \ - --enable-libmfx \ + ${QSV_OPT} \ --enable-gnutls \ --enable-libaom \ --enable-libass \ @@ -242,7 +247,7 @@ RUN if [ "${FFMPEG_INSTALL_METHOD}" = "source" ]; then \ # Update python packages depending on Ubuntu version RUN if [ "${GSTREAMER_INSTALL_METHOD}" = "source" ]; then \ - if [ "${UBUNTU_VERSION}" = "24.04" ]; then \ + if dpkg --compare-versions "${UBUNTU_VERSION}" ge 24.04; then \ pip3 install --upgrade pip setuptools; \ apt update && apt install -y pipx ninja-build && rm -rf /var/lib/apt/lists/*; \ else \ @@ -250,8 +255,8 @@ RUN if [ "${GSTREAMER_INSTALL_METHOD}" = "source" ]; then \ fi; \ fi -# Ubuntu 24.04: Remove default user -RUN if [ "${UBUNTU_VERSION}" = "24.04" ] && id ubuntu >/dev/null 2>&1; then \ +# Ubuntu 24.04+: Remove default user +RUN if dpkg --compare-versions "${UBUNTU_VERSION}" ge 24.04 && id ubuntu >/dev/null 2>&1; then \ userdel -r ubuntu; \ fi @@ -263,11 +268,11 @@ RUN addgroup ${USERNAME} && \ # Change to USERNAME user USER ${USERNAME} -# Set PATH to include pipx bin directory - required for meson in Ubuntu 24.04 +# Set PATH to include pipx bin directory - required for meson in Ubuntu 24.04+ ENV PATH="/home/${USERNAME}/.local/bin:${PATH}" -# Ubuntu 24.04: install python packages for non-root user -RUN if [ "${GSTREAMER_INSTALL_METHOD}" = "source" ] && [ "${UBUNTU_VERSION}" = "24.04" ]; then \ +# Ubuntu 24.04+: install python packages for non-root user +RUN if [ "${GSTREAMER_INSTALL_METHOD}" = "source" ] && dpkg --compare-versions "${UBUNTU_VERSION}" ge 24.04; then \ echo "export PATH=/home/${USERNAME}/.local/bin:\${PATH}" >> /home/${USERNAME}/.bashrc; \ pipx install meson==1.6.1; \ fi @@ -294,7 +299,6 @@ RUN if [ "${GSTREAMER_INSTALL_METHOD}" = "source" ]; then \ libpthread-stubs0-dev \ libva-dev \ libvdpau-dev \ - libmfx-dev \ libx11-dev \ libxext-dev \ libxv-dev \ diff --git a/docker/README.md b/docker/README.md index 16ca9ec6..b1e94cef 100644 --- a/docker/README.md +++ b/docker/README.md @@ -4,15 +4,15 @@ Docker configuration for Fluster with comprehensive codec support including **FF ## Features -- **Customizable Ubuntu version**: 20.04, 22.04, or 24.04 +- **Customizable Ubuntu version**: 20.04, 22.04, 24.04, or 26.04 - **Three FFmpeg installation options**: 1. **System packages** (default) - Fast build, but older versions 2. **Static binaries** (7.x) - Newer FFmpeg, but limited backend support 3. **Build from source** (recommended) - Latest FFmpeg with all backends enabled - **Hardware Acceleration Support**: - - **VAAPI** (Intel, AMD, NVIDIA (only on Ubuntu 24.04)) + - **VAAPI** (Intel, AMD, NVIDIA (only on Ubuntu 24.04+)) - **VDPAU** (Intel via VA-GL bridge, AMD, NVIDIA) - - **NVDEC/NVENC** (NVIDIA) - Available with system packages on Ubuntu 24.04 + - **NVDEC/NVENC** (NVIDIA) - Available with system packages on Ubuntu 24.04+ - **Intel QuickSync** (Intel Media SDK, Intel OneVPL) ## FFmpeg Installation Options @@ -30,8 +30,9 @@ This Docker setup provides three ways to install FFmpeg, each with different tra | 20.04 | 4.2.x | Limited (basic VAAPI, VDPAU) | | 22.04 | 4.4.x | Good (VAAPI, VDPAU, some QuickSync) | | 24.04 | 6.1.x | Best (VAAPI, VDPAU, NVDEC, QuickSync) | +| 26.04 | 8.0.x | Best (VAAPI, VDPAU, NVDEC, QuickSync, oneVPL) | -**Note**: Ubuntu 24.04's FFmpeg includes CUDA/NVDEC support in system packages. +**Note**: Ubuntu 24.04's and 26.04's FFmpeg include CUDA/NVDEC support in system packages. ```bash # Build with system packages (default) @@ -70,13 +71,13 @@ docker build \ ``` **Included backends when building from source:** -- ✅ VAAPI (Intel, AMD, NVIDIA on Ubuntu 24.04) +- ✅ VAAPI (Intel, AMD, NVIDIA on Ubuntu 24.04+) - ✅ VDPAU (Intel via VA-GL bridge, AMD, NVIDIA) -- ✅ QuickSync (Intel libmfx) - **Now included!** +- ✅ QuickSync (Intel libmfx on Ubuntu 24.04, libvpl/oneVPL on Ubuntu 26.04+) - **Now included!** - ✅ All software codecs (x264, x265, vpx, aom, dav1d, fdk-aac) - ❌ NVDEC/NVENC (CUDA) - **Not available** (requires CUDA SDK installation) -**Note**: NVIDIA CUDA/NVDEC support is available with **system packages** (Ubuntu 24.04 default), but NOT when building FFmpeg from source. For NVDEC, use the default system packages. When building from source, NVIDIA hardware decoding is available via VDPAU and VAAPI (Ubuntu 24.04 only). +**Note**: NVIDIA CUDA/NVDEC support is available with **system packages** (Ubuntu 24.04+ default), but NOT when building FFmpeg from source. For NVDEC, use the default system packages. When building from source, NVIDIA hardware decoding is available via VDPAU and VAAPI (Ubuntu 24.04+ only). **Recommendation**: Use `--build-ffmpeg` for latest FFmpeg with comprehensive codec and hardware acceleration support. @@ -86,7 +87,8 @@ docker build \ |--------|-----------------|-----------------|-----------|----------------------| | 20.04 | 4.2.x | 8.0 | 1.16.x | Legacy support | | 22.04 | 4.4.x | 8.0 | 1.20.x | Stable | -| 24.04 | 6.1.x | 8.0 | 1.24.x | Latest (recommended) | +| 24.04 | 6.1.x | 8.0 | 1.24.x | Recommended | +| 26.04 | 8.0.x | 8.0 | 1.28.x | Latest (recommended) | ## Structure ``` @@ -98,7 +100,7 @@ docker/ ## Quick Start -### Basic Usage (Default: Ubuntu 24.04) +### Basic Usage (Default: Ubuntu 26.04) From the `docker/` directory: ```bash @@ -126,12 +128,15 @@ From the `docker/` directory: Build with specific Ubuntu version: ```bash -# Ubuntu 22.04 -./run-docker.sh --ubuntu 22.04 --rebuild list -c +# Ubuntu 26.04 (default, recommended) +./run-docker.sh --ubuntu 26.04 --rebuild list -c -# Ubuntu 24.04 (default, recommended) +# Ubuntu 24.04 ./run-docker.sh --ubuntu 24.04 --rebuild list -c +# Ubuntu 22.04 +./run-docker.sh --ubuntu 22.04 --rebuild list -c + # Ubuntu 20.04 (legacy) ./run-docker.sh --ubuntu 20.04 --rebuild list -c ``` @@ -146,7 +151,7 @@ Build FFmpeg from source with all backends (recommended for production): ./run-docker.sh --build-ffmpeg --intel --rebuild run -d FFmpeg-H.264-QSV -ts JVT-AVC_V1 -k ``` -**Note**: For NVIDIA CUDA/NVDEC decoders (FFmpeg-H.265-CUDA, etc.), use system packages (default, without `--build-ffmpeg` flag), as Ubuntu 24.04 includes CUDA support in system FFmpeg packages. +**Note**: For NVIDIA CUDA/NVDEC decoders (FFmpeg-H.265-CUDA, etc.), use system packages (default, without `--build-ffmpeg` flag), as Ubuntu 24.04 and 26.04 include CUDA support in system FFmpeg packages. ### FFmpeg Version Override @@ -174,7 +179,7 @@ docker run --rm fluster:ffmpeg-static ffmpeg -version | head -1 ./run-docker.sh --amd hw-info ./run-docker.sh --amd list -c | grep VAAPI -# NVIDIA GPU (CUDA/NVDEC on Ubuntu 24.04) +# NVIDIA GPU (CUDA/NVDEC on Ubuntu 24.04/26.04) ./run-docker.sh --nvidia hw-info ./run-docker.sh --nvidia list -c | grep -E "CUDA|NVDEC" ``` @@ -203,7 +208,7 @@ GStreamer with libav plugin exposes FFmpeg decoders through GStreamer: ### GStreamer Hardware Decoders -#### VAAPI (Intel, AMD, NVIDIA on Ubuntu 24.04) +#### VAAPI (Intel, AMD, NVIDIA on Ubuntu 24.04+) - `GStreamer-H.264-VAAPI-Gst1.0` (vaapih264dec) - `GStreamer-H.265-VAAPI-Gst1.0` (vaapih265dec) - `GStreamer-H.264-VA-Gst1.0` (vah264dec) - newer @@ -219,7 +224,7 @@ GStreamer with libav plugin exposes FFmpeg decoders through GStreamer: - `GStreamer-H.264-MSDK-Gst1.0` (msdkh264dec) - `GStreamer-H.265-MSDK-Gst1.0` (msdkh265dec) -#### NVIDIA NVDEC (Ubuntu 24.04) +#### NVIDIA NVDEC (Ubuntu 24.04+) - `FFmpeg-H.264-CUDA` (h264_cuvid) - `FFmpeg-H.265-CUDA` (hevc_cuvid) - `FFmpeg-VP8-CUDA` (vp8_cuvid) @@ -234,7 +239,7 @@ GStreamer with libav plugin exposes FFmpeg decoders through GStreamer: ### VAAPI **Requirements:** -- GPU with VAAPI support (Intel, AMD, or NVIDIA on Ubuntu 24.04) +- GPU with VAAPI support (Intel, AMD, or NVIDIA on Ubuntu 24.04+) - Appropriate drivers installed on host - User in `video` and `render` groups @@ -265,11 +270,11 @@ GStreamer with libav plugin exposes FFmpeg decoders through GStreamer: **Requirements:** - NVIDIA GPU with NVDEC support (compute capability >= 3.0) - NVIDIA drivers installed on host (`nvidia-smi` working on host) -- **Ubuntu 24.04** (system packages include CUDA/NVDEC support) +- **Ubuntu 24.04 or 26.04** (system packages include CUDA/NVDEC support) - **No special Docker configuration needed** - uses `--privileged` mode **How it works:** -The Docker container uses `--privileged` mode and mounts `/dev/dri` which gives automatic access to NVIDIA GPU for hardware decoding. Ubuntu 24.04's FFmpeg includes CUDA/NVDEC support in system packages. No nvidia-docker2 or nvidia-container-toolkit required! +The Docker container uses `--privileged` mode and mounts `/dev/dri` which gives automatic access to NVIDIA GPU for hardware decoding. Ubuntu 24.04's and 26.04's FFmpeg include CUDA/NVDEC support in system packages. No nvidia-docker2 or nvidia-container-toolkit required! **Driver Version Matching:** The build script automatically detects your host NVIDIA driver version (e.g., 535, 550, 560) and installs matching VDPAU libraries inside the container. This ensures compatibility between the container and your host drivers. @@ -355,7 +360,10 @@ LIBVA_DRIVER_NAME=i965 ./run-docker.sh --intel hw-info ### Testing Different Configurations ```bash -# Ubuntu 24.04 with latest software +# Ubuntu 26.04 with latest software +./run-docker.sh --ubuntu 26.04 --rebuild list -c + +# Ubuntu 24.04 ./run-docker.sh --ubuntu 24.04 --rebuild list -c # Ubuntu 22.04 for compatibility testing @@ -373,7 +381,7 @@ LIBVA_DRIVER_NAME=i965 ./run-docker.sh --intel hw-info # Intel VAAPI (keep outputs) ./run-docker.sh --intel run -d GStreamer-H.264-VAAPI-Gst1.0 -ts JVT-AVC_V1 -k -# NVIDIA NVDEC (keep one output, Ubuntu 24.04) +# NVIDIA NVDEC (keep one output, Ubuntu 24.04/26.04) ./run-docker.sh --nvidia run -d FFmpeg-H.265-CUDA -ts JCT-VC-HEVC_V1 -tv AMP_A_Samsung_7 -k ``` @@ -398,7 +406,7 @@ If you prefer to build manually without using `run-docker.sh`: ```bash cd /path/to/fluster -# Default build (Ubuntu 24.04) +# Default build (Ubuntu 26.04) docker build -t fluster:latest -f docker/Dockerfile . # Custom build with specific Ubuntu version @@ -453,9 +461,9 @@ ls -la /dev/dri # Should show renderD* devices ls -la /dev/nvidia* # Should show nvidia devices (if available) ``` -3. Make sure you're using Ubuntu 24.04 (for CUDA/NVDEC support): +3. Make sure you're using Ubuntu 24.04 or 26.04 (for CUDA/NVDEC support): ```bash -./run-docker.sh --ubuntu 24.04 --rebuild --nvidia hw-info +./run-docker.sh --ubuntu 26.04 --rebuild --nvidia hw-info ``` 4. Run with --nvidia flag: @@ -471,7 +479,7 @@ ls -la /dev/nvidia* # Should show nvidia devices (if available) ffmpeg -hwaccels # Should show 'cuda' in the list ``` -**Note**: CUDA/NVDEC hardware acceleration is only available with **Ubuntu 24.04 system packages** (default). If you use `--build-ffmpeg`, NVDEC will not be available. +**Note**: CUDA/NVDEC hardware acceleration is only available with **Ubuntu 24.04/26.04 system packages** (default). If you use `--build-ffmpeg`, NVDEC will not be available. ### Complete rebuild diff --git a/docker/run-docker.sh b/docker/run-docker.sh index 9d88a208..1b51adc2 100755 --- a/docker/run-docker.sh +++ b/docker/run-docker.sh @@ -42,7 +42,7 @@ usage() { Usage: $0 [OPTIONS] [COMMAND] Build Options: - --ubuntu VERSION Ubuntu version: 20.04, 22.04, or 24.04 (default: 24.04) + --ubuntu VERSION Ubuntu version: 20.04, 22.04, 24.04, or 26.04 (default: 26.04) --build-ffmpeg Build FFmpeg from source (VAAPI, VDPAU, QuickSync - no NVDEC/CUDA) --ffmpeg-static Use static FFmpeg binary (latest version in https://johnvansickle.com/ffmpeg) --ffmpeg-version Specify FFmpeg version for --build-ffmpeg @@ -51,7 +51,7 @@ Build Options: --rebuild Force rebuilding of Docker image --intel Optimize for Intel GPU (VAAPI, VDPAU, QuickSync) --amd Optimize for AMD GPU (VAAPI, VDPAU) - --nvidia Optimize for NVIDIA GPU (NVDEC/CUDA on Ubuntu 24.04, VDPAU, VAAPI) + --nvidia Optimize for NVIDIA GPU (NVDEC/CUDA on Ubuntu 24.04/26.04, VDPAU, VAAPI) Environment Variables: LIBVA_DRIVER_NAME Override VAAPI driver (e.g., i965, iHD, radeonsi, nouveau) @@ -96,7 +96,7 @@ fi # Parse options -UBUNTU_VERSION="24.04" +UBUNTU_VERSION="26.04" REBUILD="" GPU_TYPES=() FFMPEG_INSTALL_METHOD="system" @@ -242,7 +242,7 @@ if [ $HAS_NVIDIA -eq 1 ]; then GPU_ENV="-e LIBVA_DRIVER_NAME=${LIBVA_DRIVER_NAME:-nouveau}" fi GPU_ENV="$GPU_ENV -e VDPAU_DRIVER=${VDPAU_DRIVER:-nvidia}" - echo -e "${BLUE}Enabling NVIDIA GPU (NVDEC/CUDA on Ubuntu 24.04, VDPAU, VAAPI)${NC}" + echo -e "${BLUE}Enabling NVIDIA GPU (NVDEC/CUDA on Ubuntu 24.04/26.04, VDPAU, VAAPI)${NC}" fi # Warn about dual GPU setups From 81a12367469ba35709219183e7f930d44d9f1df7 Mon Sep 17 00:00:00 2001 From: Ruben Gonzalez Date: Mon, 12 Oct 2026 14:03:30 +0200 Subject: [PATCH 2/3] feat: build the reference decoders optionally in the Docker image Add a BUILD_REFERENCE_DECODERS build arg, exposed as the --build-reference-decoders wrapper flag, which downloads the ISO reference software and builds the reference decoders with meson. The ISO licence agreement is accepted automatically during the build. Stop excluding build/ in .dockerignore so the download and build scripts are present in the image, and pass -D_DEFAULT_SOURCE to meson because GCC 15 in Ubuntu 26.04 rejects the implicit fileno declaration in libtsp under -std=c99. --- .dockerignore | 6 +++++- docker/Dockerfile | 23 +++++++++++++++++++++++ docker/README.md | 36 ++++++++++++++++++++++++++++++++++++ docker/run-docker.sh | 15 +++++++++++++++ 4 files changed, 79 insertions(+), 1 deletion(-) diff --git a/.dockerignore b/.dockerignore index f639006e..8424e024 100644 --- a/.dockerignore +++ b/.dockerignore @@ -14,7 +14,9 @@ env/ ENV/ *.egg-info/ dist/ -build/ +build/lib/ +build/bdist.* +builddir/ .mypy_cache/ .ruff_cache/ .pytest_cache/ @@ -29,6 +31,8 @@ build/ # Output directories (mounted as volumes at runtime) fluster_output/ resources/ +contrib/ +decoders/ # Docker files (not needed inside image) .dockerignore diff --git a/docker/Dockerfile b/docker/Dockerfile index 1db29443..11607207 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -39,6 +39,8 @@ ARG FFMPEG_VERSION=8.0 ARG GSTREAMER_INSTALL_METHOD=system # GStreamer version for "source" method ARG GSTREAMER_VERSION=1.24.2 +# Build the ISO/reference decoders (JM, HM, VTM, VVdeC, MPEG-2/4 AAC, MPEG-2 video) +ARG BUILD_REFERENCE_DECODERS=false ENV DEBIAN_FRONTEND=noninteractive \ TERM=xterm-256color \ @@ -461,6 +463,27 @@ RUN pip3 install . --no-cache-dir --break-system-packages 2>/dev/null || \ RUN mkdir -p /fluster/resources /fluster/test_suites +# Optional: build the ISO/reference decoders used for conformance checking. +# This downloads the ISO reference software (automatically accepting its licence) +# and the wrap-based subprojects, so it needs network access at build time and +# increases both build time and image size. Enable with +# --build-arg BUILD_REFERENCE_DECODERS=true. +# -D_DEFAULT_SOURCE exposes POSIX prototypes (e.g. fileno) that GCC 15 rejects +# as implicit declarations under the decoders' -std=c99. +RUN if [ "${BUILD_REFERENCE_DECODERS}" = "true" ]; then \ + apt-get update && apt-get install -y --no-install-recommends \ + build-essential \ + cmake \ + meson \ + ninja-build \ + pkg-config \ + patch \ + && rm -rf /var/lib/apt/lists/* \ + && python3 build/download_deps.py --accept-license \ + && meson setup builddir -Dc_args=-D_DEFAULT_SOURCE \ + && ninja -C builddir; \ + fi + # Additional environment variables ENV PYTHONPATH=/fluster \ LIBVA_DRIVERS_PATH=/usr/lib/${ARCH}-linux-gnu/dri \ diff --git a/docker/README.md b/docker/README.md index b1e94cef..3c5254b6 100644 --- a/docker/README.md +++ b/docker/README.md @@ -154,6 +154,42 @@ Build FFmpeg from source with all backends (recommended for production): **Note**: For NVIDIA CUDA/NVDEC decoders (FFmpeg-H.265-CUDA, etc.), use system packages (default, without `--build-ffmpeg` flag), as Ubuntu 24.04 and 26.04 include CUDA support in system FFmpeg packages. +### Reference Decoders (optional) + +The image can optionally build the ISO/reference decoders used for conformance +checking (H.264 JM, H.265 HM, H.266 VTM and VVdeC, MPEG-2 video, MPEG-2 AAC and +MPEG-4 AAC/ER). These are built from source with meson and are **disabled by +default** because they need network access at build time and increase both build +time and image size. + +```bash +# Build the image with the reference decoders +./run-docker.sh --build-reference-decoders --rebuild list -c + +# Equivalent manual build +docker build --build-arg BUILD_REFERENCE_DECODERS=true -t fluster:latest -f docker/Dockerfile . +``` + +Inside the image the decoders are produced with: + +```bash +python3 build/download_deps.py --accept-license +meson setup builddir -Dc_args=-D_DEFAULT_SOURCE +ninja -C builddir +``` + +(`-D_DEFAULT_SOURCE` is needed because the decoders build with `-std=c99`, which +hides POSIX prototypes such as `fileno` that GCC 15 rejects as implicit +declarations.) + +**Note**: `build/download_deps.py` downloads the ISO reference software. During +the Docker build the ISO Licence Agreement is accepted automatically +(`--accept-license`); building this image therefore implies accepting that +licence. The wrap-based subprojects (JM, HM, VTM, VVdeC, isobmff) are fetched +from their upstream git repositories. The built decoders are linked into +`/fluster/decoders`, which Fluster adds to its `PATH`. + + ### FFmpeg Version Override By default, FFmpeg from Ubuntu repositories is used. To test with newer FFmpeg versions (e.g., for future VVC support), use static binaries: diff --git a/docker/run-docker.sh b/docker/run-docker.sh index 1b51adc2..9690916a 100755 --- a/docker/run-docker.sh +++ b/docker/run-docker.sh @@ -48,6 +48,11 @@ Build Options: --ffmpeg-version Specify FFmpeg version for --build-ffmpeg --build-gstreamer Build GStreamer from source (useful for new versions on old distros) --gstreamer-version Specify GStreamer version for --build-gstreamer (default: 1.24.2) + --build-reference-decoders + Build the ISO/reference decoders (JM, HM, VTM, VVdeC, + MPEG-2/4 AAC, MPEG-2 video). Downloads the ISO reference + software and accepts its licence agreement automatically, + so it needs network access and increases build time/size --rebuild Force rebuilding of Docker image --intel Optimize for Intel GPU (VAAPI, VDPAU, QuickSync) --amd Optimize for AMD GPU (VAAPI, VDPAU) @@ -103,6 +108,7 @@ FFMPEG_INSTALL_METHOD="system" FFMPEG_VERSION="8.0" GSTREAMER_INSTALL_METHOD="system" GSTREAMER_VERSION="1.24.2" +BUILD_REFERENCE_DECODERS="false" while [[ $# -gt 0 ]]; do case $1 in @@ -133,6 +139,10 @@ while [[ $# -gt 0 ]]; do GSTREAMER_VERSION="$2" shift 2 ;; + --build-reference-decoders) + BUILD_REFERENCE_DECODERS="true" + shift + ;; --rebuild) REBUILD="--no-cache" shift @@ -191,12 +201,17 @@ if [[ "$(docker images -q $DOCKER_IMAGE 2> /dev/null)" == "" ]] || [ -n "$REBUIL else echo -e "${BLUE}Using system GStreamer packages...${NC}" fi + if [ "$BUILD_REFERENCE_DECODERS" = "true" ]; then + echo -e "${BLUE}Building the ISO/reference decoders...${NC}" + echo -e "${YELLOW}Note: this downloads the ISO reference software and automatically accepts its licence agreement.${NC}" + fi docker build \ --build-arg UBUNTU_VERSION="$UBUNTU_VERSION" \ --build-arg FFMPEG_INSTALL_METHOD="$FFMPEG_INSTALL_METHOD" \ --build-arg FFMPEG_VERSION="$FFMPEG_VERSION" \ --build-arg GSTREAMER_INSTALL_METHOD="$GSTREAMER_INSTALL_METHOD" \ --build-arg GSTREAMER_VERSION="$GSTREAMER_VERSION" \ + --build-arg BUILD_REFERENCE_DECODERS="$BUILD_REFERENCE_DECODERS" \ $NVIDIA_DRIVER_ARG \ $REBUILD \ -t "$DOCKER_IMAGE" \ From 6068fc34742ff8a5a63630d984fc01e29b724a87 Mon Sep 17 00:00:00 2001 From: Ruben Gonzalez Date: Mon, 12 Oct 2026 14:55:21 +0200 Subject: [PATCH 3/3] feat: build the libva fake VA-API driver optionally in the Docker image Add a BUILD_LIBVA_FAKE_DRIVER build arg, exposed as the --build-libva-fake-driver wrapper flag, which builds the libva fake VA-API backend from https://github.com/rgonzalezfluendo/libva-fake-driver for headless testing. The revision is pinned through LIBVA_FAKE_DRIVER_VERSION. The driver is installed into LIBVA_DRIVERS_PATH so it is picked up with LIBVA_DRIVER_NAME=fake, and used together with LD_PRELOAD of the companion fake_gbm.so. --- docker/Dockerfile | 31 +++++++++++++++++++++++++++++++ docker/README.md | 35 +++++++++++++++++++++++++++++++++++ docker/run-docker.sh | 12 ++++++++++++ 3 files changed, 78 insertions(+) diff --git a/docker/Dockerfile b/docker/Dockerfile index 11607207..c7a061d5 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -41,6 +41,10 @@ ARG GSTREAMER_INSTALL_METHOD=system ARG GSTREAMER_VERSION=1.24.2 # Build the ISO/reference decoders (JM, HM, VTM, VVdeC, MPEG-2/4 AAC, MPEG-2 video) ARG BUILD_REFERENCE_DECODERS=false +# Build the libva fake VA-API backend for headless testing +ARG BUILD_LIBVA_FAKE_DRIVER=false +# libva-fake-driver revision (commit, tag or branch) to build +ARG LIBVA_FAKE_DRIVER_VERSION=04fce0c3260b293357689d21d601300197fb0a80 ENV DEBIAN_FRONTEND=noninteractive \ TERM=xterm-256color \ @@ -484,6 +488,33 @@ RUN if [ "${BUILD_REFERENCE_DECODERS}" = "true" ]; then \ && ninja -C builddir; \ fi +# Optional: build the libva fake VA-API backend +# (https://github.com/rgonzalezfluendo/libva-fake-driver) for headless testing +# without a real GPU. Enable with --build-arg BUILD_LIBVA_FAKE_DRIVER=true. +# The driver is installed into LIBVA_DRIVERS_PATH and used with: +# LIBVA_DRIVER_NAME=fake LD_PRELOAD=/dri/fake_gbm.so vainfo +RUN if [ "${BUILD_LIBVA_FAKE_DRIVER}" = "true" ]; then \ + apt-get update && apt-get install -y --no-install-recommends \ + build-essential \ + meson \ + ninja-build \ + pkg-config \ + libgbm-dev \ + libdrm-dev \ + libdav1d-dev \ + libvpx-dev \ + libopenh264-dev \ + libyuv-dev \ + && rm -rf /var/lib/apt/lists/* \ + && git clone https://github.com/rgonzalezfluendo/libva-fake-driver.git /tmp/libva-fake-driver \ + && git -C /tmp/libva-fake-driver checkout ${LIBVA_FAKE_DRIVER_VERSION} \ + && meson setup /tmp/libva-fake-driver/builddir /tmp/libva-fake-driver \ + --prefix=/usr --libdir=lib/${ARCH}-linux-gnu/dri \ + && ninja -C /tmp/libva-fake-driver/builddir \ + && meson install -C /tmp/libva-fake-driver/builddir \ + && rm -rf /tmp/libva-fake-driver; \ + fi + # Additional environment variables ENV PYTHONPATH=/fluster \ LIBVA_DRIVERS_PATH=/usr/lib/${ARCH}-linux-gnu/dri \ diff --git a/docker/README.md b/docker/README.md index 3c5254b6..654907e3 100644 --- a/docker/README.md +++ b/docker/README.md @@ -190,6 +190,41 @@ from their upstream git repositories. The built decoders are linked into `/fluster/decoders`, which Fluster adds to its `PATH`. +### libva fake driver (optional) + +The image can optionally build the [libva fake VA-API +backend](https://github.com/rgonzalezfluendo/libva-fake-driver), a software +VA-API driver for headless environments (VMs, CI) where no real GPU is +available. It is **disabled by default**. + +```bash +# Build the image with the fake VA-API driver +./run-docker.sh --build-libva-fake-driver --rebuild list -c + +# Equivalent manual build (optionally pin a different revision) +docker build --build-arg BUILD_LIBVA_FAKE_DRIVER=true \ + --build-arg LIBVA_FAKE_DRIVER_VERSION= \ + -t fluster:latest -f docker/Dockerfile . +``` + +`fake_drv_video.so` and `fake_gbm.so` are installed into `LIBVA_DRIVERS_PATH` +(`/usr/lib/x86_64-linux-gnu/dri`). `fake_drv_video.so` resolves +`gbm_bo_map2()` from the companion `fake_gbm.so` at load time, so it must be +preloaded: + +```bash +# Verify the driver +LIBVA_DRIVER_NAME=fake \ +LD_PRELOAD=/usr/lib/x86_64-linux-gnu/dri/fake_gbm.so \ +vainfo --display drm --device /dev/null + +# Run Fluster with the fake VA-API driver +LIBVA_DRIVER_NAME=fake \ +LD_PRELOAD=/usr/lib/x86_64-linux-gnu/dri/fake_gbm.so \ +python3 fluster.py list -c +``` + + ### FFmpeg Version Override By default, FFmpeg from Ubuntu repositories is used. To test with newer FFmpeg versions (e.g., for future VVC support), use static binaries: diff --git a/docker/run-docker.sh b/docker/run-docker.sh index 9690916a..ef59a22f 100755 --- a/docker/run-docker.sh +++ b/docker/run-docker.sh @@ -53,6 +53,9 @@ Build Options: MPEG-2/4 AAC, MPEG-2 video). Downloads the ISO reference software and accepts its licence agreement automatically, so it needs network access and increases build time/size + --build-libva-fake-driver + Build the libva fake VA-API backend for headless testing + (https://github.com/rgonzalezfluendo/libva-fake-driver) --rebuild Force rebuilding of Docker image --intel Optimize for Intel GPU (VAAPI, VDPAU, QuickSync) --amd Optimize for AMD GPU (VAAPI, VDPAU) @@ -109,6 +112,7 @@ FFMPEG_VERSION="8.0" GSTREAMER_INSTALL_METHOD="system" GSTREAMER_VERSION="1.24.2" BUILD_REFERENCE_DECODERS="false" +BUILD_LIBVA_FAKE_DRIVER="false" while [[ $# -gt 0 ]]; do case $1 in @@ -143,6 +147,10 @@ while [[ $# -gt 0 ]]; do BUILD_REFERENCE_DECODERS="true" shift ;; + --build-libva-fake-driver) + BUILD_LIBVA_FAKE_DRIVER="true" + shift + ;; --rebuild) REBUILD="--no-cache" shift @@ -205,6 +213,9 @@ if [[ "$(docker images -q $DOCKER_IMAGE 2> /dev/null)" == "" ]] || [ -n "$REBUIL echo -e "${BLUE}Building the ISO/reference decoders...${NC}" echo -e "${YELLOW}Note: this downloads the ISO reference software and automatically accepts its licence agreement.${NC}" fi + if [ "$BUILD_LIBVA_FAKE_DRIVER" = "true" ]; then + echo -e "${BLUE}Building the libva fake VA-API backend...${NC}" + fi docker build \ --build-arg UBUNTU_VERSION="$UBUNTU_VERSION" \ --build-arg FFMPEG_INSTALL_METHOD="$FFMPEG_INSTALL_METHOD" \ @@ -212,6 +223,7 @@ if [[ "$(docker images -q $DOCKER_IMAGE 2> /dev/null)" == "" ]] || [ -n "$REBUIL --build-arg GSTREAMER_INSTALL_METHOD="$GSTREAMER_INSTALL_METHOD" \ --build-arg GSTREAMER_VERSION="$GSTREAMER_VERSION" \ --build-arg BUILD_REFERENCE_DECODERS="$BUILD_REFERENCE_DECODERS" \ + --build-arg BUILD_LIBVA_FAKE_DRIVER="$BUILD_LIBVA_FAKE_DRIVER" \ $NVIDIA_DRIVER_ARG \ $REBUILD \ -t "$DOCKER_IMAGE" \