Compile FFmpeg with libvvenc and libvvdec

This guide provides a straightforward, step-by-step walkthrough on how to compile FFmpeg from source with support for the experimental Versatile Video Coding (VVC) libraries, libvvenc (encoder) and libvvdec (decoder). You will learn how to install the required dependencies, build both Fraunhofer HHI VVC libraries, and configure FFmpeg to recognize them.

Step 1: Install Prerequisites

Before starting, ensure your system has the necessary build tools and libraries installed. On Debian/Ubuntu-based systems, run:

sudo apt update
sudo apt install -y build-essential git cmake pkg-config yasm nasm

Step 2: Build and Install libvvenc

The libvvenc library is the 8K-ready VVC encoder developed by Fraunhofer HHI.

  1. Clone the repository:

    git clone https://github.com/fraunhoferhhi/vvenc.git
    cd vvenc
  2. Create a build directory and compile the library:

    mkdir build && cd build
    cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local ..
    make -j$(nproc)
  3. Install the library to your system:

    sudo make install
    cd ../..

Step 3: Build and Install libvvdec

The libvvdec library is the corresponding VVC decoder.

  1. Clone the repository:

    git clone https://github.com/fraunhoferhhi/vvdec.git
    cd vvdec
  2. Create a build directory and compile the library:

    mkdir build && cd build
    cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local ..
    make -j$(nproc)
  3. Install the library to your system:

    sudo make install
    cd ../..

Step 4: Configure Environment Variables

To ensure FFmpeg can locate the newly installed libraries during its configuration phase, update your PKG_CONFIG_PATH and system library cache:

export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig:$PKG_CONFIG_PATH
sudo ldconfig

Step 5: Compile FFmpeg with VVC Support

Now, download the latest FFmpeg source code and configure it with the libvvenc and libvvdec flags enabled.

  1. Clone the FFmpeg repository:

    git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg
    cd ffmpeg
  2. Configure the build. You must include --enable-libvvenc and --enable-libvvdec. Because these libraries are experimental and require specific licensing, you also need to enable non-free/GPL flags:

    ./configure \
      --enable-gpl \
      --enable-nonfree \
      --enable-libvvenc \
      --enable-libvvdec
  3. Compile and install FFmpeg:

    make -j$(nproc)
    sudo make install

Step 6: Verify the Installation

Once the compilation is complete, verify that FFmpeg has been successfully built with VVC support by querying the available decoders and encoders:

ffmpeg -decoders | grep vvdec
ffmpeg -encoders | grep vvenc

If successful, you will see libvvdec listed as a VVC decoder and libvvenc listed as a VVC encoder.