Installing FFmpeg on Ubuntu

October 13, 2022


FFmpeg is a command-line tool that records, transcodes, mixes, formats, and streams multimedia content. This cross-platform framework is open-source and shares audio and video libraries (libavutil, libavcodec, libavformat, libavdevice, libavfilter, libswscale, and libswresample) with users for free.

In this tutorial, you will learn about installing FFmpeg on Ubuntu using two methods.

Installing FFmpeg on Ubuntu


  • Ubuntu installed (this guide uses Ubuntu 20.04).
  • A user with root or sudo privileges.
  • Access to the terminal.

Install FFmpeg on Ubuntu with apt

The FFmpeg package is included in Ubuntu repositories, but the version may not be the latest. Still, apt is frequently used as it is one of the easiest ways to install FFmpeg on Ubuntu.

Step 1: Update the Repository

Update and upgrade the system packages to get the FFmpeg version currently available in the repository. Execute the following command:

sudo apt update && sudo apt upgrade
sudo apt update && sudo apt upgrade terminal output

Hit y to continue when prompted:

Step 2: Install FFmpeg

After upgrading the repository, install FFmpeg by running the following:

sudo apt install ffmpeg
sudo apt install ffmpeg terminal output

Step 3: Verify the Installation

Confirm that FFmpeg has been installed with:

ffmpeg -version
ffmpeg version terminal output

The command verifies that the 4.2.7 version of FFmpeg is installed. The 4.2.7 is the latest stable FFmpeg version in the Ubuntu 20.04 repositories. However, apps in Ubuntu repositories are not always up-to-date.

To update FFmpeg to the latest version, use snappy.

Install FFmpeg on Ubuntu with snappy

Get the latest version of FFmpeg with the Snap package manager (snappy).

The snap tool packs an app and its dependencies in a snap package, a container that works on any Linux distribution. Moreover, unlike FFmpeg packages in official Ubuntu repositories, snaps are updated automatically and continually, ensuring users get the latest FFmpeg version.

Step 1: Install Snap

Start by checking whether Snap is already installed on the system, as is the case on Ubuntu. Execute the following:

snap version
snap version terminal output

The output verifies that Snap is running. In case Ubuntu does not have Snap, the command prints the following:

sanpd not installed terminal output

To add Snap to the machine, follow these steps:

1. Update and upgrade the repository with:

sudo apt update && sudo apt upgrade
sudo apt update && sudo apt upgrade before snap terminal output

2. Install Snap by running:

sudo apt install snapd
sudo apt install snapd terminal output

3. Verify the installation using:

snap version
snap version terminal output

Step 2: Install FFmpeg

To install FFmpeg, run:

sudo snap install ffmpeg
download snap ffmpeg from channel stable terminal output

The terminal displays the progress bar. Once the installation completes, the output looks like this:

sudo snap install ffmpeg terminal output

Note: If you previously installed ffmpeg using apt, uninstall the tool, restart the system, and then use snap to install ffmpeg again.

Step 3: Verify the Installation

To verify that FFmpeg is installed, run:

ffmpeg -version
ffmpeg version post snap terminal output

The version of FFmpeg installed with Snap is 4.3.1, a more recent version than the one installed via apt (4.2.7).


After going through this tutorial, you now understand how to install FFmpeg on Ubuntu using apt or snappy. Next, learn about the differences between Snap, Flatpack, and AppImage package formats.

If you are a Windows user, read our tutorial and learn how to install FFmpeg on Windows, and if you are a Mac user, learn how to install FFmpeg on MacOS..

Was this article helpful?
Sara Zivanov
Sara Zivanov is a technical writer at phoenixNAP who is passionate about making high-tech concepts accessible to everyone. Her experience as a content writer and her background in Engineering and Project Management allows her to streamline complex processes and make them user-friendly through her content.
Next you should read
How to Fix Broken Packages in Ubuntu
October 14, 2021

A bad internet connection or misconfigured third-party installers can corrupt packages and cause problems on your computer. This article will show...
Read more
How to Reinstall Ubuntu
July 6, 2022

This tutorial will show you how to create a bootable USB and reinstall Ubuntu. Reinstalling the OS is sometimes the easiest solution for fixing issues with drivers or after an upgrade failure...
Read more
How to Install Ubuntu 22.04 LTS Desktop (Jammy Jellyfish)
April 20, 2022

Ubuntu 22.04 LTS is the newest Ubuntu version with great new features. Follow this guide to install Ubuntu 22.04 in no time...
Read more
How to List Installed Packages on Ubuntu
March 9, 2022

Having a precise list of installed packages helps system admins maintain, replicate, and reinstall systems. In this tutorial, learn how to list all...
Read more