How to Install FFmpeg on Fedora Linux

Last updated Sunday, February 15, 2026 4:33 pm Joshua James 11 min read

FFmpeg converts video between formats, extracts audio tracks, compresses footage for web delivery, and streams live content to platforms like YouTube or Twitch. Installing FFmpeg on Fedora gives you a complete command-line toolkit for batch-converting social media videos, extracting audio from recordings, compressing 4K footage for archival, transcoding media libraries, and building automated media pipelines.

Fedora offers two FFmpeg builds with different codec licensing, and picking the right one determines which formats you can encode. Both installation methods, codec differences, hardware acceleration setup for Intel, AMD, and NVIDIA GPUs, practical usage examples, and troubleshooting are detailed in the sections below.

Choose Your FFmpeg Installation Method on Fedora

Fedora ships two distinct FFmpeg builds. The key difference lies in codec licensing: Fedora’s official package excludes patent-encumbered codecs to comply with distribution policies, while RPM Fusion includes the full codec suite.

MethodPackageChannelCodec SupportBest For
Fedora Defaultffmpeg-freeFedora reposOpen codecs (VP9, AV1, Opus, FLAC); limited H.264 via OpenH264Projects using royalty-free formats
RPM FusionffmpegRPM Fusion free + nonfreeFull codec suite (libx264, libx265, AAC, MP3, plus all open codecs)MP4 conversion, camera footage, YouTube workflows

For most video conversion tasks involving MP4 files, camera footage, or media downloaded from the web, the RPM Fusion version provides the codec support you need. The Fedora default works well for projects using open formats like WebM or FLAC audio.

Install FFmpeg from the Fedora Default Repository

Before installing FFmpeg, refresh your package cache and apply pending updates. The --refresh flag forces DNF to download fresh metadata from all enabled repositories.

sudo dnf upgrade --refresh

If you are new to using sudo and haven’t configured it, refer to our guide on adding a user to sudoers on Fedora Linux.

Fedora’s default repository includes ffmpeg-free, a build compiled without patent-encumbered codecs. This version handles open formats like VP9, AV1, Opus, and FLAC. It also includes OpenH264 for basic H.264 support, but lacks the widely-used libx264 and libx265 software encoders.

sudo dnf install ffmpeg-free

If you plan to compile software that links against FFmpeg libraries (such as building OBS Studio from source), install the development headers:

sudo dnf install ffmpeg-free-devel

Verify FFmpeg-Free Installation on Fedora

Confirm the installation succeeded by checking the version:

ffmpeg -version
ffmpeg version 7.1.2 Copyright (c) 2000-2025 the FFmpeg developers
built with gcc 15 (GCC)
configuration: --enable-gpl --enable-version3 --enable-shared --enable-libopenh264 ...
libavutil      59. 39.100 / 59. 39.100
libavcodec     61. 19.101 / 61. 19.101
libavformat    61.  7.100 / 61.  7.100

The ffmpeg-free build includes --enable-libopenh264 but lacks --enable-libx264 and --enable-libx265. If you need those encoders, install the RPM Fusion build instead.

Install FFmpeg on Fedora via RPM Fusion

Enable RPM Fusion Repositories on Fedora

RPM Fusion hosts packages that Fedora cannot distribute due to licensing restrictions, including the full FFmpeg build with libx264, libx265, and AAC support. If you have not already configured RPM Fusion on your system, add both the free and nonfree repositories in a single command:

sudo dnf install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm

The $(rpm -E %fedora) expression expands to your current Fedora release number (such as 43 or 44). Verify the repositories are enabled (see our DNF5 command examples on Fedora for more DNF usage):

dnf repo list --all | grep -i rpmfusion
rpmfusion-free                RPM Fusion for Fedora - Free                 enabled
rpmfusion-free-updates        RPM Fusion for Fedora - Free - Updates       enabled
rpmfusion-nonfree             RPM Fusion for Fedora - Nonfree              enabled
rpmfusion-nonfree-updates     RPM Fusion for Fedora - Nonfree - Updates    enabled

Switch from ffmpeg-free to Full FFmpeg

If you already installed ffmpeg-free from Fedora’s default repository, use the swap command to replace it with the RPM Fusion build in a single operation:

sudo dnf swap ffmpeg-free ffmpeg --allowerasing

This removes ffmpeg-free and its libraries, then installs the full ffmpeg package with libx264, libx265, and other codec libraries.

The --allowerasing flag allows DNF to remove conflicting packages like ffmpeg-free and its associated libraries when installing the full FFmpeg build from RPM Fusion.

Install Full FFmpeg Directly from RPM Fusion

If ffmpeg-free is not installed, install the full FFmpeg package directly:

sudo dnf install ffmpeg --allowerasing

For development headers (needed only if compiling software against FFmpeg libraries):

sudo dnf install ffmpeg-devel --allowerasing

Verify FFmpeg RPM Fusion Installation

Confirm you have the RPM Fusion build with extended codec support:

ffmpeg -version
ffmpeg version 7.1.2 Copyright (c) 2000-2025 the FFmpeg developers
built with gcc 15 (GCC)
configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-libx264 --enable-libx265 --enable-libfdk-aac ...
libavutil      59. 39.100 / 59. 39.100
libavcodec     61. 19.101 / 61. 19.101
libavformat    61.  7.100 / 61.  7.100

Look for --enable-libx264 and --enable-libx265 in the configuration line to confirm you are running the RPM Fusion version. You can also verify available encoders with grep:

ffmpeg -hide_banner -encoders 2>/dev/null | grep -E "libx264|libx265"
 V..... libx264              libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (codec h264)
 V..... libx264rgb           libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 RGB (codec h264)
 V..... libx265              libx265 H.265 / HEVC (codec hevc)

Install Multimedia Codecs for FFmpeg on Fedora

After installing FFmpeg from RPM Fusion, install the GStreamer multimedia codecs. GStreamer powers media playback in GNOME applications, Firefox, and other desktop programs. Without these codecs, browser videos and desktop media players may fail on proprietary formats even though FFmpeg works from the command line.

The RPM Fusion Multimedia guide recommends installing the @multimedia group, but this group is not available in DNF5 on Fedora 43. Install the equivalent GStreamer packages individually:

sudo dnf install --setopt="install_weak_deps=False" gstreamer1-plugins-good gstreamer1-plugins-bad-free gstreamer1-plugins-bad-freeworld gstreamer1-plugins-ugly gstreamer1-plugins-ugly-free gstreamer1-plugin-openh264 gstreamer1-plugin-libav --exclude=PackageKit-gstreamer-plugin

This installs the GStreamer plugin packages that the @multimedia group provides, including the RPM Fusion freeworld variants for H.265 and additional proprietary codecs. The --setopt="install_weak_deps=False" flag prevents unnecessary recommended packages from being pulled in, and the --exclude flag skips the PackageKit plugin that can cause update prompts.

If you have dnf4 installed, you can use the group command instead: sudo dnf4 group install multimedia --setopt="install_weak_deps=False" --exclude=PackageKit-gstreamer-plugin. The @multimedia group is defined in DNF4 comps data but not yet recognized by DNF5.

Enable Hardware Acceleration for FFmpeg on Fedora

Hardware acceleration offloads video encoding and decoding to your GPU, improving FFmpeg performance for transcoding tasks. Install the driver package that matches your hardware.

Intel (Recent GPUs with Quick Sync)

sudo dnf install intel-media-driver

Intel (Older GPUs)

sudo dnf install libva-intel-driver

AMD (Mesa Freeworld Drivers)

sudo dnf swap mesa-va-drivers mesa-va-drivers-freeworld --allowerasing
sudo dnf swap mesa-vdpau-drivers mesa-vdpau-drivers-freeworld --allowerasing

NVIDIA (VAAPI Wrapper for NVENC/NVDEC)

sudo dnf install libva-nvidia-driver

For NVIDIA GPUs, you must also have the proprietary drivers installed. If nvidia-smi fails, install NVIDIA drivers following the Fedora NVIDIA drivers guide before configuring hardware acceleration.

Verify FFmpeg Hardware Acceleration Support

After installing the drivers, check available hardware encoders. For VAAPI (Intel/AMD):

ffmpeg -hide_banner -encoders 2>/dev/null | grep vaapi
 V..... h264_vaapi           H.264/AVC (VAAPI) (codec h264)
 V..... hevc_vaapi           H.265/HEVC (VAAPI) (codec hevc)
 V..... mjpeg_vaapi          MJPEG (VAAPI) (codec mjpeg)
 V..... vp8_vaapi            VP8 (VAAPI) (codec vp8)
 V..... vp9_vaapi            VP9 (VAAPI) (codec vp9)

For NVIDIA NVENC:

ffmpeg -hide_banner -encoders 2>/dev/null | grep nvenc
 V..... h264_nvenc           NVIDIA NVENC H.264 encoder (codec h264)
 V..... hevc_nvenc           NVIDIA NVENC hevc encoder (codec hevc)

If no encoders appear, verify your GPU drivers are installed correctly.

FFmpeg Codec Compatibility Reference on Fedora

Before converting files, verify which codecs your FFmpeg build supports. This table shows which formats work with each installation method:

Codecffmpeg-freeRPM Fusion FFmpegCommon Use
H.264 (x264)OpenH264 only (limited quality)Full support (libx264)MP4 videos, YouTube, cameras
H.265 (HEVC)No software encode/decodeFull support (libx265)4K video, iPhone recordings
VP9Encode and decodeEncode and decodeWebM video, YouTube
AV1Encode and decodeEncode and decodeNext-gen web video
AACEncode and decodeEncode and decodeAudio in MP4, streaming
MP3Encode and decodeEncode and decodeMusic files, podcasts
OpusEncode and decodeEncode and decodeVoIP, low-latency audio
FLACEncode and decodeEncode and decodeLossless audio archival

Both builds include hardware encoders (VAAPI, NVENC, QSV) for H.264 and H.265 when the appropriate GPU drivers are installed. The key difference is software encoding: ffmpeg-free lacks libx264 and libx265, which are the encoders most FFmpeg tutorials and scripts reference.

If a conversion fails with “Unknown encoder” or “Encoder not found” errors, you likely need the RPM Fusion build for that codec.

Common FFmpeg Commands and Usage Examples on Fedora

These examples demonstrate common media tasks with progressive complexity, from simple format conversion to hardware-accelerated encoding.

Convert Video Format with FFmpeg

Convert an MKV file to MP4 while preserving quality by stream copying (no re-encoding):

ffmpeg -i input.mkv -c:v copy -c:a copy output.mp4

The -c:v copy and -c:a copy flags copy the existing video and audio streams without re-encoding, making the operation fast and lossless. Stream copying only works when the codec is already compatible with the target container.

Re-encode Video with H.264 on FFmpeg

When stream copying is not possible, re-encode the video. Convert AVI to MP4 with H.264 encoding:

ffmpeg -i input.avi -c:v libx264 -preset medium -crf 23 -c:a aac -b:a 128k output.mp4

The -preset medium balances encoding speed with compression efficiency. Use -preset fast for quicker encoding or -preset slow for better compression. The -crf value controls quality: lower values produce higher quality and larger files (18 is visually lossless, 28 shows noticeable artifacts).

The libx264 and libx265 encoders require the RPM Fusion build. The ffmpeg-free package cannot encode with these codecs.

Extract Audio from Video with FFmpeg

Pull the audio track from a video file and save it as MP3:

ffmpeg -i video.mp4 -vn -acodec libmp3lame -q:a 2 audio.mp3

The -vn flag discards the video stream. The -q:a 2 sets high-quality variable bitrate encoding (roughly 190 kbps). For constant bitrate, replace -q:a 2 with -b:a 320k.

Convert Audio Formats with FFmpeg

Convert MP3 to AAC for better compression at the same bitrate:

ffmpeg -i audio.mp3 -c:a aac -b:a 192k output.m4a

For lossless archival, convert to FLAC:

ffmpeg -i audio.mp3 -c:a flac output.flac

Compress Video for Web Delivery with FFmpeg

Reduce file size while maintaining reasonable quality for web hosting:

ffmpeg -i input.mp4 -c:v libx264 -crf 28 -preset medium -c:a aac -b:a 128k -movflags +faststart output.mp4

The -movflags +faststart moves metadata to the beginning of the file, enabling progressive playback in web browsers without waiting for the full download.

Hardware-Accelerated FFmpeg Encoding

After installing hardware acceleration drivers, use your GPU for faster encoding. For VAAPI (Intel/AMD):

ffmpeg -vaapi_device /dev/dri/renderD128 -i input.mp4 -vf 'format=nv12,hwupload' -c:v h264_vaapi -qp 23 -c:a copy output.mp4

For NVIDIA GPUs with proprietary drivers:

ffmpeg -i input.mp4 -c:v h264_nvenc -preset p4 -cq 23 -c:a copy output.mp4

Hardware encoding is faster than software encoding, though quality at equivalent bitrates may be slightly lower. Use hardware encoding when speed matters more than maximum compression efficiency.

Batch Process Multiple Files with FFmpeg

Convert all MKV files in a directory to MP4:

for file in *.mkv; do
  ffmpeg -i "$file" -c:v libx264 -crf 23 -c:a aac "${file%.mkv}.mp4"
done

The "${file%.mkv}.mp4" syntax strips the .mkv extension and adds .mp4, preserving original filenames.

Troubleshoot FFmpeg Issues on Fedora

Fix “Unknown Encoder libx264” on Fedora

This error means you are running ffmpeg-free, which excludes the libx264 encoder:

Unknown encoder 'libx264'

Verify which build you have installed:

ffmpeg -version | grep enable-libx264

If no output appears, switch to the RPM Fusion build:

sudo dnf swap ffmpeg-free ffmpeg --allowerasing

Resolve FFmpeg Hardware Acceleration Errors

If hardware encoding commands fail with device or driver errors:

Cannot load libcuda.so.1
Device creation failed: -1
Failed to initialise VAAPI connection

Verify your GPU is detected:

lspci | grep -E "VGA|3D"
01:00.0 VGA compatible controller: NVIDIA Corporation GA104 [GeForce RTX 3060]

For NVIDIA, confirm proprietary drivers are loaded:

nvidia-smi

If nvidia-smi fails, install NVIDIA drivers following the Fedora NVIDIA drivers guide. For Intel/AMD VAAPI issues, reinstall the VA-API drivers shown in the hardware acceleration section above.

Fix Package Conflicts During FFmpeg Installation

If DNF reports conflicts between ffmpeg-free and full FFmpeg:

Error: 
 Problem: package ffmpeg conflicts with ffmpeg-free
  - cannot install both

Use the swap command to handle the replacement cleanly:

sudo dnf swap ffmpeg-free ffmpeg --allowerasing

Debug Corrupted FFmpeg Output

If the output file plays incorrectly or is unreadable, enable verbose logging to identify the issue:

ffmpeg -v verbose -i input.mp4 -c:v libx264 -crf 23 output.mp4

Look for error messages about invalid stream formats, unsupported codecs, or timestamp issues. Common causes include corrupt input files, incompatible pixel formats, or interrupted conversions. Test with a known-good input file first to isolate whether the problem is with your source media or FFmpeg configuration.

Fix Permission Denied When Writing FFmpeg Output

If FFmpeg cannot write the output file:

output.mp4: Permission denied

Check the destination directory permissions and adjust if needed:

ls -ld /path/to/output/directory
chmod u+w /path/to/output/directory

Remove FFmpeg from Fedora

Remove ffmpeg-free (Fedora Default)

sudo dnf remove ffmpeg-free

Remove FFmpeg (RPM Fusion)

sudo dnf remove ffmpeg

After removing either package, clean up orphaned dependencies:

sudo dnf autoremove

Verify removal:

rpm -q ffmpeg ffmpeg-free
package ffmpeg is not installed
package ffmpeg-free is not installed

Frequently Asked Questions

What is the difference between ffmpeg-free and ffmpeg on Fedora?

ffmpeg-free is Fedora’s default build that excludes patent-encumbered codecs like libx264 and libx265 to comply with distribution licensing policies. The RPM Fusion ffmpeg package includes these codecs plus other nonfree encoders, providing full H.264 and H.265 software encoding support. Both packages share the same upstream FFmpeg version.

Do I need RPM Fusion to use FFmpeg on Fedora?

Not necessarily. ffmpeg-free from Fedora’s default repository handles open formats like VP9, AV1, Opus, and FLAC without RPM Fusion. However, if you need to encode H.264 (libx264) or H.265 (libx265) video, which most MP4 workflows require, you need the RPM Fusion build.

How do I update FFmpeg on Fedora?

FFmpeg updates through your regular system updates. Run sudo dnf upgrade --refresh to pull the latest version from whichever repository you installed it from (Fedora default or RPM Fusion). For a targeted update without upgrading other packages, use sudo dnf install --only-upgrade ffmpeg or sudo dnf install --only-upgrade ffmpeg-free.

How do I fix “Unknown encoder libx264” on Fedora?

This error means you have ffmpeg-free installed, which lacks the libx264 encoder. Switch to the RPM Fusion build by running: sudo dnf swap ffmpeg-free ffmpeg --allowerasing. After the swap completes, the libx264 and libx265 encoders become available.

What happened to libavcodec-freeworld on Fedora?

The libavcodec-freeworld package is no longer available on current Fedora releases. RPM Fusion now provides the full ffmpeg package instead, which includes libavcodec and all codec libraries. To get full codec support, install the RPM Fusion FFmpeg package with: sudo dnf swap ffmpeg-free ffmpeg --allowerasing.

Useful FFmpeg Links and Resources

Conclusion

You now have FFmpeg installed with full codec support and hardware acceleration configured on Fedora. The ffmpeg-free package handles open formats, while the RPM Fusion build adds libx264, libx265, and AAC support for broader compatibility. To extend your multimedia workflow, pair FFmpeg with HandBrake for GUI-based video encoding, VLC for playback verification, OBS Studio for live streaming and recording, or ImageMagick for image processing alongside video tasks.

Found this guide useful?

Support LinuxCapable to keep tutorials free and up to date.

Buy me a coffee Buy me a coffee

Before commenting, please review our Comments Policy.
Formatting tips for your comment

You can use basic HTML to format your comment. Useful tags currently allowed:

You type Result
<code>command</code> command
<strong>bold</strong> bold
<em>italic</em> italic
<a href="URL">link</a> link
<blockquote>quote</blockquote> quote block

Leave a Comment

We read and reply to every comment - let us know how we can help or improve this guide.

Let us know you are human: