Boxes/atoms format

Boxes/atoms format is our name for the metaformat used by JPEG 2000, QuickTime, and other formats. (We also call it Box file format, which is apparently the name used by JPEG XT.) It is a tagged, segmented, hierarchical format, similar to IFF and RIFF. In some descriptions of it, the primary data structure is called a box, and in others it's called an atom.

Format details
A file consists of a sequence of one or more boxes. Some boxes contain data, and some contain other boxes. The only way to tell which is which is to have knowledge of the specific application format.

A box begins with a header of either 8 or (rarely) 16 bytes. The first four bytes of the header are a field we'll call size32. The next four are the Box Type code, usually corresponding to four ASCII characters. Sometimes, the Box Type field is followed by an 8-byte size64 field. Following the header is the payload data.

The size fields use big-endian byte order. They include the size of the header. The size of a box's payload data is determined as follows:

Variations
Boxes/atoms format is independently defined by each specification that uses it. There are some slight differences in the various formulations of it. For example, for QuickTime, a size32 of 0 is only allowed for top-level boxes. For JPEG 2000, it is also allowed for a box whose parent has a size32 of 0.

Brands
Most (but not all) boxes/atoms-based formats use an " " box, and along with it a concept called "brands". A brand is a four-letter code representing a format or subformat. Each file has a major brand (or primary brand), and also a compatibility list of brands. A brand's presence in the compatibility list indicates that a decoder which supports that brand can usefully decode the file in some way, even if it doesn't fully support it. This can be useful, though it makes it more complicated to explain just exactly what format a given file is in.


 * List of registered brands

Brand cross-reference
This table lists some of the known brands. There are many more brands that are not listed here.

UUID boxes
Some formats support private extensions using box type " ". In a uuid box, the first 16 bytes of what would normally be the payload data are a UUID (arbitrary 16-byte identifier). The real payload data begins immediately after the UUID.

Some of the known UUIDs are listed below. They are not necessarily official in any sense, and they should not be assumed to be meaningful in every format.

Related formats
See also Category:Box file format.
 * ISO Base Media File Format
 * JPEG 2000
 * MP4
 * QuickTime