Installing FFmpeg on Ubuntu

Published:
February 6, 2025
Topics:

FFmpeg is a command-line tool that records, transcodes, mixes, formats, and streams multimedia content. This cross-platform framework is open source and provides users with free access to audio and video libraries.

In this tutorial, you will learn how to install FFmpeg on Ubuntu using two methods.

Installing FFmpeg on Ubuntu

Prerequisites

Install FFmpeg on Ubuntu with apt

The FFmpeg package is included in the Ubuntu repositories, though it may not always be the latest version. The apt command provides a simple and convenient way to install it.

Follow these steps to install FFmpeg using the APT package manager.

Step 1: Update the Repository

Update the system package repository to install the latest FFmpeg version. Run the following command:

sudo apt update
terminal output for sudo apt update

Step 2: Install FFmpeg

After upgrading the repository, install FFmpeg with:

sudo apt install ffmpeg
sudo apt install ffmpeg terminal output

Step 3: Verify the Installation

Confirm the FFmpeg installation was successful:

ffmpeg -version
ffmpeg -version terminal output

The command verifies the version of FFmpeg on the system. The 6.1.1 is the latest stable FFmpeg version in the Ubuntu repositories at the time of writing this article. However, apps in the Ubuntu repositories are not always up to date.

Therefore, to make sure you have the latest FFmpeg version, use the Snap package manager.

Install FFmpeg on Ubuntu with Snap

Snap packages bundle an application and its dependencies into a self-contained package that works across all Linux distributions. Unlike the FFmpeg packages in Ubuntu's official repositories, Snap updates automatically and continuously, ensuring users always have the latest version.

Follow these steps to install FFmpeg using Snap.

Step 1: Install Snap

Check whether the Snap package manager is already installed on the system with:

snap version
snap version terminal output

The output verifies Snap is installed. However, if Snap is not installed, follow these steps:

1. Update the repository with:

sudo apt update && sudo apt upgrade

2. Install Snap with:

sudo apt install snapd
sudo apt install snapd terminal output

3. Verify the installation using:

snap version

Step 2: Install FFmpeg

To install FFmpeg, run:

sudo snap install ffmpeg
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 FFmpeg is installed, run:

ffmpeg -version

Conclusion

This tutorial explained how to install FFmpeg using two different methods. 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?
YesNo