Installation in Debian/Ubuntu

Consider installing FFmpeg on Debian and Ubuntu OS. This method is suitable for Debian 10, Debian 11, Ubuntu 20.04 and Ubuntu 22.04.

First, you may need to update the package information on your system.:

# apt update

Next, install FFmpeg.

# apt install ffmpeg apt-get install ffmpeg

We see that the system offers to install the package and dependencies, press Y (or E).

We are waiting for the installation to finish. If there are no errors, check that FFmpeg is installed.:

# ffmpeg --version
ffmpeg version 4.3.5-0+deb11u1 Copyright (c) 2000-2022 the FFmpeg developers
…

Установка в CentOS/AlmaLinux/RockyLinux

To install FFmpeg on CentOS 7, you will need third-party repositories. First, let’s turn on the EPEL repository.:

# yum install epel-release

Next, you need to enable the Fusion repository.:

# yum localinstall --nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-7.noarch.rpm

And install FFmpeg with all the necessary packages.:

# yum install ffmpeg ffmpeg-devel

We confirm the installation of the package and all dependencies, as well as the import of GPG keys with the Y button.

We wait for the installation to finish and check:

# ffmpeg --version
ffmpeg version 3.4.12 Copyright (c) 2000-2022 the FFmpeg developers
…

AlmaLinux 8/RockyLinux 8/AlmaLinux 9/RockyLinux 9

In modern rpm-based operating systems, we use the dnf package manager. To begin with, just like in CentOS 7, we connect the EPEL repository and the dnf-utils package necessary for further work.:

# dnf -y install epel-release dnf-utils

Enabling the PowerTools repository:

# dnf config-manager --set-enabled powertools

And install FFmpeg:

# dnf install ffmpeg

Checking it out:

# fmpeg --version
ffmpeg version 5.1.2 Copyright (c) 2000-2022 the FFmpeg developers
…

AlmaLinux 9 and RockyLinux 9 may have problems with the above repositories, so there is an alternative way.:

# dnf install --nogpgcheck https://mirrors.rpmfusion.org/free/el/rpmfusion-free-release-$(rpm -E %rhel).noarch.rpm
# dnf update -y
# dnf install ffmpeg ffmpeg-devel

Checking it out:

# fmpeg --version

Using FFmpeg

You can view the supported formats using the command:

# ffmpeg -formats

To view the encoders, use the command:

# ffmpeg -encoders

To view the list of decoders, use the command:

# ffmpeg -decoders

Use man to read the documentation in more detail.:

# man ffmpeg

Let’s look at some examples of using FFmpeg. First navigate to the directory with the file using cd /path to file/, so as not to write the full path to the file in the commands.

Use the i flag to get information about the media file.:

# ffmpeg -i file.mp4

Convert a file from mp4 to a modern lightweight webm format (old_file.mp4 is the current file, new_file.webm — new file):

# ffmpeg -i old_file.mp4 new_file.webm