gamut-isobmff
gamut-isobmff writes the ISO Base Media File Format (ISOBMFF) box structure that the AVIF — and
later HEIC — containers are built from.
Goals
Part of the gamut workspace, this crate exists to:
- Own the container, not the codec. It serializes the ISOBMFF box tree (
ftyp,meta,mdat, …) and leaves the coded bitstream to the codec crates, so AVIF and HEIC share one container implementation. - Emit the minimal valid box set. M0 writes exactly the boxes a single still-image item needs
(AVIF v1.2.0 §9.1.1):
ftyp, then ametabox holdinghdlr/pitm/iloc/iinf(infe)/iprp(ipco+ipma), followed by anmdatcarrying the AV1 temporal unit — see [write_avif_still]. - Stay spec-faithful and cross-checked. Box byte layouts follow ISO/IEC 14496-12 (ISOBMFF) and
ISO/IEC 23008-12 (HEIF) — paywalled and not in
../../references/— verified against the public AVIF v1.2.0 box table and libavif/ffmpeg output, and validated withavifdec. - Stay memory-safe.
#![forbid(unsafe_code)].
Usage
use ;
// `item_data` is the AV1 temporal unit produced by `gamut-av1`; `av1c`/`nclx` mirror the
// AV1 sequence header. `gamut-avif` wires these together for you end to end.
let img = AvifStillImage ;
let avif_bytes: = write_avif_still;
See gamut-avif for the full encode path that drives this crate.
Status
M0 writes the minimal box set for a single lossless AVIF still image. The richer item set — alpha
(auxl), grid, transform properties, and sequence tracks (moov/trak), plus HEIC hvc1
support — is deferred per gamut-avif/STATUS.md.
Roadmap
- Alpha auxiliary items, image transforms (
irot/imir/clap), and grids. - Sequence tracks for animated AVIF.
- HEIC/HEVC item support, shared with this crate.
License
Licensed under either of MIT or Apache-2.0 at your option.