Ubuntu

How to Install FFmpeg on Ubuntu 20.04?

FFmpeg is a very popular software project, which is a collection of programs and libraries that are used to handle the audio and video files conversion, streams, as well as record other multimedia files. It is a toolbox available in the command-line to convert, stream, and manipulate multimedia content.

Installing FFmpeg on Ubuntu 20.04:

There are various ways to install FFmpeg on Ubuntu 20.04, like installing it from the official Ubuntu’s package repository, from the snap store, and/or from the source.

The easiest and most convenient way to install the latest and stable version of FFmpeg is to install it from the APT package manager.

At the time of writing this article, the latest stable version of FFmpeg is 4.2.4, and it is available on the Ubuntu APT package repository.

To install it, first update the system’s APT cache repository:

$ sudo apt update

After updating the system’s APT cache repository, install FFmpeg using the simple command given below:

$ sudo apt install ffmpeg

It may ask for taking additional disk space for installation, type “Y” and hit the “Enter” button.

Now FFmpeg is installed on your Ubuntu 20.04 LTS system.

The next thing you should do after confirming its installation is, first, check the version of FFmpeg using the command given below:

$ ffmpeg --version

The output has shown that the installed version of FFmpeg on my Ubuntu 20.04 LTS system is 4.2.4.

In order to see/print encoders and decoders available from FFmpeg, type the commands given below:

$ ffmpeg -encoders

$ ffmpeg -decoders

You can witness that FFmpeg is installed and working perfectly fine. Let’s try a couple of tasks like extracting the file information or audio from a video file and converting a video or audio file to any other format.

Extract the File Information

To get all the information of a media file in Ubuntu 20.04 LTS system using the FFmpeg, type the command given below:

$ ffmpeg -i audio_file.mp3

Make sure to replace the “audio_file.mp3” with your audio or video file name. You can get the information of any video file using the same command provided above.

Extract Audio from a Video File

In order to extract the audio from any video file using the FFmpeg, the command will be like as follows:

$ ffmpeg -i video_file.mp4 -vn audio_file.mp3

By using the above simple command, you can get the audio from any video file. Just replace the “video_file.mp4” with your video file name, and later provide the new audio file name that you are going to extract.

Convert a Media File to Another Format

If you want to convert your audio or video file to any other format of your need, you can do so by typing the following command. For example, to convert an MP4 format video to, let’s say, WEBM format.

$ ffmpeg -i input_video.mp4 output_video.webm

This is how you can simply convert your media file to any other file format.

To convert any audio file to some other format, the command will be the same as above.

First, provide the file name to which you want to convert and later provide the new name of the file along with the file format.

Conclusion:

This is how you can install FFmpeg on your Ubuntu 20.04 LTS system from the APT package repository and start using it. In this post, we have also seen some basic commands to learn the usage of FFmpeg on Ubuntu 20.04 LTS system.

About the author

Shehroz Azam

A Javascript Developer & Linux enthusiast with 4 years of industrial experience and proven know-how to combine creative and usability viewpoints resulting in world-class web applications. I have experience working with Vue, React & Node.js & currently working on article writing and video creation.

3 Comments

  • The title says “Ubuntu 17.04, Ubuntu 16.10” but the code is for 16.04 and 14.04. “jonathonf/ffmpeg-3” repo is not available for 17.04. How can one install on 17.04?

    Thanks.

    • Thanks for notifing me of that. As seen that was an oversight on my part despite showing in the post that its for Ubuntu 16.04 and Ubuntu 14.04.

      I will investigate install for Ubuntu 17.04 and update post.

    • For Ubuntu 17.04, simply run “sudo apt-get install ffmpeg”, that would install version 3.2.4