Install and Use FFmpeg on Ubuntu 20.04

In this article, we want to teach you how to Install and Use FFmpeg on Ubuntu 20.04. FFmpeg is one such software platform, especially for multimedia files. With the help of its expanded libraries, we can convert, edit, repair, and format any video format.

It is a command-line tool that uses commands to work on audio and video formats. With its advanced features, it supports a wide range of audio and video codecs. You can now proceed to the following steps on the Orcacore website to set up FFmpeg on Ubuntu 20.04.

How To Install and Use FFmpeg on Ubuntu 20.04

Before you start to install FFmpeg, you need to log in to your server as a non-root user with sudo privileges. To do this, you can follow our article about the Initial Server Setup with Ubuntu 20.04.

1. Install FFmpeg on Ubuntu 20.04

FFmpeg packages are available in the default Ubuntu repository. First, update your local package index with the following command:

sudo apt update

Then, you can install FFmpeg with the following command:

sudo apt install ffmpeg -y

After your installation is completed, you can verify it by checking its version:

ffmpeg -version

In your output, you will see something similar to this:

Output
ffmpeg version 4.2.4-1ubuntu0.1 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 9 (Ubuntu 9.3.0-10ubuntu2)

Available FFmpeg Encoders

Now you can see all available FFMpeg encoders and decoders on Ubuntu 20.04 with the following commands:

ffmpeg -encoders
Available FFmpeg Encoders

Available FFmpeg Decoders

ffmpeg -decoders
Available FFmpeg Decoders

At this point, you have installed FFmpeg on your Ubuntu 20.04. Now you can start using it.

2. Using FFmpeg on Ubuntu 20.04

At this step, we will show you how to use FFmpeg with some basic examples.

You don’t have to specify the input and output formats when you are converting the audio and video files with FFmpeg on Ubuntu 20.04.

The input file format is auto-detected, and the output format is guessed from the file extension.

For example, to convert a video file from MP4 to webm, you can use the following command:

ffmpeg -i input.mp4 output.webm

And to convert an audio file from MP3 to ogg, you can use the following command:

ffmpeg -i input.mp3 output.ogg

Also, you can use the –c parameter to specify the codecs when you are converting the files.

For example, you can convert a video file from MP4 to webm using the libvpx video codec and the libvorbis audio codec:

ffmpeg -i input.mp4 -c:v libvpx -c:a libvorbis output.webm

And to convert an audio file MP3 to ogg encoded with the libopus codec, you can use the following command:

ffmpeg -i input.mp3 -c:a libopus output.ogg

For more details and information about FFmpeg, you can visit the official FFmpeg documentation page.

Conclusion

At this point, you have learned to install and use FFmpeg on your server. With FFmpeg, you can:

  • Convert video to image and vice versa.
  • Speed control of audio and video files
  • Encode, decode, mux, demux, transcode, filter, etc, various multimedia files.
  • Inclusion of a logo or picture in a picture or video.
  • Display input and output, and also record input from the webcam.

Hope you enjoy it. You may also like to read the following articles:

Set up Monit Manager on Ubuntu 20.04

Install OpenJDK 19 on Ubuntu 20.04

Install Apache Maven on Ubuntu 20.04

Enable Brotli Compression on Ubuntu 20.04

FAQs

What is FFmpeg?

FFmpeg is a powerful, open-source multimedia framework used to record, convert, stream, and manipulate audio and video. It supports a wide range of formats and codecs.

Is FFmpeg available in Ubuntu 20.04’s official repositories?

Yes, FFmpeg is included in the default Ubuntu 20.04 repositories, making it easy to install using apt.

Share your love

Stay informed and not overwhelmed, subscribe now!