#### Beyond Linux® From Scratch (System V Edition) - Version 12.3

### Chapter 10. Graphics and Font Libraries

- Prev

  Little CMS-2.17

- Next

  libexif-0.6.25

- Up
- Home

# libavif-1.2.0

## Introduction to libavif

The libavif package contains a library used for encoding and decoding AVIF files.

This package is known to build and work properly using an LFS 12.3 platform.

### Package Information

- Download (HTTP): https://github.com/AOMediaCodec/libavif/archive/v1.2.0/libavif-1.2.0.tar.gz

- Download MD5 sum: ec292cb8d51c0aa02f9fd5ef2419c853

- Download size: 13 MB

- Estimated disk space required: 22 MB

- Estimated build time: less than 0.1 SBU

### libavif Dependencies

#### Required

libaom-3.12.0

#### Recommended

gdk-pixbuf-2.42.12

#### Optional

gtest, libdav1d, libyuv, rav1e, and svt-av1

### Note

An Internet connection is needed for some tests of this package. The system certificate store may need to be set up with make-ca-1.15 before testing this package.

## Installation of libavif

Install libavif by running the following commands:

    mkdir build &&
    cd    build &&

    cmake -D CMAKE_INSTALL_PREFIX=/usr \
          -D CMAKE_BUILD_TYPE=Release  \
          -D AVIF_CODEC_AOM=SYSTEM     \
          -D AVIF_BUILD_GDK_PIXBUF=ON  \
          -D AVIF_LIBYUV=OFF           \
          -G Ninja .. &&
    ninja

To test the package (note that it will cause the building system to download a copy of gtest and build the test suite with the copy), issue:

    cmake .. -D AVIF_GTEST=LOCAL -D AVIF_BUILD_TESTS=ON &&
    ninja && ninja test

Now, as the `root` user:

    ninja install

The AV1 format needs to be added to the loaders cache. As the `root` user:

    gdk-pixbuf-query-loaders --update-cache

## Command Explanations

`-D AVIF_CODEC_AOM=SYSTEM`: This switch enables using the AOM codec. This package is useless without at least one codec built in.

`-D AVIF_BUILD_GDK_PIXBUF=ON`: This switch builds the AVIF loader for applications which use gdk-pixbuf. Remove it if you have not installed gdk-pixbuf-2.42.12.

`-D AVIF_LIBYUV=OFF`: Use this switch if you have not installed libyuv.

`-D AVIF_CODEC_DAV1D=SYSTEM`: Use this switch if you have installed libdav1d and wish to use it as a codec.

`-D AVIF_CODEC_RAV1E=SYSTEM`: Use this switch if you have installed rav1e and wish to use it as a codec.

`-D AVIF_CODEC_SVT=SYSTEM`: Use this switch if you have installed svt-av1 and wish to use it as a codec.

## Contents

Installed Programs: None
Installed Libraries: libavif.so and libpixbbufloader-avif.so (in /usr/lib/gdk-pixbuf-2.0/2.10.0/loaders)
Installed Directories: /usr/include/avif and /usr/lib/cmake/libavif

### Short Descriptions

`libavif.so` | contains functions that provide a portable C implementation of the AV1 Image Format
`libpixbufloader-avif.so` | allows applications which use gdk-pixbuf to read AVIF images

- Prev

  Little CMS-2.17

- Next

  libexif-0.6.25

- Up
- Home