Compile FFmpeg with SVT-HEVC Support
This guide provides a straightforward, step-by-step walkthrough on how to compile FFmpeg from source with enabled support for the SVT-HEVC (Scalable Video Technology for HEVC) encoder. By compiling FFmpeg with this library, you can leverage Intel’s highly optimized H.265/HEVC encoder for high-performance video compression on modern CPU architectures.
Step 1: Install Required Dependencies
Before starting, you must install the build tools, compilers, and libraries required to compile both SVT-HEVC and FFmpeg. Run the following command on Debian/Ubuntu-based systems:
sudo apt update
sudo apt install -y build-essential cmake git yasm nasm pkg-configStep 2: Build and Install SVT-HEVC
You need to compile and install the SVT-HEVC library first so that FFmpeg can link against it during its own compilation process.
Clone the official SVT-HEVC repository:
git clone https://github.com/OpenVisualCloud/SVT-HEVC.git cd SVT-HEVCCreate a build directory and compile the source:
mkdir build cd build cmake -DCMAKE_BUILD_TYPE=Release .. make -j$(nproc)Install the library to your system:
sudo make install sudo ldconfig
Step 3: Configure and Compile FFmpeg
Now, download the FFmpeg source code and configure it to enable the SVT-HEVC encoder.
Clone the FFmpeg repository:
cd ~/ git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg cd ffmpegConfigure the build. You must explicitly include the
--enable-libsvthevcflag. You also need--enable-gplas SVT-HEVC support requires GPL licensing terms within FFmpeg.Depending on where SVT-HEVC was installed, you may need to export the
PKG_CONFIG_PATHso the configure script can find the library:export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATHRun the configure script:
./configure --enable-gpl --enable-libsvthevc --enable-nonfreeCompile and install FFmpeg:
make -j$(nproc) sudo make install
Step 4: Verify the Installation
To verify that FFmpeg was compiled successfully and supports the SVT-HEVC encoder, run the following command:
ffmpeg -encoders | grep svtIf the installation was successful, the output will list the SVT-HEVC encoder:
V..... libsvt_hevc SVT-HEVC(Scalable Video Technology for HEVC) encoder (codec hevc)