Ubuntu

How to Install FFmpeg on Ubuntu 20.04?

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.

Кращі емулятори ігрової консолі для Linux
У цій статті буде перелічено популярне програмне забезпечення для емуляції ігрової консолі, доступне для Linux. Емуляція - це рівень сумісності програ...
Best Linux Distros for Gaming in 2021
The Linux operating system has come a long way from its original, simple, server-based look. This OS has immensely improved in recent years and has no...
Як зафіксувати та транслювати ігровий сеанс на Linux
Раніше грати в ігри вважалося лише хобі, але з часом ігрова індустрія спостерігала величезний ріст з точки зору технологій та кількості гравців. Аудит...