Skip to content
Merged
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
32 changes: 20 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,33 @@ FROM fedora:44
# libx264's output currently causes Discord to drop the stream after one frame.
#
# ffmpeg-free's h264_vaapi encoder is only the libva *loader* — it still needs a
# hardware-specific VA-API driver to reach the GPU. For AMD that's the radeonsi
# driver in mesa-va-drivers, but Fedora's stock build strips H.264/HEVC for patent
# reasons, so hardware H.264 encode requires mesa-va-drivers-freeworld from RPM
# Fusion. For Intel iGPUs (Gen8+, e.g. UHD Graphics) the equivalent driver is
# intel-media-driver (the iHD driver) from RPM Fusion's nonfree repo — without it
# the h264_vaapi probe fails on Intel hardware and the bot silently falls back to
# the libopenh264 software encoder. libva auto-selects the right driver from the
# /dev/dri device's PCI ID, so installing both drivers is enough; we deliberately
# do NOT hardcode LIBVA_DRIVER_NAME, which would force one vendor and break the
# other. We enable RPM Fusion ONLY for these drivers (and libva-utils, which
# provides `vainfo` for debugging) — ffmpeg itself stays on ffmpeg-free.
# hardware-specific VA-API driver to reach the GPU. Fedora's stock VA-API drivers
# strip H.264/HEVC for patent reasons, so hardware H.264 encode needs the RPM
# Fusion builds. We install one driver per supported GPU vendor:
# * AMD -> mesa-va-drivers-freeworld (radeonsi) [RPM Fusion free]
# * Intel Gen8+ -> intel-media-driver (iHD) [RPM Fusion nonfree]
# * Intel pre-Gen8 -> libva-intel-driver (i965) [RPM Fusion free]
# Without the matching driver the h264_vaapi probe fails and the bot silently
# falls back to the libopenh264 software encoder. (NVIDIA uses h264_nvenc, not
# VA-API; that encoder is already compiled into ffmpeg-free and loads the host's
# libnvidia-encode at runtime via the NVIDIA container toolkit — no image package
# needed.) Fedora's libva searches /usr/lib64/dri, dri-freeworld and dri-nonfree
# by default and auto-selects the right driver from the /dev/dri device's PCI ID,
# so installing every driver side by side is enough; we deliberately do NOT
# hardcode LIBVA_DRIVER_NAME, which would force one vendor and break the others.
# We enable RPM Fusion ONLY for these drivers (and libva-utils, which provides
# `vainfo` for debugging) — ffmpeg itself stays on ffmpeg-free.
RUN dnf install -y \
ffmpeg-free \
libva-utils \
python3 \
python3-pip \
https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-44.noarch.rpm \
https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-44.noarch.rpm \
&& dnf install -y --allowerasing mesa-va-drivers-freeworld intel-media-driver \
&& dnf install -y --allowerasing \
mesa-va-drivers-freeworld \
intel-media-driver \
libva-intel-driver \
&& dnf clean all \
&& rm -rf /var/cache/dnf

Expand Down