#avif #av1 #heif #image-encoding #mux #serialization #bmff

avif-serialize

Minimal writer for AVIF header structure (MPEG/HEIF/MIAF/ISO-BMFF)

6 releases

0.8.3 Feb 24, 2025
0.8.2 Oct 16, 2024
0.8.1 Dec 6, 2022
0.7.7 Nov 27, 2022
0.6.4 Aug 29, 2020

#621 in Images

Download history 82812/week @ 2024-12-01 86357/week @ 2024-12-08 83196/week @ 2024-12-15 53621/week @ 2024-12-22 56396/week @ 2024-12-29 87926/week @ 2025-01-05 111910/week @ 2025-01-12 91261/week @ 2025-01-19 97639/week @ 2025-01-26 106406/week @ 2025-02-02 112268/week @ 2025-02-09 115005/week @ 2025-02-16 135618/week @ 2025-02-23 130647/week @ 2025-03-02 129701/week @ 2025-03-09 117157/week @ 2025-03-16

525,458 downloads per month
Used in 81 crates (via ravif)

BSD-3-Clause

42KB
975 lines

AVIF image serializer (muxer)

Minimal writer for AVIF header structure. This is lean, safe-Rust alternative to libavif. It creates the jungle of MPEG/HEIF/MIAF/ISO-BMFF "boxes" as appropriate for AVIF files. Supports alpha channel embedding.

Compatible with decoders in Chrome 85+, libavif v0.8.1, and Firefox 92. It's used in cavif and other encoders.

Together with rav1e, it allows pure-Rust AVIF image encoding.

Requirements

Usage

  1. Compress pixels using an AV1 encoder, such as rav1e. libaom works too.

  2. Call avif_serialize::serialize_to_vec(av1_data, None, width, height, 8)

See ravif crate sources for example usage.


lib.rs:

AVIF image serializer (muxer)

Usage

  1. Compress pixels using an AV1 encoder, such as rav1e. libaom works too.

  2. Call avif_serialize::serialize_to_vec(av1_data, None, width, height, 8)

See cavif for a complete implementation.

Dependencies

~68KB