FFmpeg Configure Flags for libvpx Support
To enable VP8 and VP9 video encoding and decoding in FFmpeg, you must
compile it from source with specific configuration flags. This article
provides the exact configure flags needed to enable libvpx
support, lists the necessary system dependencies, and provides a
practical compilation command.
The Essential Configure Flag
The primary flag required to enable VP8 and VP9 support in FFmpeg is:
--enable-libvpx
This flag instructs the FFmpeg build system to look for and link
against the external libvpx library during compilation.
Additional Recommended Flags
When configuring FFmpeg with external libraries, you typically include several helper flags to ensure a successful build:
--enable-gpl: Highly recommended, as many FFmpeg configurations and filters require GPL licensing.--enable-pkg-config: Enables the use ofpkg-configto automatically detect the compiler and linker flags forlibvpx.
Prerequisites
Before running the configure script, you must install the
libvpx development headers on your system.
- Ubuntu/Debian:
sudo apt install libvpx-dev pkg-config - CentOS/RHEL:
sudo dnf install libvpx-devel pkgconf-pkg-config - macOS (Homebrew):
brew install libvpx pkg-config
Example Configuration Command
Once the prerequisites are installed, navigate to your FFmpeg source directory and run the following configure command:
./configure \
--enable-gpl \
--enable-libvpx \
--enable-pkg-configAfter the configuration script completes without errors, compile and install FFmpeg by running:
make -j$(nproc)
sudo make installTo verify that libvpx was enabled successfully, run the
following command in your terminal:
ffmpeg -encoders | grep vpxYou should see both libvpx-vp8 and
libvpx-vp9 listed in the output, confirming they are ready
for use.