#avif #heif #av1 #mux #pixel #bmff

avif-serialize

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

8 releases

0.8.5 Jul 3, 2025
0.8.3 Feb 24, 2025
0.8.2 Oct 16, 2024
0.8.1 Dec 6, 2022
0.6.4 Aug 29, 2020

#710 in Images

Download history 135982/week @ 2025-03-24 132611/week @ 2025-03-31 142762/week @ 2025-04-07 124203/week @ 2025-04-14 131622/week @ 2025-04-21 148401/week @ 2025-04-28 205320/week @ 2025-05-05 213358/week @ 2025-05-12 220731/week @ 2025-05-19 202987/week @ 2025-05-26 209789/week @ 2025-06-02 197281/week @ 2025-06-09 209369/week @ 2025-06-16 266433/week @ 2025-06-23 203640/week @ 2025-06-30 267603/week @ 2025-07-07

962,933 downloads per month
Used in 103 crates (2 directly)

BSD-3-Clause

47KB
1K SLoC

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.

Dependencies

~68KB