How To Install FFmpeg on Fedora 40
In this tutorial, we will show you how to install FFmpeg on Fedora 40. FFmpeg is a powerful multimedia framework that allows users to record, convert, and stream audio and video. Its versatility makes it an essential tool for developers, content creators, and anyone involved in multimedia processing. With the release of Fedora 40, installing FFmpeg has become more streamlined, thanks to improved system compatibility and enhanced package management features.
This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo
‘ to the commands to get root privileges. I will show you the step-by-step installation of the FFmpeg multimedia framework on Fedora 40.
Prerequisites
Before we dive into the installation process, ensure that you have the following prerequisites in place:
- A server running one of the following operating systems: Fedora 40.
- It’s recommended that you use a fresh OS install to prevent any potential issues.
- You will need access to the terminal to execute commands. Fedora provides the Terminal application for this purpose. It can be found in your Applications menu.
- A stable internet connection to download the necessary packages.
- A non-root sudo user or access to the root user. We recommend acting as a non-root sudo user, however, as you can harm your system if you’re not careful when acting as the root.
Install FFmpeg on Fedora 40
Step 1. Update the System.
To ensure a smooth and secure installation, it is crucial to update your Fedora 40 system before proceeding with the FFmpeg installation. Updating the system ensures that you have the latest security patches, bug fixes, and compatible dependencies. Open your terminal and run the following command:
sudo dnf clean all sudo dnf update
This command will fetch the latest package information from the Fedora repositories and upgrade any outdated packages to their latest versions. The process may take a few minutes, depending on the number of updates available.
Step 2. Enabling RPM Fusion Repository.
To install FFmpeg, you first need to enable the RPM Fusion repository. This can be done using the following commands in the terminal:
sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm sudo dnf install https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
These commands download and install the RPM Fusion free and non-free repositories, respectively, which are essential for accessing the FFmpeg package.
Step 3. Installing FFmpeg on Fedora 40.
With the RPM Fusion repository enabled, you can now proceed to install FFmpeg on your Fedora system by running:
sudo dnf install ffmpeg
This command uses Fedora’s DNF package manager to install FFmpeg along with its dependencies. DNF handles package dependencies automatically, making the installation process smoother.
After installation, verify that FFmpeg is installed correctly by checking its version:
ffmpeg -version
This command displays the installed version of FFmpeg, ensuring the software is ready for use.
If you encounter dependency errors during installation, consider using the --best --allowerasing
options with DNF to resolve these issues:
sudo dnf install ffmpeg --best --allowerasing
Step 4. Advanced Usage Tips.
To truly leverage FFmpeg’s capabilities, here are some basic commands for video and audio processing:
- Converting Video Formats: FFmpeg allows you to easily convert video files from one format to another. For example, to convert an MP4 video to AVI, use the following command:
ffmpeg -i input.mp4 output.avi
- Resizing Videos: FFmpeg provides options to resize videos while maintaining their aspect ratio. To resize a video to a specific width, use the following command:
ffmpeg -i input.mp4 -vf scale=800:-1 output.mp4
- Extracting Audio: FFmpeg allows you to extract audio from video files. To extract the audio from a video and save it as an MP3 file, use the following command:
ffmpeg -i input.mp4 -vn -ab 128k -ar 44100 -y output.mp3
Congratulations! You have successfully installed FFmpeg. Thanks for using this tutorial for installing the FFmpeg multimedia framework on the Fedora 40 system. For additional or useful information, we recommend you check the official FFmpeg website.