Installing FFmpeg
FFmpeg can be installed on most operating systems through package managers or by compiling from source.
Linux
Ubuntu/Debian
Install FFmpeg using the apt package manager:
Fedora/RHEL/CentOS
Install FFmpeg using the yum or dnf package manager:
Enable RPM Fusion repository (if needed)
sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
Compile from Source (Linux)
Install build dependencies
sudo apt install build-essential yasm pkg-config
Download FFmpeg source
git clone https://git.ffmpeg.org/ffmpeg.git
cd ffmpeg
(Optional) Merge source plugins
If you want to include source plugins:tools/merge-all-source-plugins
Configure build
Run ./configure --help to see all available options. Build FFmpeg
GNU Make 3.81 or later is required.
Non-system dependencies (e.g. libx264, libvpx) are disabled by default. Use configure flags to enable additional codec support.
macOS
Using Homebrew (Recommended)
Install Homebrew (if not installed)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
For additional codec support:
brew install ffmpeg --with-options
Compile from Source (macOS)
Install Xcode Command Line Tools
Download FFmpeg source
git clone https://git.ffmpeg.org/ffmpeg.git
cd ffmpeg
Configure and build
./configure
make
sudo make install
Windows
Download Pre-built Binaries (Recommended)
Download FFmpeg
Visit ffmpeg.org and download the Windows build from a trusted source like: Extract the archive
Extract the downloaded archive to a location like C:\ffmpeg
Add to PATH
Add the bin folder to your system PATH:
- Open System Properties > Environment Variables
- Edit the PATH variable
- Add
C:\ffmpeg\bin (or your installation path)
Compile from Source (Windows)
Compiling on Windows requires setting up a build environment:
Install MSYS2
Download and install MSYS2 Install build tools
pacman -S make gcc yasm pkg-config
Follow Linux compile steps
Use the same steps as Linux compilation above
Verify Installation
After installation, verify FFmpeg is working correctly:
You should see output showing the FFmpeg version, configuration, and library versions.
ffmpeg version 6.1 Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04)
configuration: --prefix=/usr --extra-version=0ubuntu1 ...
libavutil 58. 29.100 / 58. 29.100
libavcodec 60. 31.102 / 60. 31.102
libavformat 60. 16.100 / 60. 16.100
libavdevice 60. 3.100 / 60. 3.100
libavfilter 9. 12.100 / 9. 12.100
libswscale 7. 5.100 / 7. 5.100
libswresample 4. 12.100 / 4. 12.100
Build Options
When compiling from source, you can configure FFmpeg with various options:
Out-of-tree builds: You can build FFmpeg in a separate directory by using an absolute path when launching configure:/path/to/ffmpeg/configure
Package Maintainers: It is recommended to build FFmpeg twice:
- First with minimal external dependencies for core libraries
- Then with full dependencies (which may depend on 3rd party packages)
This avoids circular dependencies during build.
Next Steps
Quick Start Guide
Learn how to use FFmpeg with basic commands and examples