Learn how to install FFmpeg on Ubuntu 20.04 – the free and open-source software suite for multimedia handling. FFmpeg offers a range of shared audio and video libraries including libavcodec, libavformat, and libavutil to easily convert media files to different formats, adjust sample rates, capture streaming content, and resize videos.
Follow this step-by-step guide to effortlessly install FFmpeg on Ubuntu 20.04.
Installing FFmpeg on Ubuntu is simple using the
apt package manager, which provides FFmpeg packages in the official Ubuntu repositories. However, the version of FFmpeg included in these repositories may not be the latest, as a new major release is only made available every six months.
As of the time of writing this article, Ubuntu 20.04 repositories offer version
4.2.x of FFmpeg. To install it, simply enter the following command as a user with sudo privileges or as root:
sudo apt update sudo apt install ffmpeg
You can check if FFmpeg is installed correctly by using the command
ffmpeg -version, which will display the version of FFmpeg:
The output should look something like this:
ffmpeg version 4.2.4-1ubuntu0.1 Copyright (c) 2000-2020 the FFmpeg developers built with gcc 9 (Ubuntu 9.3.0-10ubuntu2)
Type the following to display a list of all encoders and decoders available in FFmpeg:
ffmpeg -encoders ffmpeg -decoders
You have successfully installed FFmpeg on your system and it’s ready for use. In case a new version becomes available, you can easily update the FFmpeg package either through the command-line or by using your desktop Software Update tool.
This section provides some simple examples to demonstrate how to use the
You don’t need to indicate the input and output formats when using
ffmpeg to transform audio and video files. The tool automatically detects the input file format and guesses the output format based on the file extension.
Here are examples of how to convert a video file from mp4 to webm and an audio file from mp3 to ogg using ffmpeg:
- To convert a video file from mp4 to webm, use the command:
ffmpeg -i input.mp4 output.webm
- To convert an audio file from mp3 to ogg, use the command:
ffmpeg -i input.mp3 output.ogg
To specify the codecs while converting files, you can use the
-c option. The codecs can be any supported decoder/encoder or “
copy,” a special value that duplicates the input stream.
Here are two examples:
- To convert a video file from mp4 to webm format, you can use the
libvpxvideo codec and the
libvorbisaudio codec with the following command:
ffmpeg -i input.mp4 -c:v libvpx -c:a libvorbis output.webm
- To convert an audio file from mp3 to ogg format, encoded with the
libopuscodec, you can use the following command:
ffmpeg -i input.mp3 -c:a libopus output.ogg
In conclusion, this guide has provided a comprehensive tutorial on how to install FFmpeg on Ubuntu 20.04. Now, you can explore the powerful features of FFmpeg and learn how to effortlessly convert your video and audio files. For more information on FFmpeg and its functionalities, please visit the official FFmpeg Documentation page.
If you encounter any difficulties during the installation process or have any feedback, please feel free to leave a comment below.