Why AVIF Primary Item Reference Prevents Video Playback
This article explains how the ISO Base Media File Format (ISOBMFF)
architecture distinguishes still image formats like AVIF from continuous
video files like AV1 MP4s. While both formats share the same container
structure and video compression codecs, the primary item reference
(pitm) box within the structural header signals to parsers
that the payload is a discrete, untimed image item rather than a
continuous video stream, effectively preventing media engines from
treating the file as playable video.
Tracks Versus Items in ISOBMFF
The fundamental architecture of ISOBMFF defines media data in two distinct ways: tracks and items.
- Tracks (
trakboxes inside amoovcontainer): Used for timed media such as video and audio. Tracks rely on sample tables (stbl) containing decoding timestamps, presentation timestamps, and synchronization sample markers that drive a continuous playback clock. - Items (defined within the
metacontainer): Used for untimed or non-continuous data, such as still images, metadata, and auxiliary data. Items do not rely on sample tables or playback clocks; instead, they are addressed directly by an identifier (item_ID) and resolved via an item location box (iloc).
Because AVIF relies on the AV1 video codec to encode pixel data, the encoded data resembles an intra-frame (keyframe) from a video stream. However, its structural encapsulation in the container dictates how a parser processes it.
The Role of the
Primary Item Reference (pitm)
The primary item reference is declared inside the pitm
box, which sits inside the top-level meta box. The
pitm structure contains a single 16-bit or 32-bit field:
the item_ID of the file's primary image.
When an ISOBMFF-compliant parser loads a media file, it reads the header boxes to determine the presentation pipeline:
- Identity Declaration: The parser inspects the
metabox and locates thepitmbox. - Target Isolation: The
pitmbox explicitly declares that the primary visual representation of the file is a specific item referenced in the item information box (iinf), not a sequence of samples in a media track. - Pipeline Routing: By resolving the target
item_ID, the parser directs the underlying AV1 decoder to treat the payload as a static, single-frame extraction rather than feeding frames sequentially into a display buffer synchronized with an audio or system clock.
Preventing Playback Loops and Video Execution
Video players rely on the presence of a playable track
(trak) configured with a visual media handler
(vide). In a compliant, single-image AVIF:
- The actual AV1 compressed bitstream is stored as an unsegmented item
in the media data box (
mdat), mapped via theilocbox rather than chunk offsets and sample sizes in a track. - No continuous playback clock, time-to-sample box
(
stts), or composition time offset box (ctts) is linked to the primary image item. - Without these timing tables, media frameworks (such as FFmpeg, AVFoundation, or web browser media engines) cannot construct a timeline, frame rate, or playback duration.
Even if an AVIF file contains image sequences (such as animated
AVIFs) or thumbnail tracks alongside the main image, the parser
evaluates pitm first to identify the definitive static
presentation. If a video player ignores the meta structure
and looks strictly for a moov box containing timed video
tracks, it will either find no tracks to initialize or fail to find the
presentation stream designated by pitm, halting video
playback execution before it starts.