How AVIF Stores XMP Metadata with Image Data

The AV1 Image File Format (AVIF) leverages the flexible ISO Base Media File Format (ISOBMFF) architecture to store Extensible Metadata Platform (XMP) data alongside primary image bitstreams. Rather than embedding metadata directly into the AV1 video compression stream, the AVIF container isolates metadata into distinct structural items and establishes links between the metadata and the target image using standard container-level references. This architecture ensures that applications can access, parse, or discard descriptive metadata like copyright, licensing, and capture details without touching or decoding the underlying image data.

The Role of ISOBMFF Architecture

AVIF is not a standalone raw image format; it is an image profile built on top of the High Efficiency Image File Format (HEIF), which inherits its structure from ISOBMFF. In ISOBMFF, all data is organized into hierarchical blocks called "boxes" (or atoms).

Primary image content and metadata are treated as distinct entities called "items" within the top-level Meta Box (meta). This separation of concerns allows the container to handle multiple types of data—such as image grids, alpha channels, Exif blocks, and XMP packets—uniformly.

Identifying XMP Items in the Meta Box

To register an XMP payload inside the container, AVIF uses the Item Information Box (iinf), which contains individual Item Info Entry (infe) boxes for every item in the file.

  1. Item ID Assignment: The parser assigns a unique numeric item_ID to the primary image and a distinct item_ID to the XMP metadata block.
  2. Item Type Specification: For XMP, the infe box specifies an item_type set to mime.
  3. MIME Type String: The item entry defines the MIME content-type string as application/rdf+xml. This string explicitly signals to parsers that the item payload contains standard RDF/XML-encoded XMP data.

Linking Metadata to Image Data via References

Once the image and the XMP metadata are declared as separate items, the container must define how they relate to one another. This relationship is managed by the Item Reference Box (iref).

The iref box creates directed links between items using specific Four-Character Codes (FourCC). For XMP metadata:

In cases where an AVIF file contains an image sequence or multiple derived images (such as thumbnails or auxiliary depth maps), multiple cdsc links can be created, or links can be directed strictly to the primary image item to avoid redundant metadata duplication.

Physical Storage in the Media Data Box

While the meta box provides the index, identifiers, and relationship mappings, the actual raw XMP text is stored either directly within an Item Data Box (idat) inside the meta box or, more commonly, within the top-level Media Data Box (mdat).

The Item Location Box (iloc) acts as the bridge between the structural index and the physical bytes:

Performance and Parsing Advantages

Handling XMP in this manner provides major performance benefits: