How to Compile FFmpeg with libopenmpt Support
Compiling FFmpeg with libopenmpt support allows you to
decode and process tracker music formats—such as MOD, S3M, XM, and
IT—using the highly accurate OpenMPT library. This guide provides a
direct, step-by-step walkthrough for downloading the necessary
dependencies, configuring the FFmpeg source code, and compiling the
binary on a Linux-based system.
Step 1: Install Required Dependencies
Before compiling, you must install the build tools and the
development headers for libopenmpt.
On Debian, Ubuntu, or Pop!_OS, run the following command in your terminal:
sudo apt update && sudo apt install -y \
build-essential \
git \
pkg-config \
yasm \
nasm \
libopenmpt-devOn Fedora or Red Hat enterprise systems:
sudo dnf groupinstall "Development Tools" && sudo dnf install -y \
git \
pkg-config \
yasm \
nasm \
libopenmpt-develStep 2: Clone the FFmpeg Source Code
Clone the official FFmpeg Git repository and navigate into the project directory:
git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg-source
cd ffmpeg-sourceStep 3: Configure the Build
To compile FFmpeg with libopenmpt, you must explicitly
enable the module using the --enable-libopenmpt flag during
configuration.
Run the configuration script:
./configure --enable-libopenmpt --enable-sharedNote: You can add other standard flags like
--prefix=/usr/local if you wish to define a custom
installation path, or --enable-gpl if you require other
GPL-licensed libraries.
Step 4: Compile and Install
Once configuration finishes without errors, compile the binaries using your available CPU cores to speed up the process:
make -j$(nproc)After the compilation completes successfully, install the newly built FFmpeg binaries onto your system:
sudo make installStep 5: Verify the Installation
To confirm that FFmpeg was compiled correctly and has active
libopenmpt support, check the installed version and search
for the OpenMPT decoder:
ffmpeg -decoders | grep openmptIf the installation was successful, the output will display the
libopenmpt decoder as available:
A... libopenmpt libopenmpt (codec none)