Prerequisites to Build libavif from Source

Building libavif from source allows you to compile the latest version of the AVIF image format library with customized configurations. This article outlines the essential compiler tools, build systems, and codec dependencies required to successfully compile libavif on your operating system.

Core Build Tools and Compilers

To compile the libavif library, you need a standard C development environment and a build file generator.

AV1 Codec Libraries

libavif is a wrapper library; it requires at least one external AV1 encoder or decoder library to actually compress or decompress images. You must install or compile at least one of the following:

During the CMake configuration step, you will need to point libavif to the installation paths of these chosen codecs.

Optional Tool Dependencies

If you plan to build the bundled command-line tools—avifenc (encoder) and avifdec (decoder)—you will need additional libraries to handle input and output image formats: