How to install FFmpeg on Rocky Linux 9

How to install FFmpeg on Rocky Linux 9

In this Linux tutorial, you will learn how to install FFmpeg on Rocky Linux 9 or other Red Hat based Linux distributions.


Table of Contents:


What is FFmpeg?:

FFmpeg is a powerful open-source software suite that allows users to record, convert, and stream audio and video files. It is a command-line tool that provides a vast range of functionalities for manipulating multimedia data.

Here are some key features of FFmpeg:

  • Format Conversion: FFmpeg supports a wide variety of multimedia formats, including video containers (such as MP4, AVI, and MKV) and audio formats (such as MP3, AAC, and FLAC). It allows you to convert files between different formats with various encoding options.
  • Transcoding: FFmpeg enables you to transcode multimedia files, meaning you can change the video and audio codecs, bitrate, frame rate, resolution, and other parameters to optimize the file for different devices or platforms.
  • Recording: FFmpeg can capture audio and video from various sources, including webcams, microphones, and desktop screens. It provides options to set the capture duration, input devices, and output formats.
  • Filtering and Effects: FFmpeg includes a powerful filtering system that allows you to apply various effects, transformations, and enhancements to multimedia streams. You can adjust brightness, contrast, and saturation, apply overlays, add subtitles, crop videos, and perform many other operations.
  • Streaming: FFmpeg supports streaming multimedia content over network protocols like HTTP, RTMP, and RTP. It can encode and transmit audio/video streams in real-time, making it useful for live streaming applications.
  • Cross-platform: FFmpeg is available for multiple operating systems, including Windows, macOS, Linux, and BSD. This makes it versatile and widely used across different platforms.

FFmpeg is highly flexible and extensively used by professionals and enthusiasts in multimedia processing, video editing, streaming services, and other applications that involve working with audio and video files.


Environment Specification:

We are using a minimal Rocky Linux 9 virtual machine with following specifications.

  • CPU - 3.4 Ghz (2 cores)
  • Memory - 2 GB
  • Storage - 20 GB
  • Operating System - Rocky Linux release 9.1 (Blue Onyx)
  • Hostname -
  • IP Address -


Prepare your Linux OS:

Login as root user on your Linux server with the help of a ssh client.

# dnf update -y

Sometimes, the above command also updates your Linux Kernel, therefore, you may need to restart your Linux OS with new Kernel.

# reboot

Note down the version of Linux OS and Linux Kernel.

# cat /etc/rocky-release
Rocky Linux release 9.1 (Blue Onyx)

# uname -r


Installing Third Party Yum Repositories:

FFmpeg software is available in RPM Fusion yum repository. Therefore, you need to install RPM Fusion repository first.

However, RPM Fusion repository requires some software packages from CodeReady Builder (CRB) yum repository.

CRB repository is formerly known as Power Tools Repo in previous versions of CentOS & Rocky Linux. But to install CRB repository you need to install Extra Packages for Enterprise Linux (EPEL) yum repository.

In short, you need to install EPEL, CRB and RPM Fusion repositories on your Linux server.

Execute following dnf command to install EPEL repo.

# dnf install -y epel-release

Now, enable CRB repo by executing following command at Linux terminal.

# /usr/bin/crb enable
Enabling CRB repo
CRB repo is enabled and named: crb

RPM Fusion consist for to separate yum repositories.

  1. free for Open Source Software (as defined by the Fedora Licensing Guidelines) which the Fedora project cannot ship due to other reasons
  2. nonfree for redistributable software that is not Open Source Software (as defined by the Fedora Licensing Guidelines); this includes software with publicly available source-code that has "no commercial use"-like restrictions

Execute following commands to install free and nonfree RPM Fusion repositories.

# dnf install -y --nogpgcheck$(rpm -E %rhel).noarch.rpm
# dnf install -y --nogpgcheck$(rpm -E %rhel).noarch.rpm

Build your cache for newly installed yum repositories.

# dnf makecache
Extra Packages for Enterprise Linux 9 - x86_64  7.5 kB/s | 7.4 kB     00:00
Rocky Linux 9 - BaseOS                          881  B/s | 4.1 kB     00:04
Rocky Linux 9 - AppStream                       857  B/s | 4.5 kB     00:05
Rocky Linux 9 - CRB                             1.6 kB/s | 4.1 kB     00:02
Rocky Linux 9 - Extras                          926  B/s | 2.9 kB     00:03
RPM Fusion for EL 9 - Free - Updates             44 kB/s | 245 kB     00:05
RPM Fusion for EL 9 - Nonfree - Updates          24 kB/s |  63 kB     00:02
Metadata cache created.


Installing FFmpeg:

All required yum repositories has been setup. Now, you can easily install FFmpeg software by executing following command at Linux terminal.

# dnf install -y ffmpeg ffmpeg-devel

Verifying installation of FFmpeg software by running ffmpeg command.

# ffmpeg -version
ffmpeg version 5.1.3 Copyright (c) 2000-2022 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 -march=x86-64-v2 -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 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 ' --extra-cflags=' -I/usr/include/rav1e' --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-version3 --enable-bzlib --enable-chromaprint --disable-crystalhd --enable-fontconfig --enable-frei0r --enable-gcrypt --enable-gnutls --enable-ladspa --enable-libaom --enable-libdav1d --enable-libass --enable-libbluray --enable-libbs2b --enable-libcdio --enable-libdrm --enable-libjack --enable-libjxl --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libilbc --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-librubberband --enable-libsmbclient --enable-version3 --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtesseract --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-version3 --enable-vapoursynth --enable-libvpx --enable-vulkan --enable-libshaderc --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libxml2 --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-avfilter --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      57. 28.100 / 57. 28.100
libavcodec     59. 37.100 / 59. 37.100
libavformat    59. 27.100 / 59. 27.100
libavdevice    59.  7.100 / 59.  7.100
libavfilter     8. 44.100 /  8. 44.100
libswscale      6.  7.100 /  6.  7.100
libswresample   4.  7.100 /  4.  7.100
libpostproc    56.  6.100 / 56.  6.100

FFmpeg software has been installed on your Linux OS.



In this Linux tutorial, you have learned how to install FFmpeg on Rocky Linux 9 or other Red Hat based Linux distributions. To learn about usage of FFmpeg software, we recommend that you should attend online training FFmpeg - The Complete GuideUdemy Course

Post a Comment

Previous Post Next Post