Home Ffmpeg How To Install FFmpeg In Linux

How To Install FFmpeg In Linux

By sk
Published: Updated: 30.5K views

In this guide, let me show you how to install FFmpeg on various Linux distributions. For those who don't know, FFmpeg is one of the best multimedia framework that can be used to encode, decode, transcode, mux, demux, record, stream, filter, and play any type of media files. It is completely free multimedia framework that works on almost all operating systems, including Linux, Mac OS X, Microsoft Windows, the BSDs, Solaris, etc. For more details, refer the official website link given at the end of this guide.

Install FFmpeg In Linux

FFmpeg is packaged for most Linux distributions and is available in the default repositories. Here I have included installation instructions for popular Linux distros.

Install FFmpeg on Arch Linux and its derivatives

FFmpeg is available in the default repositories of Arch Linux. You can install it using command:

$ sudo pacman -S ffmpeg

The latest development version is available in the AUR, so you can install it using any AUR hepers, such as Paru or Yay.

$ paru -S ffmpeg-git


$ yay -S ffmpeg-git

There is also ffmpeg-full package in AUR, which is built with as many optional features enabled as possible. You can install that too if you want.

$ yay -S ffmpeg-full-git

Install FFmpeg on Debian

FFmpeg is available in the default repositories. Open your Terminal and run the following command to install it.

$ sudo apt-get install ffmpeg

Install FFmpeg on Ubuntu and its derivatives

FFmpeg is available in the official repositories of Ubuntu, so you can install it using command:

$ sudo apt-get install ffmpeg

FFmpeg in the official repositories might be bit outdated. To install most recent version, use the FFmpeg PPA.

$ sudo add-apt-repository ppa:mc3man/trusty-media
$ sudo apt-get update
$ sudo apt-get dist-upgrade

Install FFmpeg on Fedora, RHEL, CentOS, AlmaLinux, Rocky Linux

FFmpeg can be installed via EPEL and RPM Fusion repositories on RPM-based distributions, such as Fedora, RHEL, CentOS, AlmaLinux, Rocky Linux.

First, Add EPEL repository using command:

$ sudo dnf install epel-release

Add RPM Fusion repository as shown below depending upon the distribution you use:

To enable access to both the free and the nonfree repository use the following command:

Fedora 22 and later:

$ sudo dnf install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm

RHEL 8.x and compatible systems:

$ sudo dnf install --nogpgcheck https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
$ sudo dnf install --nogpgcheck https://mirrors.rpmfusion.org/free/el/rpmfusion-free-release-8.noarch.rpm https://mirrors.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-8.noarch.rpm

RHEL 7.x, CentOS 7.x:

$ sudo yum localinstall --nogpgcheck https://mirrors.rpmfusion.org/free/el/rpmfusion-free-release-7.noarch.rpm https://mirrors.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-7.noarch.rpm

The above commands will install both free and non-free repositories.

After enabling EPEL and RPM Fusion repositories, run the following command to install FFmpeg:

$ sudo dnf install ffmpeg ffmpeg-devel


$ sudo yum install ffmpeg ffmpeg-devel

Install FFmpeg in openSUSE

Enable Packman repository on your openSUSE system.

If you're using openSUSE Tumbleweed edition, run the following command to enable Packman repository:

$ sudo zypper addrepo -cfp 90 'https://ftp.gwdg.de/pub/linux/misc/packman/suse/openSUSE_Tumbleweed/' packman

On openSUSE Leap:

$ sudo zypper addrepo -cfp 90 'https://ftp.gwdg.de/pub/linux/misc/packman/suse/openSUSE_Leap_$releasever/' packman

Refresh the repository database:

$ sudo zypper refresh

Finally, install FFmpeg on openSUSE using command:

$ sudo zypper install --from packman ffmpeg

Congratulations! You have successfully installed FFmpeg on your Linux box.

To verify the FFmpeg version, run:

$ ffmpeg -version

Sample output:

ffmpeg version 4.4 Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 11 (GCC)
configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --docdir=/usr/share/doc/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' --extra-ldflags='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld ' --extra-cflags=' -I/usr/include/rav1e' --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-version3 --enable-bzlib --disable-crystalhd --enable-fontconfig --enable-frei0r --enable-gcrypt --enable-gnutls --enable-ladspa --enable-libaom --enable-libdav1d --enable-libass --enable-libbluray --enable-libcdio --enable-libdrm --enable-libjack --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-nvenc --enable-openal --enable-opencl --enable-opengl --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librav1e --enable-libsmbclient --enable-version3 --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-version3 --enable-vapoursynth --enable-libvpx --enable-vulkan --enable-libglslang --enable-libx264 --enable-libx265 --enable-libxvid --enable-libxml2 --enable-libzimg --enable-libzvbi --enable-lv2 --enable-avfilter --enable-avresample --enable-libmodplug --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-lto --enable-libmfx --enable-runtime-cpudetect
libavutil 56. 70.100 / 56. 70.100
libavcodec 58.134.100 / 58.134.100
libavformat 58. 76.100 / 58. 76.100
libavdevice 58. 13.100 / 58. 13.100
libavfilter 7.110.100 / 7.110.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 9.100 / 5. 9.100
libswresample 3. 9.100 / 3. 9.100
libpostproc 55. 9.100 / 55. 9.100

To print FFmpeg help section:

$ ffmpeg -h

Display FFmpeg man page:

$ man ffmpeg

Now, head over to the next tutorial to learn to use FFmpeg. I have compiled the most commonly and frequently used 20+ FFmpeg commands in the following guide.


You May Also Like

Leave a Comment

* By using this form you agree with the storage and handling of your data by this website.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

This website uses cookies to improve your experience. By using this site, we will assume that you're OK with it. Accept Read More