FFmpeg is one of those tools you reach for when a video needs converting, an audio track needs pulling, or a file refuses to cooperate with the format you have. On most systems, you can install FFmpeg on Debian straight from the default repositories and get to work without dragging in extra multimedia repos. When Debian’s packaged branch is too old for the job, a source build gives you a cleaner way to move forward.
The default Debian package is the starting point here, because it is the easiest option to maintain. When that package branch falls behind what you need, the guide also covers a source build, plus verification, common FFmpeg tasks, troubleshooting, and clean removal.
Install FFmpeg on Debian
The default Debian package is the cleanest install for most systems because it keeps FFmpeg aligned with Debian’s own multimedia libraries and security updates.
| Method | FFmpeg version | Update path | Best for |
|---|---|---|---|
| Debian repository package | 7.1.x on Debian 13, 5.1.x on Debian 12, 4.3.x on Debian 11 | sudo apt upgrade | Most users who want a stable install that follows Debian updates. |
| Source build from upstream | Latest stable FFmpeg release | ~/ffmpeg-source/update-ffmpeg.sh | Readers who need newer upstream features, codecs, or behavior than their Debian branch provides. |
These instructions apply to Debian 13 (Trixie), Debian 12 (Bookworm), and Debian 11 (Bullseye) while Bullseye remains under LTS. The repository install works the same way across all three releases, but the packaged FFmpeg branch changes with each one.
Update Debian Package Metadata Before Installing FFmpeg
Refresh APT first so Debian resolves the current package set for your release.
sudo apt update
This guide uses
sudofor commands that need administrator privileges. If your account is not in the sudoers file yet, add it first with the guide on how to add a user to sudoers on Debian.
Install FFmpeg from Debian Repositories
Install FFmpeg with the standard Debian package:
sudo apt install ffmpeg
A Debian 13 install finishes with output similar to this:
Summary: Upgrading: 0, Installing: 2, Removing: 0, Not Upgrading: 2 Selecting previously unselected package ffmpeg. Unpacking ffmpeg (7:7.1.3-0+deb13u1) ... Setting up ffmpeg (7:7.1.3-0+deb13u1) ...
The package count and dependency list vary by release and by what is already installed. The important part is that APT completes cleanly and ends with
Setting up ffmpeg.
Verify FFmpeg, FFprobe, and FFplay on Debian
Check the version first:
ffmpeg -version | head -n 3
ffmpeg version 7.1.3-0+deb13u1 Copyright (c) 2000-2025 the FFmpeg developers built with gcc 14 (Debian 14.2.0-19) configuration: --prefix=/usr ... --enable-libaom ... --enable-libx264 --enable-libx265 ...
The branch changes with your Debian release. Debian 13 reports 7.1.x, Debian 12 reports 5.1.x, and Debian 11 reports 4.3.x.
Debian also installs the companion tools for probing and preview playback from the same package set:
command -v ffmpeg ffprobe ffplay
/usr/bin/ffmpeg /usr/bin/ffprobe /usr/bin/ffplay
If you want to confirm common encoders are present in Debian’s packaged build, check them directly:
ffmpeg -hide_banner -encoders | grep -E 'libx264|libx265|libaom-av1|aac|libmp3lame'
V....D libaom-av1 libaom AV1 (codec av1) V....D libx264 libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (codec h264) V....D libx264rgb libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 RGB (codec h264) V....D libx265 libx265 H.265 / HEVC (codec hevc) A....D aac AAC (Advanced Audio Coding) A....D libmp3lame libmp3lame MP3 (MPEG audio layer 3) (codec mp3)
Compare Packaged FFmpeg Versions in Debian 13, 12, and 11
The install command stays the same across supported Debian releases, but the packaged FFmpeg branch changes with the distribution.
| Debian release | Packaged branch | Install command | What this means |
|---|---|---|---|
| Debian 13 (Trixie) | 7.1.x | sudo apt install ffmpeg | Newest default Debian branch right now and the best packaged option if you want to stay entirely within Debian repositories. |
| Debian 12 (Bookworm) | 5.1.x | sudo apt install ffmpeg | Still stable, but noticeably older than current upstream FFmpeg releases. |
| Debian 11 (Bullseye) | 4.3.x | sudo apt install ffmpeg | The oldest branch in this guide and the most likely reason to prefer a source build. |
If Debian 12 or Debian 11 is too old for a specific workflow, compile FFmpeg from source instead of forcing a third-party multimedia repository onto the whole system. If you still need that route for other reasons, LinuxCapable has a separate guide for Deb-Multimedia on Debian.
Compile FFmpeg from Source on Debian
Sometimes Debian’s packaged branch is exactly what you want. Sometimes it is too old for the codec, filter, or behavior you actually need. That is when a source build makes sense, especially since Debian’s package can still stay in place as the fallback copy under /usr/bin.
The command below detects the current stable tarball from FFmpeg’s official download page automatically, so you do not need to hardcode version numbers by hand. Debian 12 and Debian 13 can enable
libaomfor AV1 with their packaged development libraries, but Debian 11 cannot because Bullseye shipslibaom1.0.0 and current FFmpeg 8.x expects something newer.
Install FFmpeg Source Build Dependencies on Debian
Install the shared build dependencies first:
sudo apt install -y build-essential pkg-config yasm nasm curl tar xz-utils \
ca-certificates libass-dev libfreetype6-dev libgnutls28-dev libmp3lame-dev \
libsdl2-dev libtool libva-dev libvdpau-dev libvorbis-dev libxcb1-dev \
libxcb-shm0-dev libxcb-xfixes0-dev zlib1g-dev libx264-dev libx265-dev \
libnuma-dev libvpx-dev libopus-dev
If you also want libaom AV1 support on Debian 12 or Debian 13, install that development package before configuring FFmpeg:
sudo apt install -y libaom-dev
Debian 11 can install
libaom-dev, but Bullseye only provides 1.0.0, which is too old for current FFmpeg 8.x. The configure logic below checks the installed version and skips--enable-libaomautomatically on Bullseye instead of failing.
Download the Latest Stable FFmpeg Source on Debian
Create build directories, detect the latest stable tarball from the official FFmpeg site, then download and unpack it.
mkdir -p ~/ffmpeg-source ~/ffmpeg-build
cd ~/ffmpeg-source
FFMPEG_TARBALL=$(curl -fsSL https://ffmpeg.org/download.html | grep -oE 'ffmpeg-[0-9.]+\.tar\.xz' | head -n 1)
echo "Latest stable tarball: $FFMPEG_TARBALL"
curl -fsSLO "https://ffmpeg.org/releases/$FFMPEG_TARBALL"
tar -xf "$FFMPEG_TARBALL"
ln -sfn "${FFMPEG_TARBALL%.tar.xz}" ffmpeg-current
readlink -f ffmpeg-current
Latest stable tarball: ffmpeg-8.0.1.tar.xz /home/joshua/ffmpeg-source/ffmpeg-8.0.1
The ffmpeg-current symlink keeps the next commands stable, and the Linux curl guide explains the download flags used here.
Configure and Compile FFmpeg from Source on Debian
The configure block keeps the shared codec set consistent across Debian 13, Debian 12, and Debian 11. It only adds the optional AV1 flags when the local development libraries are new enough, so Bullseye does not fail at the first dependency check.
cd ~/ffmpeg-source/ffmpeg-current
EXTRA_FLAGS=""
# Enable optional AV1 support only when the local development packages are new enough.
if pkg-config --exists aom && pkg-config --atleast-version=2.0.0 aom; then
EXTRA_FLAGS="$EXTRA_FLAGS --enable-libaom"
fi
if pkg-config --exists SvtAv1Enc; then
EXTRA_FLAGS="$EXTRA_FLAGS --enable-libsvtav1"
fi
./configure \
--prefix="$HOME/ffmpeg-build" \
--bindir="/usr/local/bin" \
--enable-gpl \
--enable-gnutls \
--enable-libass \
--enable-libfreetype \
--enable-libmp3lame \
--enable-libopus \
--enable-libvorbis \
--enable-libvpx \
--enable-libx264 \
--enable-libx265 \
$EXTRA_FLAGS
make -j"$(nproc)"
sudo make install
sudo ldconfig
The make -j"$(nproc)" line uses your available CPU threads to speed up the build. After installation, sudo ldconfig refreshes the shared-library cache so the new libraries are available immediately.
A successful build ends with output similar to this:
LD ffmpeg_g STRIP ffplay STRIP ffprobe STRIP ffmpeg rm fftools/resources/graph.html.gz fftools/resources/graph.css.min.gz fftools/resources/graph.css.c fftools/resources/graph.css.min fftools/resources/graph.html.c
Verify the Source-Compiled FFmpeg Build on Debian
Confirm that the upstream build is now the active binary in your path:
ffmpeg -version | head -n 1
type -a ffmpeg
ffmpeg version 8.0.1 Copyright (c) 2000-2025 the FFmpeg developers ffmpeg is /usr/local/bin/ffmpeg ffmpeg is /usr/bin/ffmpeg
Your upstream version number will change over time. The important checks are that the first
type -a ffmpegresult points to/usr/local/bin/ffmpegand that the version line now reflects the newer upstream build instead of Debian’s packaged branch.
Create an FFmpeg Source Update Script on Debian
Source installs do not update through APT, so keep an update script alongside the source tree. This version checks for the tools it needs, targets the source-installed binary under /usr/local/bin, stops cleanly when you are already current, and rebuilds only when a newer stable release exists.
cat <<'EOF' > ~/ffmpeg-source/update-ffmpeg.sh
#!/usr/bin/env bash
set -euo pipefail
SRC_DIR="$HOME/ffmpeg-source"
BUILD_DIR="$HOME/ffmpeg-build"
INSTALL_BINDIR="/usr/local/bin"
TARGET_BIN="$INSTALL_BINDIR/ffmpeg"
DOWNLOAD_PAGE="https://ffmpeg.org/download.html"
RELEASE_BASE="https://ffmpeg.org/releases"
if [ "$(id -u)" -eq 0 ]; then
echo "Run this script as a regular user. Use sudo only when the install step asks for it."
exit 1
fi
for cmd in curl tar make pkg-config; do
if ! command -v "$cmd" >/dev/null 2>&1; then
echo "Error: $cmd is required but not installed."
exit 1
fi
done
echo "Checking the latest stable FFmpeg release..."
TARBALL=$(curl -fsSL "$DOWNLOAD_PAGE" | grep -oE 'ffmpeg-[0-9.]+\.tar\.xz' | head -n 1)
if [ -z "$TARBALL" ]; then
echo "Error: Could not detect the latest FFmpeg tarball."
exit 1
fi
LATEST_VERSION="${TARBALL#ffmpeg-}"
LATEST_VERSION="${LATEST_VERSION%.tar.xz}"
CURRENT_VERSION=""
if [ -x "$TARGET_BIN" ]; then
CURRENT_VERSION=$("$TARGET_BIN" -version | head -n 1 | awk '{print $3}')
fi
if [ "$CURRENT_VERSION" = "$LATEST_VERSION" ]; then
echo "FFmpeg is already up to date at $CURRENT_VERSION."
exit 0
fi
echo "Updating FFmpeg from ${CURRENT_VERSION:-not installed} to $LATEST_VERSION..."
mkdir -p "$SRC_DIR" "$BUILD_DIR"
cd "$SRC_DIR"
echo "Downloading $TARBALL..."
curl -fsSLO "$RELEASE_BASE/$TARBALL"
echo "Extracting $TARBALL..."
rm -rf "ffmpeg-$LATEST_VERSION"
tar -xf "$TARBALL"
ln -sfn "ffmpeg-$LATEST_VERSION" ffmpeg-current
cd ffmpeg-current
EXTRA_FLAGS=""
# Enable optional AV1 codecs only when the local development packages are new enough.
if pkg-config --exists aom && pkg-config --atleast-version=2.0.0 aom; then
EXTRA_FLAGS="$EXTRA_FLAGS --enable-libaom"
fi
if pkg-config --exists SvtAv1Enc; then
EXTRA_FLAGS="$EXTRA_FLAGS --enable-libsvtav1"
fi
echo "Configuring FFmpeg $LATEST_VERSION..."
./configure \
--prefix="$BUILD_DIR" \
--bindir="$INSTALL_BINDIR" \
--enable-gpl \
--enable-gnutls \
--enable-libass \
--enable-libfreetype \
--enable-libmp3lame \
--enable-libopus \
--enable-libvorbis \
--enable-libvpx \
--enable-libx264 \
--enable-libx265 \
$EXTRA_FLAGS
echo "Compiling FFmpeg $LATEST_VERSION..."
make -j"$(nproc)"
echo "Installing FFmpeg $LATEST_VERSION..."
sudo make install
sudo ldconfig
echo "Update complete:"
ffmpeg -version | head -n 1
EOF
Make the script executable, then run it whenever you want to check for a newer upstream release:
chmod +x ~/ffmpeg-source/update-ffmpeg.sh
~/ffmpeg-source/update-ffmpeg.sh
Checking the latest stable FFmpeg release... FFmpeg is already up to date at 8.0.1.
Avoid running source-build updates from cron. When a compile fails, a dependency changes, or the upstream tarball layout shifts, you want to see that immediately instead of discovering it later.
Use FFmpeg on Debian for Common Tasks
These examples match the kinds of tasks readers usually search for after installing FFmpeg. When you need more filters, muxers, or codec options, keep the official FFmpeg documentation open alongside your terminal.
Inspect Media Files with FFprobe on Debian
Use ffprobe when you need stream details before converting or trimming a file:
ffprobe -hide_banner input.wav
Typical output looks like this:
Input #0, wav, from '/usr/share/sounds/sound-icons/guitar-13.wav': Duration: 00:00:00.46, bitrate: 256 kb/s Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 16000 Hz, 1 channels, s16, 256 kb/s
That gives you the container, codec, duration, bit rate, and stream layout without re-encoding anything.
Convert Video Formats with FFmpeg
When the existing video and audio codecs already fit the target container, stream copying is the fastest option:
ffmpeg -i input.mkv -c:v copy -c:a copy output.mp4
This keeps the original streams intact, so the job finishes quickly and avoids quality loss. If the codecs are not valid for the target container, FFmpeg stops and you need to re-encode instead.
Convert Audio to MP3 with FFmpeg
Use this command for audio-only sources such as WAV or AAC files:
ffmpeg -i input.wav -c:a libmp3lame -q:a 2 output.mp3
The -q:a 2 setting targets high-quality variable bitrate MP3 output. If the input is a video file, add -vn to ignore the video stream and keep the rest of the command the same.
Resize Video to 720p with FFmpeg
Re-encode a video to 1280×720 with H.264 video and AAC audio:
ffmpeg -i input.mp4 -vf "scale=1280:720" -c:v libx264 -preset medium -crf 23 -c:a aac -b:a 128k output-720p.mp4
-preset medium is a sensible default for most jobs, while -crf 23 aims for balanced quality and file size. Lower CRF values increase quality and file size, while higher values compress harder.
Trim or Split Video with FFmpeg
Cut a short clip from a larger file without re-encoding:
ffmpeg -ss 00:01:30 -i input.mp4 -t 00:00:45 -c copy clip.mp4
Placing -ss before -i makes rough cuts faster because FFmpeg seeks before decoding. For frame-accurate trims, move -ss after -i and re-encode the output instead of using -c copy.
Troubleshoot FFmpeg on Debian
These are the issues most likely to show up after installation or after switching between the Debian package and a source-compiled build.
Fix the “Unknown encoder ‘libx264′” FFmpeg Error
If FFmpeg reports that libx264 does not exist, check whether your active binary exposes that encoder.
Unknown encoder 'libx264'
Run this diagnostic command:
ffmpeg -hide_banner -encoders | grep libx264
With Debian’s repository build, you should see output like this:
V....D libx264 libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (codec h264) V....D libx264rgb libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 RGB (codec h264)
If the command returns nothing, the FFmpeg binary you are running was built without x264 support or you are hitting the wrong copy in your path.
Fix the “aom >= 2.0.0 not found” Source Build Error on Debian 11
This is the Bullseye-specific problem that usually catches source builders when they try to enable libaom with a current FFmpeg 8.x release.
ERROR: aom >= 2.0.0 not found using pkg-config
Check the installed AOM version:
pkg-config --modversion aom
1.0.0
On Debian 11, skip --enable-libaom and continue with the rest of the source build, or move to Debian 12 or Debian 13 if you need a newer packaged AV1 development stack. The configure block in this guide already handles that automatically.
Fix FFmpeg Permission Denied Errors on Debian
When FFmpeg cannot create the output file, check the target directory instead of chasing codec settings.
output.mp4: Permission denied
Inspect the directory you are writing to:
ls -ld /path/to/output-directory
drwxr-xr-x 2 joshua joshua 4096 Mar 1 12:00 /home/joshua/Videos
If the directory owner is different, write the output into your home directory or correct the directory permissions first.
Fix Multiple FFmpeg Versions in Your Debian PATH
If the version you see does not match the installation method you just used, list every matching binary in your shell path:
type -a ffmpeg
When a previous source build still exists, the output often looks like this. If you usually rely on which, the which command guide covers the simpler lookup form, but type -a is better here because it shows every matching binary in your path.
ffmpeg is /usr/local/bin/ffmpeg ffmpeg is /usr/bin/ffmpeg
The first path wins. Use /usr/bin/ffmpeg explicitly when you want the Debian package, or remove the copy in /usr/local/bin if the source build is no longer needed.
Remove FFmpeg from Debian
Remove the Debian FFmpeg Package
Remove the Debian package first if you no longer want the repository build.
sudo apt remove ffmpeg
sudo apt autoremove
Verify that the Debian package itself is gone:
dpkg -s ffmpeg
dpkg-query: package 'ffmpeg' is not installed and no information is available
If
ffmpegstill resolves after this step, that usually means you still have a source build in/usr/local/bin. That is normal until you remove the source-installed copy as well.
Remove a Source-Compiled FFmpeg Install on Debian
Remove the manually installed binaries and then clean up the local source tree if you do not need it anymore.
The
rm -rfcommand below deletes your local FFmpeg source and build directories under your home folder. Do not run it if you want to keep the source tree or your update script.
sudo rm -f /usr/local/bin/ffmpeg /usr/local/bin/ffprobe /usr/local/bin/ffplay
rm -rf ~/ffmpeg-source ~/ffmpeg-build
sudo ldconfig
If the Debian package is still installed, it becomes the active copy again after the source build is removed:
command -v ffmpeg
/usr/bin/ffmpeg
Frequently Asked Questions
Yes. Debian 13, Debian 12, and Debian 11 all provide FFmpeg in the default repositories, so a normal install only needs sudo apt install ffmpeg.
Compile from source when Debian’s packaged FFmpeg branch is too old for the codec support, filters, or bug fixes you need. That is most common on Debian 11, sometimes worth it on Debian 12, and less urgent on Debian 13.
Bullseye ships libaom 1.0.0, which is too old for current FFmpeg 8.x builds that expect aom 2.0.0 or newer. The build logic in this guide skips –enable-libaom automatically on Debian 11 so the rest of the source build can still complete.
Yes. Debian’s FFmpeg package set includes ffprobe for media inspection and ffplay for quick playback checks alongside the main ffmpeg binary.
Conclusion
For most systems, install FFmpeg on Debian from the default repositories and keep moving. When Debian falls too far behind upstream, the source-build path here gives you a cleaner fallback than leaning on extra multimedia repos. If you want a GUI encoder next, see HandBrake on Debian, or add image conversion to the same workflow with ImageMagick on Debian.
Formatting tips for your comment
You can use basic HTML to format your comment. Useful tags currently allowed:
<code>command</code>command<strong>bold</strong><em>italic</em><a href="URL">link</a><blockquote>quote</blockquote>