What Language is the Core libavif Library Written In?

This article provides a direct answer regarding the primary programming language used to write the core libavif library. It explores why this language was chosen, how it affects the library’s performance, and how it allows libavif to be easily integrated into various operating systems and software ecosystems.

The Core Programming Language of libavif

The core libavif library is written in C. Specifically, it is implemented in portable C (conforming to the C99 standard), which allows it to be highly compatible with a wide range of compilers, operating systems, and hardware architectures.

libavif is the official reference library for encoding and decoding AV1 Image File Format (AVIF) files, developed and maintained by the Alliance for Open Media (AOMedia).

Why C Was Chosen for libavif

The choice of the C programming language for libavif provides several critical advantages for a foundational media library:

How libavif Interacts with Other Languages

While the core wrapper library that handles the AVIF container structure (muxing and demuxing) is written in C, it interacts closely with AV1 codecs that may be written in other languages. For example, libavif can interface with dav1d (written in C and Assembly) or rav1e (written in Rust) to handle the actual compression and decompression of the image frames.