February 2, 2023

How To Install FFmpeg And Convert Files On Ubuntu 20.04

Abhishek Thakur

FFmpeg is a free open-source command line tool for processing various media files and streams. Basically, it is designed to handle audio and video files processing. But with subsequent releases, features like format transcoding, basic editing, and video effects for post-production came into light. The FFmpeg library is an integral part of software like VLC and is also included in the main YouTube processing. It is also one of the exceptional tool that NASA used  for the Mars perseverance rover to compress images and videos before sending them back to Earth. In this guide we will explain how to install FFmpeg and convert files on Ubuntu 20.04.

Requirements

Steps To Install FFmpeg On Ubuntu 20.04

By default Ubuntu repository contains the FFmpeg package which can be installed using the apt package manager but it may be not the latest release. You can also use GIt to copy and compile the source code for latest FFmpeg release. But the apt package manager is the easiest way to install FFmpeg. At first SSH to the Ubuntu server and  run the given command in terminal to update the current software repository and packages for the system.

# apt update

# apt upgrade -y

After the initial updates are done we can move to the installation process. Run the given command to install FFmpeg using  the apt software repository.

# apt install ffmpeg -y

Once the installation is finished, verify it by running the given command.

# ffmpeg –version

The output will represent the current version of installed FFmpeg, which confirms that the installation is done without any errors.

How To Install FFmpeg And Convert files On Ubuntu 20.04

Steps To Convert Files On Ubuntu 20.04 Using FFmpeg

Now as the FFmpeg command line tool is installed we can move with a conversion to test its working. In this guide we will show you how to extract audio from a video file, for which the conversion will be from .mp4 to .mp3. Firstly lets check the video file details on which we are going to do the conversion using FFmpeg. For example: I am going to show you the details for the file video.mp4. Run the given command in terminal to check the video.mp4 file information.

# ffmpeg -i video.mp4

The output will show the information about the file. You can also get the information on any media file using the same command provided above by replacing the video.mp4 filename.

Conversion using FFmpeg

Extracting Audio From Video FIle Using FFmpeg

In order to extract the audio from video file enter the given command and run it in the terminal. Replace the filename audio.mp3 to the format and filename you want the output saved to.

# ffmpeg -i video.mp4 -vn audio.mp3

Audio Coversion using FFmpeg

This will take some time depending upon the computing source and file length. Once it is done you can check the present directory for the new file named audio.mp3. To check the file run the dir command to check the list of files in that directory.

Media Converted

Conclusion

FFmpeg has always been a very experimental and developer-driven project. It is a key component in many multimedia projects and has new features added constantly. It works really well 99% of the time so people are not afraid to use them. If you have any questions or suggestions feel free to contact us.


Buy Your Dedicated FFmpeg Server Today @ $89/m only.

Popular Blog Posts