Install FFmpeg on CentOS 9 Stream in Minutes
You’ll learn how to pull the latest FFmpeg binaries straight from RPM‑Fusion and have them ready for video conversion or streaming without wrestling with build scripts. No more “I get a compile error because of missing headers” headaches.
Prerequisites: Root Access is a Must
You need either root or sudo privileges. If you’re running as a normal user, prepend every command with `sudo`.
Why? The package manager touches system directories; without elevation it will just refuse.
sudo -i
Enable EPEL and the CRB Repository
CentOS 9 Stream ships with an “AppStream” section but hides many developer tools behind the CRB (CodeReady Builder) repo.
Without enabling these, FFmpeg’s dependencies will be missing.
dnf install -y epel-release dnf config-manager --set-enabled crb
I’ve seen users get stuck at “No matching package” for libx264 unless CRB is active.
Add the RPM‑Fusion Repository
RPM‑Fusion hosts the official FFmpeg build for CentOS.
Add the repo file manually – it’s a single line that tells dnf where to look.
cat <<'EOF' | sudo tee /etc/yum.repos.d/rpmfusion-free.repo [rpmfusion-free] name=RHEL $releasever - RPM Fusion Free baseurl=https://download1.rpmfusion.org/free/el/$releasever/os/\$basearch/ enabled=1 gpgcheck=0 EOF
If you’re on a 64‑bit machine, that `$basearch` expands to `x86_64`; otherwise adjust accordingly.
Install FFmpeg and Optional Extras
Now the real work: install FFmpeg plus the most common codecs.
dnf install -y ffmpeg ffmpeg-libs
Why the libs?
`ffmpeg` pulls the executable, `ffmpeg-libs` brings the shared libraries that many media tools rely on (like VLC or GStreamer). Without them you’ll get “missing library” errors.
If you plan to encode H.264/5 or use audio codecs beyond AAC, you might want the non‑free components:
dnf install -y ffmpeg-nonfree ffmpeg-nonfree-libs
Verify the Installation
A quick version check confirms everything worked.
ffmpeg -version
You should see something like:
ffmpeg version Copyright (c) 2000-2022 ... built with gcc ... configuration: --enable-gpl --enable-nonfree ... ...
If the command returns a help screen, you’re golden.
Common Pitfalls and Quick Fixes
* Missing `crb` – If you get “Package ffmpeg not found,” re‑run the CRB enable step.
* EPEL stale metadata – Occasionally the EPEL cache lags; run `dnf clean all && dnf makecache`.
* Non‑free codec errors – Trying to encode with libx264 without installing the non‑free libs throws an “Unknown encoder” error. Install the nonfree packages.
That’s it—FFmpeg on CentOS 9 Stream is now ready for converting, streaming, or whatever media magic you have in mind.