Build Guide: FFmpeg with VMAF - dcomp-leris/CGSynth GitHub Wiki

Build Guide: FFmpeg with VMAF

VMAF is a perceptual video quality metric. Build and install libvmaf and FFmpeg with VMAF support.

Install build dependencies

sudo apt update
sudo apt install -y git build-essential pkg-config libtool \
    libssl-dev yasm cmake python3-venv meson ninja-build nasm \
    libass-dev libfreetype6-dev libtheora-dev libvorbis-dev \
    libx264-dev libx265-dev libnuma-dev

Build libvmaf

git clone https://github.com/Netflix/vmaf.git
cd vmaf
make
sudo make install
sudo ldconfig
cd ..

Build ffmpeg with VMAF

git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg
cd ffmpeg
./configure --enable-gpl --enable-libx264 --enable-libx265 --enable-libvmaf
make -j$(nproc)
sudo make install
cd ..

Verify

ffmpeg -filters | grep vmaf

You should see lines like:

.. libvmaf           VV->V      Calculate the VMAF between two video streams.
.. vmafmotion        V->V       Calculate the VMAF Motion score.

Example usage

ffmpeg -i reference.mp4 -i distorted.mp4 \
  -lavfi "[0:v][1:v]libvmaf=log_path=vmaf.json:log_fmt=json" \
  -f null -

Troubleshooting tips:

  • If nasm, meson, or ninja are missing, install them via apt.
  • Run sudo ldconfig after installing libvmaf.
  • Rebuild ffmpeg after installing libvmaf if it was built earlier.
⚠️ **GitHub.com Fallback** ⚠️