FFmpeg is a software that is designed to handle videos, audios, and other multimedia files of different types. It is absolutely free and open source.
Here at LinuxAPT, as part of our Server Management Services, we regularly help our Customers to perform Software Installation tasks on their Linux Server.
In this context, we shall look into the process to install FFmpeg on Ubuntu.
There are no formal pre-requisites for installation. Therefore, proceed with the installation steps as shown below:
1. Update your System
Open a new terminal window in Ubuntu 20.04 and execute the command:
sudo apt update
This will ensure that there are no broken dependencies or packages that will have the potential to interfere in your installation process.
2. Run the Installation Command
Now that the system is fully updated, it is the best time to run the FFmpeg installation command in your terminal which is shown below:
sudo apt install ffmpeg
Like every other package installation, during the execution of the installation command, you will be asked to confirm whether you want to proceed with it or not. You can type “Y” in your terminal followed by pressing the Enter key for verifying your choice.
3. Check the Version of FFmpeg
To confirm the version of FFmpeg installed, simply run the “-version” command as shown below:
ffmpeg –version
Running this command will show you a lot of information regarding FFmpeg.
4. Check the Installed Encoders
Optionally, you can also check all the encoders installed along with FFmpeg by printing them on the terminal. The encoders can be printed by typing the command stated below in your Ubuntu 20.04 terminal:
ffmpeg –encoders
Running the above-mentioned command will display all the encoders of FFmpeg on your terminal.
5. Check the Installed Decoders
Also, it is optional to check all the decoders that are installed along with FFmpeg by printing them on the terminal. The decoders can be printed by executing the command stated below in your Ubuntu 20.04 terminal:
ffmpeg –decoders
Executing the above-mentioned command will display all the decoders of FFmpeg on your terminal.
Here, we will test FFmpeg in different scenarios as shown below:
1. Converting an .mp3 Audio File to .wav using FFmpeg
In this instance, we have an .mp3 file located in our Home directory with name "Audio.mp3".
What we want to do is to convert this .mp3 file to .wav file for which we will first launch the terminal and type the following command in it:
ffmpeg –i Audio.mp3 Audio.wav
Then you can verify if the conversion has taken place or not, by visiting your Home directory again and you will be able to see another audio file with the .wav extension along with the .mp3 file with name "Audio.wav".
2. Converting an .mp4 Video File to .mov using FFmpeg
Here, we have an .mp4 file located in our Home directory with name "Video.mp4".
What we need to achieve is to convert this .mp4 file to .mov file for which we will first launch the terminal and type the following command in it:
ffmpeg –i Video.mp4 Video.mov
To verify if the conversion has taken place or not, go to your Home directory again and you will be able to see another video file with the .mov extension along with the .mp4 file with name "Video.mov".