Provides high level information about the AVIF container.

Clone this repo:

Branches

  1. 96f34d9 Split Get() into Identity and Features by Yannis Guyon · 8 days ago main
  2. c39192c Remove unused num_read_bytes by Yannis Guyon · 8 days ago
  3. 808a236 Remove file_size overloads by Yannis Guyon · 8 days ago
  4. 6b8141e Streamed input API by Yannis Guyon · 11 days ago
  5. ca1fb3c Abort after reading 32 sub-items by Yannis Guyon · 14 days ago

AVIF-info

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

See avifinfo.h for details on the API and avifinfo.c for the implementation. See avifinfo_test.cc for usage examples.

Contents

  1. How to use

    1. Build
    2. Test
  2. Development

    1. Coding style
    2. Submitting patches
  3. 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.

AvifInfoFeatures features;
if (AvifInfoGet(bytes, number_of_available_bytes, &features) == kAvifInfoOk) {
  // Use 'features.width' etc.
}

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

Build

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

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

Test

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

mkdir build && \
cd build && \
cmake .. -DAVIFINFO_BUILD_TESTS=ON && \
cmake --build . --config Debug && \
ctest .

Development

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 https://aomedia.googlesource.com/aom/#submitting-patches.

Bug reports

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