Each track’s codec is named by its sample entry in stsd (see the MP4
sample tables). TS 26.244 clause 6
defines the 3GPP-specific entries below; offsets count from the start of the entry, and all
numbers are big-endian.
Entries allowed in 3GP
| Code | Media | Codec | Defined in |
|---|---|---|---|
samr | Audio | AMR (narrowband) | TS 26.244 clause 6.5 |
sawb | Audio | AMR-WB (wideband) | TS 26.244 clause 6.5 |
sawp | Audio | AMR-WB+ | TS 26.244 clause 6.9 |
sevs | Audio | EVS | TS 26.244 clause 6.14 |
sivs | Audio | IVAS | TS 26.244 clause 6.15 |
mp4a | Audio | MPEG-4 audio (AAC) | ISO/IEC 14496-14 |
s263 | Video | H.263 | TS 26.244 clause 6.6 |
mp4v | Video | MPEG-4 Part 2 video | ISO/IEC 14496-14 |
avc1 and other AVC entries | Video | H.264 | ISO/IEC 14496-15 clause 5 |
hvc1, hev1 | Video | H.265 | ISO/IEC 14496-15 clause 8 |
tx3g | Text | 3GPP timed text | TS 26.245 (layout on the MOV subtitles page) |
| DIMS entry | Scene description | Dynamic and interactive multimedia scenes | TS 26.142 |
| hint entries | Hint | RTP and reception hint tracks | ISO/IEC 14496-12 |
3gvo | Timed metadata | Coordination of video orientation (CVO) | TS 26.244 clause 6.11 |
3glo | Timed metadata | Location | TS 26.244 clause 6.12 |
3gor | Timed metadata | Orientation | TS 26.244 clause 6.13 |
| quality metrics entry | Timed metadata | Quality metrics | TS 26.244 clause 16 |
encv, enca, enct | Encrypted | Protected video, audio, text | TS 26.244 clause 10.2 |
3GPP2 files (.3g2) also use sevc (EVRC), sqcp (13K
QCELP) and ssmv (SMV), registered by 3GPP2 with object type indications 0xA0,
0xE1 and 0xA1; their layouts are in 3GPP2’s specification and are not covered here.
samr and sawb
| Offset | Size | Name | Value |
|---|---|---|---|
| 0 | 4 | size | Size of the entry. |
| 4 | 4 | type | samr (AMR) or sawb (AMR-WB). |
| 8 | 6 | reserved | 0. |
| 14 | 2 | data reference index | 1-based index into dref. |
| 16 | 8 | reserved | 0. |
| 24 | 2 | reserved | 2 (the channel count position). |
| 26 | 2 | reserved | 16 (the sample size position). |
| 28 | 4 | reserved | 0. |
| 32 | 2 | time scale | Copied from the track’s mdhd: 8000 for AMR, 16000 for AMR-WB. |
| 34 | 2 | reserved | 0. |
| 36 | varies | damr | AMR specific box (below). |
The layout matches an ISO audio sample entry, with the sample rate’s integer part as a 16-bit time scale. The values 2 and 16 are fixed even for mono AMR.
damr
| Offset | Size | Name | Meaning |
|---|---|---|---|
| 8 | 4 | vendor | FourCC of the encoder’s maker; informative. |
| 12 | 1 | decoder version | The vendor’s decoder version that best decodes the stream, or 0; informative. |
| 13 | 2 | mode set | Bit mask of the codec modes that may occur: bit 0 is mode 0 up to bit 8 for mode 8, numbered by the frame type (FT) field. 0x81FF means every AMR mode and comfort noise; 0x83FF every AMR-WB mode and comfort noise. |
| 15 | 1 | mode change period | Mode changes only every N frames; 0 means no restriction. If N is less than frames per sample, frames per sample is a multiple k × N (k ≥ 2); if greater, N is a multiple of frames per sample; if equal, each sample has one mode. |
| 16 | 1 | frames per sample | 1 to 15 speech frames per sample (10 frames of 20 ms make a 200 ms sample). The last sample may hold fewer. |
damr is a plain box: there is no version or flags. For example, mode set
0x0195 (binary 0000 0001 1001 0101) allows modes 0, 2, 4, 7 and 8.
sawp and dawp
sawp (AMR-WB+) has the same 36-byte layout as samr, with the
sampling rate at offset 32, followed by a dawp box holding only a vendor
FourCC (4 bytes) and a decoder version (1 byte), both informative.
s263, d263 and bitr
| Offset | Size | Name | Value |
|---|---|---|---|
| 4 | 4 | type | s263. |
| 8 | 6 | reserved | 0. |
| 14 | 2 | data reference index | 1-based index into dref. |
| 16 | 16 | reserved | 0. |
| 32 | 2 | width | Maximum width in pixels. |
| 34 | 2 | height | Maximum height in pixels. |
| 36 | 4 | reserved | 0x00480000 (72 dpi horizontal). |
| 40 | 4 | reserved | 0x00480000 (72 dpi vertical). |
| 44 | 4 | reserved | 0. |
| 48 | 2 | reserved | 1 (frame count). |
| 50 | 32 | reserved | 0 (compressor name). |
| 82 | 2 | reserved | 24 (depth). |
| 84 | 2 | reserved | −1. |
| 86 | varies | d263 | H.263 specific box, in place of MP4’s esds. |
| Offset | Size | Name | Meaning (d263) |
|---|---|---|---|
| 8 | 4 | vendor | FourCC of the encoder’s maker; informative. |
| 12 | 1 | decoder version | Vendor decoder version, or 0; informative. |
| 13 | 1 | H263_Level | H.263 level, as in the video/H263-2000 media type (for example 10). |
| 14 | 1 | H263_Profile | H.263 profile (0 baseline, 3 and so on). |
| 15 | varies | bitr | Optional bit rate box. |
Baseline H.263 is level 10, profile 0. The optional bitr box holds an average
bit rate (uint32, bits per second, 0 for variable) and a maximum bit rate (uint32, over any
one second).
sevs and sivs
sevs (EVS) and sivs (IVAS) use the same 36-byte audio layout:
channel count at offset 24 (for IVAS, 2 for stereo or binaural and otherwise 0), 16 at
offset 26, and the time scale at offset 32: 8000, 16000, 32000 or 48000 for EVS, and 16000,
32000 or 48000 for IVAS, by the widest bandwidth coded; 48000 when unknown. sevs
has no child box. sivs is followed by two boxes:
| Box | Contents |
|---|---|
ivcf | IVAS coded format: the format category and its parameters (below). |
iver | IVAS version: 12 reserved bits, a 4-bit specification (0 unknown, 1 fixed-point per TS 26.251, 2 floating-point per TS 26.258), then major and minor version bytes. |
| Category | Format |
|---|---|
| 0 | Unknown |
| 1 | Mono using the EVS coding modes of IVAS |
| 2 | Stereo, including binaural |
| 3 | Scene-based audio (SBA) |
| 4 | Metadata-assisted spatial audio (MASA) |
| 5 | Object-based audio (ISM) |
| 6 | Multichannel audio (MC) |
| 7 | ISM combined with MASA (OMASA) |
| 8 | ISM combined with SBA (OSBA) |
The parameters are a binaural flag (stereo), a planar flag and an order of 1 to 3 (SBA),
1 to 4 objects (ISM), a CICP layout index of 6 (5.1), 12 (7.1), 14 (5.1.2), 16 (5.1.4) or 19
(7.1.4) (multichannel), and the number of MASA transport channels (0 for one, 1 for two).
The exact bit layout of the ivcf structure could not be confirmed from the
clause text read and is not given here.
3gvo, 3glo and 3gor
Timed metadata entries. All three have the 16-byte common header (reserved and data
reference index); 3gvo adds one byte, the granularity of the rotation: 2 for
CVO, 6 for high-granularity CVO, as defined in TS 26.114. 3glo (location) and
3gor (orientation) add nothing. The sample formats are in TS 26.244 clauses 14,
15 and 17 and are not covered here.
encv, enca and enct
An encrypted track replaces its sample entry type and appends a protection scheme
information box (sinf, from ISO/IEC 14496-12), which records the original
format:
| Entry | Original formats | Contents |
|---|---|---|
encv | s263, avc1 … | Every field and box of the visual entry, then sinf. |
enca | samr, sawb, sawp, mp4a … | Every field and box of the audio entry, then sinf. |
enct | tx3g … | Every field and box of the text entry, then sinf. |