What is FFmpeg?

FFmpeg is a powerful multimedia framework used to decode, encode, transcode, mux, demux, stream, filter, and play almost any type of multimedia content. It’s essential for developers and system administrators working on media projects.

This guide covers the installation of FFmpeg on AlmaLinux, CentOS, Debian, and Ubuntu, ensuring compatibility with the latest distributions.


Step-by-Step Installation for Each OS

1. Install FFmpeg on AlmaLinux (8 and 9)

  1. Enable EPEL Repository:
    sudo dnf install epel-release -y
  2. Enable RPM Fusion Repository:
    sudo dnf install https://download1.rpmfusion.org/free/el/rpmfusion-free-release-$(rpm -E %rhel).noarch.rpm -y
  3. Install FFmpeg:
    sudo dnf install ffmpeg ffmpeg-devel -y
  4. Verify Installation:
    ffmpeg -version

2. Install FFmpeg on CentOS (Stream 8 and 9)

  1. Enable EPEL and RPM Fusion Repositories:
    sudo dnf install epel-release -y
    sudo dnf install https://download1.rpmfusion.org/free/el/rpmfusion-free-release-$(rpm -E %rhel).noarch.rpm -y
  2. Install FFmpeg:
    sudo dnf install ffmpeg ffmpeg-devel -y
  3. Verify Installation:
    ffmpeg -version

3. Install FFmpeg on Ubuntu (22.04, 20.04, 18.04)

  1. Update System Packages:
    sudo apt update && sudo apt upgrade -y
  2. Install FFmpeg:
    sudo apt install ffmpeg -y
  3. Verify Installation:
    ffmpeg -version

4. Install FFmpeg on Debian (12/Bookworm, 11/Bullseye, 10/Buster)

  1. Update System Packages:
    sudo apt update && sudo apt upgrade -y
  2. Install FFmpeg:
    sudo apt install ffmpeg -y
  3. Verify Installation:
    ffmpeg -version

Common Post-Installation Steps

After installing FFmpeg, test its functionality by running the following commands:

  • Check Installed Codecs:
    ffmpeg -codecs
  • Convert a Video File:
    ffmpeg -i input.mp4 output.avi
  • Extract Audio from Video:
    ffmpeg -i input.mp4 -q:a 0 -map a output.mp3
  • Resize a Video:
    ffmpeg -i input.mp4 -vf scale=1280:720 output.mp4

Troubleshooting Tips

  1. Missing Dependencies: Ensure the repositories are enabled and your system is updated.
    sudo dnf update -y     # AlmaLinux/CentOS
    sudo apt update -y     # Debian/Ubuntu
  2. Library Errors: If you encounter issues with missing libraries, try reinstalling FFmpeg with the devel package:
    sudo dnf install ffmpeg ffmpeg-devel -y  # AlmaLinux/CentOS
    sudo apt install ffmpeg -y              # Debian/Ubuntu

Why Choose FFmpeg for Your Media Needs?

FFmpeg is a trusted tool in the multimedia world, offering unparalleled capabilities to handle video and audio files. By installing FFmpeg on your server, you gain access to a suite of tools to process media files efficiently.


Ready to optimize your multimedia projects? Follow this guide to install FFmpeg on your preferred OS, and start transforming your video and audio workflows today.