Compile FFmpeg with libuavs3e and libuavs3d
This guide provides a step-by-step walkthrough on how to compile
FFmpeg from source with support for the libuavs3e (AVS3
video encoder) and libuavs3d (AVS3 video decoder)
libraries. By compiling these libraries and linking them to FFmpeg, you
will be able to encode and decode video files using the third-generation
Audio Video Coding Standard (AVS3) within your media workflows.
Prerequisites
Before beginning, ensure your system has the necessary build tools, CMake, and Git installed. On Debian/Ubuntu-based systems, you can install these dependencies by running:
sudo apt update
sudo apt install -y build-essential yasm nasm cmake git pkg-configStep 1: Build and Install libuavs3e (Encoder)
The libuavs3e library is the open-source AVS3 video
encoder. Follow these steps to clone, compile, and install it:
Clone the repository from GitHub:
git clone https://github.com/uavs3/uavs3e.git cd uavs3eCreate a build directory and navigate into it:
mkdir -p build/linux cd build/linuxConfigure the build with CMake, enabling shared libraries:
cmake ../.. -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ONCompile and install the library:
make -j$(nproc) sudo make install
Step 2: Build and Install libuavs3d (Decoder)
The libuavs3d library is the open-source AVS3 video
decoder. Follow these steps to clone, compile, and install it:
Clone the repository from GitHub:
git clone https://github.com/uavs3/uavs3d.git cd uavs3dCreate a build directory and navigate into it:
mkdir -p build/linux cd build/linuxConfigure the build with CMake, enabling shared libraries:
cmake ../.. -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ONCompile and install the library:
make -j$(nproc) sudo make install
Step 3: Configure and Compile FFmpeg
To compile FFmpeg with support for these libraries, you must point
the build system to the newly installed pkg-config files
and enable the corresponding configuration flags.
Update your environmental variables so the FFmpeg configuration script can locate the newly installed libraries:
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATHClone the official FFmpeg repository:
git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg cd ffmpegConfigure the FFmpeg build. You must include
--enable-gpl,--enable-libuavs3e, and--enable-libuavs3d:./configure \ --enable-gpl \ --enable-libuavs3e \ --enable-libuavs3d \ --extra-libs=-lpthread \ --extra-libs=-lmCompile FFmpeg using all available CPU cores:
make -j$(nproc)Install the compiled FFmpeg binaries to your system:
sudo make install sudo ldconfig
Step 4: Verify the Installation
To confirm that FFmpeg has been successfully compiled with AVS3 encoding and decoding support, run the following commands:
To verify the decoder (
libuavs3d):ffmpeg -decoders | grep uavs3Output should display:
V....D uavs3d libuavs3d AVS3 decoderTo verify the encoder (
libuavs3e):ffmpeg -encoders | grep uavs3Output should display:
V..... uavs3e libuavs3e AVS3 encoder