Everything in a QuickTime file is an atom: a size, a four-character type and the data. These pages follow Apple’s QuickTime File Format documentation. All numbers are big-endian unless a field says otherwise, and dates are seconds since midnight, 1 January 1904 (see Data types and codes).
Atom header
| Offset | Size | Type | Name | Meaning |
|---|---|---|---|---|
| 0 | 4 | uint32 | size | Total size of the atom in bytes, including this header and every atom inside it. Never less than 8, except for the two special values below. |
| 4 | 4 | FourCC | type | The atom type, usually four ASCII letters such as moov (0x6D6F6F76). Non-ASCII values such as 0x00000001 also occur. |
| 8 | 8 | uint64 | extended size | Present only when size is 1; the real size of the atom. |
size | Meaning |
|---|---|
| 0 | The atom runs to the end of the file. Allowed only for the last top-level atom. |
| 1 | A 64-bit extended size follows the type. Used for media data over 232 bytes. |
| 8 or more | The size itself. |
Many atoms continue with a one-byte version and three bytes of flags. Apple calls these full atoms (ISO calls them full boxes) and treats version and flags as the first data fields, not part of the header; both are 0 unless an atom says otherwise. Always check the version before reading the rest.
A container atom holds only other atoms; a leaf atom holds fields or tables. The meaning of an atom can depend on its parent, so a reader must track where it is in the tree. Apart from the few cases noted on these pages, child atoms may come in any order, and an unknown atom is skipped using its size. Apple reserves every four-character code made only of lower-case letters.
Example: 00 00 00 08 77 69 64 65 is an 8-byte wide atom, and
00 00 00 01 6D 64 61 74 00 00 00 01 2A 05 F2 00 is the header of an
mdat whose 64-bit size is 0x12A05F200 (5,000,000,000 bytes).
Top-level atoms
| Atom | Meaning |
|---|---|
ftyp | File type compatibility. Optional but recommended; when present it comes before every moov, mdat, pnot and free-space atom. Files written before 2004 have none. |
moov | The movie resource: tracks, timing and where the samples are. Required. See Movie atoms. |
mdat | Movie data: the media samples, read only through the sample tables. There may be none (samples in other files or streams) or several. |
free | Unused space. |
skip | Unused space. |
wide | Reserved space, exactly 8 bytes, placed just before an atom that may later need a 64-bit size. |
pnot | Reference to the movie’s preview image. |
The recommended order puts moov before mdat, so the movie can
start playing while it downloads. A reader should not decide an atom is missing until it
has parsed the whole file.
ftypbrandqtwide8 bytes of reserved spacemdatthe samplesmoovmovie:mvhd, onetrakper track,udta,meta
ftyp
| Offset | Size | Name | Meaning |
|---|---|---|---|
| 8 | 4 | major brand | The preferred brand: qt (two trailing spaces) for QuickTime movies. |
| 12 | 4 | minor version | For QuickTime, four binary-coded decimal bytes giving the century, year and month of the specification, then a zero: 20 04 06 00 is June 2004. |
| 16 | 4 × n | compatible brands | Every brand the file conforms to, to the end of the atom. The major brand must be among them. Zero entries are placeholders and are ignored. |
If no compatible brand is qt , the file is not a QuickTime movie:
QuickTime refuses to open it as one, even with a .mov name. The common case is
an MP4 file renamed to .mov. Other brands are listed on the MP4
Brands page.
00 00 00 14 66 74 79 70 71 74 20 20 00 00 00 00 71 74 20 20 ....ftypqt ....qt
free, skip and wide
free and skip hold bytes of free space after the header, which
readers ignore. wide is exactly 8 bytes, header only. If it sits immediately
before another atom, that atom can grow past 232 bytes by moving its header 8
bytes earlier over the wide atom, setting size to 1 and adding an
extended size, so no sample offsets change. The wide atom does not itself hold
the extended size.
mdat
The header (with an extended size when the data is over 232 bytes), then the
media data. Chunk offsets in the sample tables are offsets from the start of the file, not
from the start of mdat.
pnot
| Offset | Size | Name | Meaning |
|---|---|---|---|
| 8 | 4 | modification date | When the preview was last updated, in Macintosh date format. |
| 12 | 2 | version number | 0. |
| 14 | 4 | atom type | Type of the atom holding the preview data, usually PICT (a QuickDraw picture). |
| 18 | 2 | atom index | Which atom of that type to use; usually 1, the first. |
QT atoms and atom containers
Some atoms hold a second, richer structure: a QT atom container. It is found inside atoms
such as the track input map, media properties, effect samples and tween samples, never in
the movie’s own atom tree. A container starts with its own header, followed by exactly one
root QT atom (type sean, ID 1), which holds the others. An atom with children
holds no data, and the other way round.
| Offset | Size | Name | Meaning |
|---|---|---|---|
| 0 | 10 | reserved | 0. |
| 10 | 2 | lock count | 0. |
| Offset | Size | Name | Meaning |
|---|---|---|---|
| 0 | 4 | size | Size of this QT atom, including its header and all its children. |
| 4 | 4 | type | Atom type; sean for the root. |
| 8 | 4 | atom ID | Unique among siblings of the same type; 1 for the root. |
| 12 | 2 | reserved | 0. |
| 14 | 2 | child count | Number of immediate children; 0 means a leaf holding data. |
| 16 | 4 | reserved | 0. |
A QT atom is found by its offset, by parent, type and 1-based index, or by parent, type and ID. Leaf data is big-endian, though an application may store its own private data little-endian.