Compile FFmpeg with BM3D Denoiser Support
This article provides a straightforward, step-by-step guide on how to compile FFmpeg from source with support for the BM3D (Block-Matching and 3D filtering) denoiser. You will learn how to install the necessary build prerequisites, configure the FFmpeg codebase with the required GPL license flag, compile the binaries, and verify that the BM3D filter is active and ready for high-quality video denoising.
Step 1: Install Build Dependencies
Before compiling FFmpeg, you must install the essential build tools and libraries on your system. Open your terminal and run the following command (targeted for Ubuntu/Debian-based systems):
sudo apt update && sudo apt install -y \
build-essential \
git \
pkg-config \
yasm \
nasm \
libx264-dev \
libx265-dev \
libnuma-devStep 2: Clone the FFmpeg Source Code
Clone the official FFmpeg git repository to your local machine and navigate into the project directory:
git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg
cd ffmpegStep 3: Configure the Build with GPL Enabled
The BM3D filter in FFmpeg is licensed under the GNU General Public License (GPL). Therefore, you must explicitly enable GPL support during the configuration step, otherwise the BM3D filter will not be compiled.
Run the configure script with the following flags:
./configure --enable-gpl --enable-nonfree --enable-libx264 --enable-libx265If you require additional codecs or external libraries, you can append them to this command.
Step 4: Compile and Install FFmpeg
Once the configuration successfully finishes, compile the source code using all available CPU cores to speed up the process:
make -j$(nproc)After the compilation completes, install the newly built FFmpeg binaries onto your system:
sudo make installStep 5: Verify BM3D Filter Support
To ensure that the compilation was successful and the BM3D denoiser is available, query your installed FFmpeg version for the filter:
ffmpeg -filters | grep bm3dIf configured correctly, the terminal will output the details of the
bm3d filter, confirming it is ready for use in your video
processing workflows.