These boxes describe the movie and each track. All are full boxes; offsets are from the end of the version and flags. Where a field is 4 or 8 bytes, it depends on the version: 4 for version 0 and 8 for version 1. Layouts come from memory of ISO/IEC 14496-12, which was not available to read; the box structure page says more.
mvhd: movie header
| Size | Name | Meaning |
|---|---|---|
| 4 or 8 | creation_time | Seconds since 1904-01-01 UTC. |
| 4 or 8 | modification_time | As above. |
| 4 | timescale | Units per second for the movie. |
| 4 or 8 | duration | In timescale units. |
| 4 | rate | 16.16 fixed point; usually 1.0. |
| 2 | volume | 8.8 fixed point; usually 1.0. |
| 2 | reserved | |
| 8 | reserved | |
| 36 | matrix | Video transformation matrix. |
| 24 | pre_defined | |
| 4 | next_track_ID | The next free track number. |
tkhd: track header
Flags: 000001 enabled, 000002 in the movie, 000004
in the preview, 000008 width and height are an aspect ratio.
| Size | Name | Meaning |
|---|---|---|
| 4 or 8 | creation_time | |
| 4 or 8 | modification_time | |
| 4 | track_ID | Non-zero and unique. |
| 4 | reserved | |
| 4 or 8 | duration | In movie timescale units. |
| 8 | reserved | |
| 2 | layer | Front-to-back order; lower is closer. |
| 2 | alternate_group | Tracks that are alternatives share a value. |
| 2 | volume | 8.8 fixed point, for audio. |
| 2 | reserved | |
| 36 | matrix | Video transformation matrix. |
| 4 | width | 16.16 fixed point. |
| 4 | height | 16.16 fixed point. |
mdhd: media header
| Size | Name | Meaning |
|---|---|---|
| 4 or 8 | creation_time | |
| 4 or 8 | modification_time | |
| 4 | timescale | Units per second for this track’s media. |
| 4 or 8 | duration | In media timescale units. |
| 2 | language | 1 pad bit, then three 5-bit letters, each minus 0x60: an ISO 639-2 code. |
| 2 | pre_defined |
hdlr: handler
| Size | Name | Meaning |
|---|---|---|
| 4 | pre_defined | Zero. |
| 4 | handler_type | A handler code: vide, soun, hint, meta and so on. |
| 12 | reserved | Zero. |
| varies | name | UTF-8, null-terminated. |
Media header boxes
| Box | Used for | Fields |
|---|---|---|
vmhd | Video | Flags 1. graphicsmode (2), opcolor (3 × 2). |
smhd | Sound | balance (2, 8.8 fixed point), reserved (2). |
hmhd | Hint | maxPDUsize (2), avgPDUsize (2), maxbitrate (4), avgbitrate (4), reserved (4). |
nmhd | Others, such as null handling | No fields beyond the full box. |
sthd | Subtitles | No fields beyond the full box. |
elst: edit list
Inside edts. An edit maps a span of the movie timeline to a span of media.
| Size | Name | Meaning |
|---|---|---|
| 4 | entry_count | |
| Each entry: | ||
| 4 or 8 | segment_duration | In movie timescale units. |
| 4 or 8 | media_time | Signed, in media units; −1 means an empty edit. |
| 2 | media_rate_integer | Usually 1. |
| 2 | media_rate_fraction | Zero. |
dref: data references
Inside dinf. It has a 4-byte entry_count, then that many
url or urn full boxes. Flag 000001 on an entry
means the data is in this same file, which is the usual case, and the entry then has no
further fields.