Provides high level information about the AVIF container.

Clone this repo:


  1. 3becbea Fix get_item_features() recursivity in PHP impl by Yannis Guyon · 2 weeks ago main
  2. f509487 Fix $kAlphaStr in PHP libavifinfo implementation by Yannis Guyon · 3 months ago
  3. b496868 Fix bug where the gain map is not detected if iprp appears before iref. by Maryla · 7 months ago
  4. 5e8d92c Update avifinfo_test_12x34_gainmap_tmap.avif by Yannis Guyon · 8 months ago
  5. edbfd14 Add missing test file. by Maryla · 8 months ago


libavifinfo is a standalone library that can be used to extract the width, height, bit depth, number of channels and other metadata from an AVIF payload.

See avifinfo.h for details on the API and avifinfo.c for the implementation. See tests/ for API usage examples.


  1. How to use

    1. Build
    2. Test
  2. Development

    1. Coding style
    2. Submitting patches
  3. PHP implementation

  4. Bug reports

How to use

libavifinfo can be used when only a few AVIF features are needed and when linking to or including libavif is not an option. For decoding an image or extracting more features, please rely on libavif.

Note: AvifInfoGetFeatures() is designed to return the same avifImage field values as avifDecoderParse(). However libavifinfo is more permissive and may return features of images considered invalid by libavif.


avifinfo.c is written in C. To build from this directory:

mkdir build && \
cd build && \
cmake .. && \
cmake --build . --config Release


Tests are written in C++. GoogleTest is required.

mkdir build && \
cd build && \
cmake --build . --config Debug && \
ctest .


Coding style

Google C/C++ Style Guide is used in this project.

Submitting patches

If you would like to contribute to libavifinfo, please follow the steps for libaom at

PHP implementation

The PHP implementation of libavifinfo is a subset of the C API.

libavifinfo was implemented into php-src natively and is available through getimagesize() at head. If it is not available in the PHP release version you use, you can fallback to avifinfo.php instead.

See avifinfo_test.php for a usage example.

Bug reports

Bug reports can be filed in the Alliance for Open Media issue tracker.