MP4 conversions on Fedora often fail because of codec support, not because the FFmpeg command is wrong. You can install FFmpeg on Fedora from the default repositories for open-format work, or use RPM Fusion’s full build when you need common H.264 and H.265 encoders such as libx264 and libx265.
The commands here match current Fedora releases, including Fedora 44 and Fedora 43. Fedora’s ffmpeg-free package and RPM Fusion’s ffmpeg package both provide the ffmpeg command, but they do not provide the same codec surface. Package release strings in verification output vary by Fedora release and normal updates.
Install FFmpeg on Fedora
Choose an FFmpeg Package on Fedora
Choose the package source by the formats you need to encode. Fedora’s default package is enough for open codecs, while RPM Fusion’s package is the better fit for most MP4, camera, editing, and tutorial workflows.
| Package | Source | Codec Scope | Best Fit |
|---|---|---|---|
ffmpeg-free | Fedora repositories | Open codecs, OpenH264, and hardware encoder wrappers, but no libx264 or libx265 | WebM, FLAC, Opus, AV1, VP9, and policy-conservative systems |
ffmpeg | RPM Fusion Free | Fuller codec build with libx264, libx265, and the open/audio codec set | MP4 conversion, phone or camera footage, editing pipelines, and common FFmpeg examples |
libavcodec-freeworld | RPM Fusion Free | Complement package for systems that keep ffmpeg-free | Only when you deliberately keep Fedora’s package and need selected extra codec libraries |
On a clean Fedora system, sudo dnf install ffmpeg can resolve to Fedora’s ffmpeg-free provider. Enable RPM Fusion Free first when you want the full RPM Fusion ffmpeg package.
Older forum posts often recommend sudo dnf install libavcodec-freeworld. That package still exists on current Fedora releases, but RPM Fusion’s current multimedia notes recommend switching to the full ffmpeg package for a complete command-line FFmpeg setup.
Update Fedora Before Installing FFmpeg
Refresh repository metadata and apply pending package updates before changing multimedia packages. This reduces version-mismatch conflicts between Fedora and RPM Fusion packages.
sudo dnf upgrade --refresh
If
sudois not configured for your account, the Fedora sudoers setup guide covers the required administrator access.
Install Fedora’s Default ffmpeg-free Package
Use Fedora’s repository package when you only need the policy-friendly FFmpeg build:
sudo dnf install ffmpeg-free
Install the development headers only when compiling software that links against FFmpeg libraries, such as custom media tools or source builds:
sudo dnf install ffmpeg-free-devel
Verify ffmpeg-free on Fedora
Confirm that Fedora’s package is installed:
rpm -q ffmpeg-free
ffmpeg-free-8.0.1-6.fc44.x86_64
Use the grep command to filter the encoder list for x264 and x265 software encoders:
ffmpeg -hide_banner -encoders 2>/dev/null | grep -E 'libx264|libx265' || echo 'No libx264/libx265 encoders listed'
No libx264/libx265 encoders listed
That result is expected for ffmpeg-free. Switch to RPM Fusion when your command or application needs libx264, libx265, or the full FFmpeg library set.
Enable RPM Fusion Free for Full FFmpeg
RPM Fusion’s full FFmpeg package is in the Free repository. Install the release package with the Fedora version detected automatically:
sudo dnf install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
Verify that the Free repositories are enabled. For a broader RPM Fusion setup, including Nonfree, see the RPM Fusion setup guide for Fedora.
dnf repo list --enabled rpmfusion-free rpmfusion-free-updates
repo id repo name rpmfusion-free RPM Fusion for Fedora 44 - Free rpmfusion-free-updates RPM Fusion for Fedora 44 - Free - Updates
Install Full FFmpeg from RPM Fusion
If Fedora’s ffmpeg-free package is already installed, replace it with RPM Fusion’s full package in one transaction:
sudo dnf swap ffmpeg-free ffmpeg --allowerasing
The --allowerasing flag lets DNF remove the conflicting ffmpeg-free libraries while installing RPM Fusion’s ffmpeg and ffmpeg-libs packages.
On systems where FFmpeg is not installed yet, install the RPM Fusion package directly:
sudo dnf install ffmpeg --allowerasing
Install development headers only if you compile software against RPM Fusion’s FFmpeg libraries:
sudo dnf install ffmpeg-devel --allowerasing
Verify Full FFmpeg on Fedora
Check that the installed package comes from RPM Fusion:
dnf info --installed ffmpeg | grep -E '^(Name|Version|Release|From repository)'
Name : ffmpeg Version : 8.0.2 Release : 1.fc44 From repository : rpmfusion-free-updates
Confirm that the x264 and x265 software encoders are available:
ffmpeg -hide_banner -encoders 2>/dev/null | grep -E 'libx264|libx265'
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)
Install Multimedia Codecs for Fedora Desktop Apps
FFmpeg handles command-line conversion, but desktop applications that use GStreamer need separate plugin packages. RPM Fusion’s multimedia group adds those complements for GStreamer-based media players and GNOME applications.
sudo dnf update @multimedia --setopt="install_weak_deps=False" --exclude=PackageKit-gstreamer-plugin
DNF treats @multimedia as a group transaction. The DNF5 group command guide for Fedora explains the group syntax if you want to inspect or manage groups separately.
If this command reports conflicts involving ffmpeg-free, finish the RPM Fusion FFmpeg swap first, then rerun the multimedia group update. A mixed Fedora/RPM Fusion codec stack is the usual cause.
Enable Hardware Acceleration for FFmpeg on Fedora
Hardware acceleration offloads video encoding or decoding to your GPU. Install only the driver package that matches your graphics hardware.
Intel Quick Sync on Recent GPUs
Recent Intel GPUs use intel-media-driver, which comes from RPM Fusion Nonfree. Enable Nonfree first if you did not install the full RPM Fusion setup earlier:
sudo dnf install https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
Install the Intel media driver:
sudo dnf install intel-media-driver
Intel VAAPI on Older GPUs
Older Intel hardware uses the legacy VAAPI driver from RPM Fusion Free:
sudo dnf install libva-intel-driver
AMD VAAPI with Mesa Freeworld
AMD systems that need RPM Fusion’s Mesa codec path should install the Freeworld VAAPI driver package:
sudo dnf install mesa-va-drivers-freeworld
NVIDIA VAAPI Wrapper
Fedora provides libva-nvidia-driver, a VAAPI wrapper for systems using NVIDIA’s proprietary driver stack:
sudo dnf install libva-nvidia-driver
The wrapper does not replace the proprietary NVIDIA driver. If nvidia-smi fails, install the driver stack with the Fedora NVIDIA driver guide before troubleshooting FFmpeg acceleration.
Verify FFmpeg Hardware Encoders
List the hardware encoders exposed by your installed FFmpeg build:
ffmpeg -hide_banner -encoders 2>/dev/null | grep -E 'vaapi|nvenc'
V....D h264_vaapi H.264/AVC (VAAPI) (codec h264) V....D hevc_vaapi H.265/HEVC (VAAPI) (codec hevc) V....D h264_nvenc NVIDIA NVENC H.264 encoder (codec h264) V....D hevc_nvenc NVIDIA NVENC hevc encoder (codec hevc)
Hardware encoder listings prove FFmpeg was built with those encoder interfaces. The GPU driver still needs to load correctly before actual encoding commands succeed.
Compare FFmpeg Codec Support on Fedora
The main practical difference is software codec support. Most scripts and tutorials that name libx264 or libx265 expect RPM Fusion’s full FFmpeg build.
| Workflow | ffmpeg-free | RPM Fusion ffmpeg | Notes |
|---|---|---|---|
| H.264 software encoding | OpenH264, no libx264 | libx264 | Use RPM Fusion for the common -c:v libx264 examples. |
| H.265 or HEVC software encoding | No libx265 | libx265 | Needed for many 4K and phone-video workflows. |
| Open web formats | Supported | Supported | VP9, AV1, Opus, and FLAC work in both builds. |
| Hardware encoders | Build support present | Build support present | Driver packages and hardware decide whether VAAPI, QSV, or NVENC works at runtime. |
libavcodec-freeworld | Optional complement | Not needed | Do not install it after switching to the full RPM Fusion ffmpeg package. |
Use FFmpeg on Fedora
These examples cover common command-line tasks after installation. Examples using libx264 or libx265 require RPM Fusion’s full FFmpeg package.
Convert MKV to MP4 Without Re-encoding
Stream copying changes the container while keeping the original audio and video streams:
ffmpeg -i input.mkv -c:v copy -c:a copy output.mp4
The -c:v copy and -c:a copy options make the operation fast and lossless. The original codecs still need to be compatible with the output container.
Re-encode Video with H.264
Re-encode video when the source codec or container cannot be copied cleanly:
ffmpeg -i input.avi -c:v libx264 -preset medium -crf 23 -c:a aac -b:a 128k output.mp4
The -preset medium option balances speed and compression. Lower -crf values improve quality and increase file size; 18 is near visually lossless, while 28 is much smaller with more visible loss.
Extract Audio from Video
Save the audio stream from a video file as MP3:
ffmpeg -i video.mp4 -vn -acodec libmp3lame -q:a 2 audio.mp3
The -vn option drops the video stream. The -q:a 2 setting uses high-quality variable bitrate MP3 output.
Convert Audio Formats
Convert MP3 audio to AAC for efficient playback in MP4-oriented workflows:
ffmpeg -i audio.mp3 -c:a aac -b:a 192k output.m4a
Convert to FLAC when you need a lossless archive:
ffmpeg -i audio.mp3 -c:a flac output.flac
Compress Video for Web Playback
Create a smaller H.264 MP4 and move metadata to the front of the file for progressive browser playback:
ffmpeg -i input.mp4 -c:v libx264 -crf 28 -preset medium -c:a aac -b:a 128k -movflags +faststart output.mp4
Encode with VAAPI or NVENC
Use VAAPI on Intel or AMD systems after the correct driver package is installed:
ffmpeg -vaapi_device /dev/dri/renderD128 -i input.mp4 -vf 'format=nv12,hwupload' -c:v h264_vaapi -qp 23 -c:a copy output.mp4
Use NVENC on NVIDIA systems with the proprietary driver loaded:
ffmpeg -i input.mp4 -c:v h264_nvenc -preset p4 -cq 23 -c:a copy output.mp4
Hardware encoding is faster than software encoding, but it can produce lower quality at the same bitrate. Use it when speed matters more than maximum compression efficiency.
Batch Convert MKV Files to MP4
Process every MKV file in the current directory with a simple shell loop:
for file in *.mkv; do
ffmpeg -i "$file" -c:v libx264 -crf 23 -c:a aac "${file%.mkv}.mp4"
done
The "${file%.mkv}.mp4" expansion removes the .mkv extension from each filename and appends .mp4.
Troubleshoot FFmpeg on Fedora
DNF Install Resolves to ffmpeg-free
Fedora’s default package can satisfy the ffmpeg command name. Check which package owns your current binary:
rpm -q --whatprovides /usr/bin/ffmpeg
ffmpeg-free-8.0.1-6.fc44.x86_64
If that output shows ffmpeg-free and you need the full codec build, enable RPM Fusion Free and run the swap command from the install section.
Fix Unknown Encoder libx264 on Fedora
The libx264 error means the installed FFmpeg build does not include the x264 encoder:
Unknown encoder 'libx264'
Check for the encoder directly:
ffmpeg -hide_banner -encoders 2>/dev/null | grep libx264 || echo 'libx264 is not available'
If the command prints libx264 is not available, switch to RPM Fusion’s FFmpeg build:
sudo dnf swap ffmpeg-free ffmpeg --allowerasing
Fix FFmpeg Package Conflicts
A mixed Fedora and RPM Fusion codec stack can produce conflict output like this:
Problem: package ffmpeg conflicts with ffmpeg-free - cannot install both
Use the swap transaction so DNF removes the conflicting Fedora libraries and installs RPM Fusion’s matching package set:
sudo dnf swap ffmpeg-free ffmpeg --allowerasing
If the conflict appears during the multimedia group update, complete the FFmpeg swap first, then rerun the @multimedia command.
Resolve Hardware Acceleration Errors
Driver or device errors usually mean the GPU stack is missing or the expected render device is unavailable. Relevant error lines can include:
Cannot load libcuda.so.1 Device creation failed: -1 Failed to initialise VAAPI connection
Confirm your GPU is visible to Fedora:
lspci | grep -E 'VGA|3D|Display'
For VAAPI, check that the render device exists:
ls -l /dev/dri/renderD128
For NVIDIA, verify the proprietary driver first:
nvidia-smi
If nvidia-smi fails, fix the NVIDIA driver before changing FFmpeg commands. If VAAPI fails, reinstall the Intel or AMD VAAPI package that matches your hardware.
Fix Permission Denied When Writing Output
FFmpeg writes output as your current user. A directory owned by another user can produce this error:
output.mp4: Permission denied
Check the destination directory, then add user-write permission only when you own that directory. The chmod command guide explains the mode syntax in more detail.
ls -ld /path/to/output/directory
chmod u+w /path/to/output/directory
Update or Remove FFmpeg on Fedora
Update FFmpeg Packages
Use the normal Fedora update flow. DNF updates whichever FFmpeg package family is installed, whether it came from Fedora or RPM Fusion:
sudo dnf upgrade --refresh
Remove Fedora’s ffmpeg-free Package
Remove Fedora’s default package when you no longer need the FFmpeg command from the default repositories:
sudo dnf remove ffmpeg-free
If you installed the development headers, remove them separately:
sudo dnf remove ffmpeg-free-devel
Remove RPM Fusion FFmpeg
Remove the full RPM Fusion package with DNF:
sudo dnf remove ffmpeg
Remove the RPM Fusion development headers only if you installed them:
sudo dnf remove ffmpeg-devel
Leave RPM Fusion enabled if other packages use it. If FFmpeg was the only RPM Fusion package on the system, remove the release package you installed:
sudo dnf remove rpmfusion-free-release
Remove RPM Fusion Nonfree only if you enabled it for hardware acceleration and no other packages depend on it:
sudo dnf remove rpmfusion-nonfree-release
Confirm that RPM Fusion repositories are no longer enabled:
dnf repo list --enabled | grep -i '^rpmfusion' || echo 'RPM Fusion repositories are not enabled'
After package removal, DNF may report unused dependencies. Review the proposed transaction before confirming a broader cleanup:
sudo dnf autoremove
Verify that neither FFmpeg package family remains installed:
rpm -q ffmpeg ffmpeg-free
package ffmpeg is not installed package ffmpeg-free is not installed
Official FFmpeg Resources
- FFmpeg official website: Project news, releases, and source information.
- FFmpeg documentation: CLI tools, filters, codecs, and library reference.
- FFmpeg wiki and bug tracker: Encoding notes, wiki pages, and issue tracking.
Conclusion
FFmpeg is ready on Fedora with a package source that matches your codec needs: Fedora’s ffmpeg-free for open-format work or RPM Fusion’s ffmpeg for full H.264 and H.265 software encoding. For GUI transcoding, install HandBrake on Fedora; for playback checks, install VLC on Fedora.


Formatting tips for your comment
You can use basic HTML to format your comment. Useful tags currently allowed in published comments:
<code>command</code>command<strong>bold</strong><em>italic</em><blockquote>quote</blockquote>