Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ env/
ENV/
*.egg-info/
dist/
build/
builddir/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Dropping build/ lets a local build/lib/ into the image. I put a marker in build/lib/fluster/ and found it at /usr/local/lib/python3.14/dist-packages/fluster/ in the image. Adding these fixes it (marker gone, tracked build/*.py, compat/, patches/ still copied):

build/lib/
build/bdist.*/

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The next files/directories are generated by pip3 install . --no-cache-dir --break-system-packages:

  • build/bdist.linux-x86_64/
  • build/lib/
  • fluster_conformance.egg-info/

Do you want I added in .dockerignore?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes please. *.egg-info/ is already ignored (line 15), so only these two are missing:

build/lib/
build/bdist.*/

They are what pip3 install . leaves in build/ on the host, and without them a stale build/lib/ ends up installed in the image (I checked with a marker file). Tracked build/*.py, build/compat/ and build/patches/ are still copied

.mypy_cache/
.ruff_cache/
.pytest_cache/
Expand All @@ -29,6 +29,8 @@ build/
# Output directories (mounted as volumes at runtime)
fluster_output/
resources/
contrib/
decoders/

# Docker files (not needed inside image)
.dockerignore
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.**

Expand Down
94 changes: 81 additions & 13 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand All @@ -39,6 +39,12 @@ 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
# 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 \
Expand Down Expand Up @@ -81,9 +87,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 \
Expand All @@ -96,6 +103,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
Expand Down Expand Up @@ -166,8 +177,12 @@ RUN if [ "${FFMPEG_INSTALL_METHOD}" = "source" ]; then \
libvpx-dev \
libfdk-aac-dev \
libopus-dev \
libmfx-dev \
libunistring-dev \
&& if dpkg --compare-versions "${UBUNTU_VERSION}" ge 26.04; then \
apt-get install -y libvpl-dev; \
else \
apt-get install -y libmfx-dev; \
fi \
Comment on lines +181 to +185

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

libvpl-dev is already installed by the base layer (L135, same line as in the base commit). In a 26.04 image built with the default system FFmpeg/GStreamer, where these blocks don’t run, dpkg -l libvpl-dev shows ii libvpl-dev 1:2.16.0-1. Only libmfx-dev needs the condition; the libvpl-dev branch is a no-op

&& rm -rf /var/lib/apt/lists/* && \
mkdir /tmp/aom && \
cd /tmp/aom && \
Expand All @@ -191,6 +206,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" \
Expand All @@ -205,7 +221,7 @@ RUN if [ "${FFMPEG_INSTALL_METHOD}" = "source" ]; then \
--enable-nonfree \
--enable-libx264 \
--enable-libx265 \
--enable-libmfx \
${QSV_OPT} \
--enable-gnutls \
--enable-libaom \
--enable-libass \
Expand Down Expand Up @@ -242,16 +258,16 @@ 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 \
pip3 install --upgrade pip setuptools meson; \
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

Expand All @@ -263,11 +279,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
Expand All @@ -294,7 +310,6 @@ RUN if [ "${GSTREAMER_INSTALL_METHOD}" = "source" ]; then \
libpthread-stubs0-dev \
libva-dev \
libvdpau-dev \
libmfx-dev \
libx11-dev \
libxext-dev \
libxv-dev \
Expand All @@ -315,6 +330,11 @@ RUN if [ "${GSTREAMER_INSTALL_METHOD}" = "source" ]; then \
libgles2-mesa-dev \
libgl1-mesa-dev \
libglu1-mesa-dev \
&& if dpkg --compare-versions "${UBUNTU_VERSION}" ge 26.04; then \
sudo apt-get install -y libvpl-dev; \
else \
sudo apt-get install -y libmfx-dev; \
fi \
&& sudo rm -rf /var/lib/apt/lists/* \
&& mkdir -p /tmp/gstreamer && cd /tmp/gstreamer \
&& curl -L "https://gitlab.freedesktop.org/gstreamer/gstreamer/-/archive/${GSTREAMER_VERSION}/gstreamer-${GSTREAMER_VERSION}.tar.gz" | tar xz \
Expand Down Expand Up @@ -457,6 +477,54 @@ 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

# 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=<libdir>/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 \
Expand Down
Loading
Loading