About this project
libavif is a portable C implementation of the AV1 Image File Format (AVIF), intended to be friendly to integrate into other projects. It supports encoding and decoding of all AV1-supported YUV formats and bit depths, including alpha. Alongside the library, it ships command line tools: avifenc for encoding and avifdec for decoding.
Basic command line usage:
avifenc -q 75 input.[jpg|png|y4m] output.avif
avifdec output.avif decoded.png
Run avifenc --help for the full option list. API usage examples live in the examples directory; enabling the CMake option AVIF_BUILD_EXAMPLES builds and runs them.
Installation is available through common package managers: vcpkg on Windows, Homebrew or MacPorts on macOS, apt on Debian-based Linux, yum on Red Hat-based Linux, and pacman in MSYS2 UCRT64. Official Windows binaries are published on the releases page. Tagged releases are recommended over the main branch.
Building requires CMake. Dependencies are controlled by CMake flags such as AVIF_CODEC_AOM and AVIF_LIBYUV, which accept OFF, SYSTEM, or LOCAL. No AV1 codecs are enabled by default; at least one must be selected, choosing among libaom (encoder and decoder), dav1d (decoder), libgav1 (decoder), rav1e (encoder), and SVT-AV1 (encoder). Libyuv is optional but strongly recommended for faster color space conversions and defaults to SYSTEM. Tests can be built with AVIF_BUILD_TESTS; GoogleTest-based tests require AVIF_GTEST, and fuzzing tests use fuzztest. Code coverage is available via AVIF_ENABLE_COVERAGE and the avif_coverage target with clang and LLVM installed. Example build command lines cover linking against installed dependencies and building everything from scratch.
The library is written in C99, with most tests in C++14. Formatting uses clang-format for sources and cmake-format for CMake files. The project is released under the BSD License.
Comments
0 people shared their preference · Deer Point appears after 10 participants
Sign in to join the discussion.