How To Install FFmpeg on CentOS 8 / RHEL 8

Posted on 19 views

Question: How can install FFmpeg on CentOS 8 / RHEL 8 Linux system?. FFmpeg is a free and open source multimedia framework used to play, encode, decode, stream, transcode, mux, demux, and filter different formats of multimedia files including MPEG1 audio and video, MPEG4, h263, ac3, asf, avi, real, mjpeg, and flash.

FFmpeg is a cross-platform application as it can run on Linux, macOS, Windows, BSDs, Solaris, etc, under wide variety of build environments, configurations and machine architectures. Most media players available for Linux and Audio/Video downloaders and converters such as youtube-dl require FFmpeg to work.

FFmpeg Tools

These are the main FFmpeg building blocks:

  • ffmpeg – Command line tool to convert multimedia files between formats
  • ffplay – Simple media player based on SDL and the FFmpeg libraries
  • ffprobe – Simple multimedia stream analyzer

FFmpeg also contain Libraries for developers – libavutil, libavcodec, libavformat, libavdevice, libavfilter, libswscale and libswresample.

The transcoding process in ffmpeg for each output can be described by the following diagram:

ffmpeg-transcode-process

How To Install FFmpeg on CentOS 8 / RHEL 8

Follow the next steps discussed here to install FFmpeg on CentOS 8 / RHEL 8 Linux distribution. You should have access to your CentOS / RHEL 8 system before you continue.

Step 1: Install RPMfusion Yum Repository

The RPM Fusion repository was created to provide software not shipped by Fedora and Red Hat based distributions. All software applications available in this repository are provided as precompiled RPM files. We’ll install FFmpeg on CentOS 8 / RHEL 8 from RPMfusion repository.

You need to enable EPEL on RHEL or compatible distributions like CentOS before you enable RPM Fusion for EL.

sudo dnf -y install https://download.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
sudo yum-config-manager --enable powertools

Add it to your system using the commands below.

sudo dnf install -y https://download1.rpmfusion.org/free/el/rpmfusion-free-release-8.noarch.rpm
sudo dnf install -y https://download1.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-8.noarch.rpm

Accept installations.

...........................
Dependencies resolved.
===================================================================================================================================================
 Package                                      Arch                         Version                        Repository                          Size
===================================================================================================================================================
Installing:
 rpmfusion-free-release                       noarch                       8-0.1                          @commandline                        11 k

Transaction Summary
===================================================================================================================================================
Install  1 Package

Total size: 11 k
Installed size: 3.7 k
Is this ok [y/N]: y

.........................
Dependencies resolved.
===================================================================================================================================================
 Package                                         Arch                         Version                     Repository                          Size
===================================================================================================================================================
Installing:
 rpmfusion-nonfree-release                       noarch                       8-0.1                       @commandline                        11 k

Transaction Summary
===================================================================================================================================================
Install  1 Package

Total size: 11 k
Installed size: 3.8 k
Is this ok [y/N]: y

Step 2: Install FFmpeg on CentOS 8 / RHEL 8 Linux

Once you’ve added EPEL and RPM Fusion repositories, run the following commands in your terminal to install FFmpeg on CentOS 8 / RHEL 8 Linux system.

sudo dnf -y install ffmpeg

A number of dependencies will be installed, verify and agree to installation.

....
Transaction Summary
======================================================================================================================================================================================================
Install  92 Packages

Total download size: 32 M
Installed size: 102 M
Is this ok [y/N]: y

Install development libraries by running the command\:

sudo dnf -y install ffmpeg-devel

Step 3: Check FFmpeg Version on CentOS / RHEL 8

Check the version of FFmpeg installed on your RHEL/CentOS system using the command.

$ rpm -qi ffmpeg
Name        : ffmpeg
Version     : 4.2.5
Release     : 2.el8
Architecture: x86_64
Install Date: Wed Apr  6 08:01:50 2022
Group       : Unspecified
Size        : 1932220
License     : GPLv2+
Signature   : RSA/SHA1, Fri Dec  3 17:39:21 2021, Key ID 979f0c69158b3811
Source RPM  : ffmpeg-4.2.5-2.el8.src.rpm
Build Date  : Wed Dec  1 16:57:45 2021
Build Host  : buildvm-07.virt.rpmfusion.net
Relocations : (not relocatable)
Packager    : RPM Fusion
Vendor      : RPM Fusion
URL         : http://ffmpeg.org/

Check that you can use ffmpeg command:

$ ffmpeg -version
ffmpeg version 4.2.5 Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 8 (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 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -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,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld ' --extra-cflags=' ' --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-nvenc --enable-openal --enable-opencl --enable-opengl --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librsvg --enable-libsrt --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-version3 --enable-vapoursynth --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzimg --enable-libzvbi --enable-avfilter --enable-avresample --enable-libmodplug --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-libmfx --enable-runtime-cpudetect
libavutil      56. 31.100 / 56. 31.100
libavcodec     58. 54.100 / 58. 54.100
libavformat    58. 29.100 / 58. 29.100
libavdevice    58.  8.100 / 58.  8.100
libavfilter     7. 57.100 /  7. 57.100
libavresample   4.  0.  0 /  4.  0.  0
libswscale      5.  5.100 /  5.  5.100
libswresample   3.  5.100 /  3.  5.100
libpostproc    55.  5.100 / 55.  5.100

Step 4: Using FFmpeg on CentOS / RHEL 8

The usage of ffmpeg depends on individual projects and desired output. Refer to the official FFmpeg documentation for an in-depth description of its features and examples.

Other example is Converting mp4/mkv/WebM to mp3 on Linux with FFmpeg

You can also get all command line options from:

$ ffmpeg --help

Thank you for using our guide to install FFmpeg on CentOS 8 / RHEL 8. Check other articles,

coffee

Gravatar Image
A systems engineer with excellent skills in systems administration, cloud computing, systems deployment, virtualization, containers, and a certified ethical hacker.