Skip to main content

Installing FFmpeg on Ubuntu

Want to install the famed FFmpeg open source too on Ubuntu? It's quite simple.

Sagar Sharma

FFmpeg is an open-source, cross-platform solution to record and convert audio and video files. It is the backbone of many conversion tools on Linux and other platforms.

And in this guide, I will show you how you can install FFmpeg on Ubuntu and will also share a list of common commands used with FFmpeg.

Install FFmpeg on Ubuntu

FFmpeg is a popular tool and can be found in the universe repository in Ubuntu.

While this repo is enabled on most systems already, there is no harm in double-checking it.

sudo add-apt-repository universe

Update the package cache so that system sees the packages from the newly added repository.

sudo apt update

And now, to install FFmpeg on Ubuntu, all you have to do is execute the following command:

sudo apt install ffmpeg

To confirm the installation, you can check the installed version:

ffmpeg -version
check the installed version of ffmpeg

Common FFmpeg commands

FFmpeg can handle almost every basic task related to your media files. And here are some basic commands that will help you to get more out of it:

Command Description
ffplay Get a preview of the media file.
ffmpeg -i -hide_banner Get detailed information about the media file.
ffmpeg -i <input.mp4> -vn <output.mp3> Convert video to audio file.
ffmpeg -i <input.mp4> -an <mute-output.mp4> Mute the audio of the MP4 file.
ffmpeg -i <input.mp4> <output.gif> Create GIF from an MP4 file.
ffmpeg -i <> <output.mp4> Convert MOV to MP4.
ffmpeg -i <input.mp4> -vf "fps=30" <output.mp4> Change the FPS of a media file.
ffmpeg -loop 1 -i <input.png> -c:v libx264 -t 30 -pix_fmt yuv420p <video.mp4> Create a video from a single image.
ffmpeg -i <input.mp3> -af 'volume=0.5' <output.mp3> Tweak the volume of an audio file.
fmpeg -loop 1 -i <image.jpg> -i <input.mp3> -c:v libx264 -c:a aac -strict experimental -b:a 192k -shortest <output.mp4> Create a video using a single image and audio file.

Just getting started with FFmpeg?

If you are just getting started with FFmpeg, the command syntax and options might overwhelm you.

And for that purpose, we have a complete guide for FFmpeg:

The Complete Guide for Using ffmpeg in Linux
Brief: This detailed guide shows how to install ffmpeg in Ubuntu and other Linux distributions. It also demonstrates some useful ffmpeg commands for practical usage. ffmpeg is a CLI (command line based) utility for processing media files. It is a framework with a multitude of features and, beca…

I hope you will find this helpful.

And if you face any errors while using FFmpeg, feel free to let me know through the comments.

Sagar Sharma