mp4 文件 dref 解析

Data ReferenceBox

Box Types: ‘dref’
Container: Data Information Box (‘dinf’)
Mandatory: Yes
Quantity: Exactly one

Box Types: ‘url ‘, ‘urn’
Container: Data Information Box (‘dref’)
Mandatory: Yes (at least one of ‘url ‘ or ‘urn ‘ shall be present)
Quantity: One or more
The data reference object contains a table of data references (normally URLs) that declare the location(s) of the media data used within the presentation. The data reference index in the sample description ties entries in this table to the samples in the track. A track may be split over several sources in this way.

If the flag is set indicating that the data is in the same file as this box, then no string (not even an empty one) shall be supplied in the entry field.

The entry_count in the DataReferenceBox shall be 1 or greater; each DataEntryBox within the DataReferenceBox shall be either a DataEntryUrnBox or a DataEntryUrlBox.

NOTE Though the count is 32 bits, the number of items is usually much fewer, and is restricted by the fact that the reference index in the sample table is only 16 bits

When a file that has data entries with the flag set indicating that the media data is in the same file, is split into segments for transport, the value of this flag does not change, as the file is (logically) reassembled after the transport operation.

aligned(8) class DataEntryUrlBox (bit(24) flags) extends FullBox(‘url ‘, version = 0, flags) {
string location;
}

aligned(8) class DataEntryUrnBox (bit(24) flags) extends FullBox(‘urn ‘, version = 0, flags) {
string name;
string location;
}

aligned(8) class DataReferenceBox
extends FullBox(‘dref’, version = 0, 0) {
unsigned int(32) entry_count;
for (i=1; i <= entry_count; i++) {
DataEntryBox(entry_version, entry_flags) data_entry;
}
}

000006b0: 00 00 00 24 64 69 6e 66 00 00 00 1c 64 72 65 66 …$dinf….dref
000006c0: 00 00 00 00 00 00 00 01 00 00 00 0c 75 72 6c 20 …………url
000006d0: 00 00 00 01 00 00 01 0b 73 74 62 6c 00 00 00 a7 ……..stbl….
000006e0: 73 74 73 64 00 00 00 00 00 00 00 01 00 00 00 97 stsd…………

size 00 00 00 1c

vesion 8 00

flags 24 00 00 00

entry_count 32 00 00 00 01

DataEntryUrlBox

000006c0: 00 00 00 00 00 00 00 01 00 00 00 0c 75 72 6c 20 …………url
000006d0: 00 00 00 01 00 00 01 0b 73 74 62 6c 00 00 00 a7 ……..stbl….

size 00 00 00 0c

type 75 72 6c 20 0x20==space

version 0 

flags 00 00 01

 

 

000008d0: 00 00 00 00 00 00 00 24 64 69 6e 66 00 00 00 1c …….$dinf….
000008e0: 64 72 65 66 00 00 00 00 00 00 00 01 00 00 00 0c dref…………
000008f0: 75 72 6c 20 00 00 00 01 00 00 00 a3 73 74 62 6c url ……..stbl

 

mp4 文件 dinf 解析

Data Information Box

Box Type:    ‘dinf’

Container:   Media Information Box (‘minf’) or Meta Box (‘meta’)

Mandatory: Yes (required within ‘minf’ box) and No (optional within ‘meta’ box) Quantity: Exactly one

The data information box contains objects that declare the location of the media information in a track.

aligned(8) class DataInformationBox extends Box(‘dinf’) {

}

 

000006b0: 00 00 00 24 64 69 6e 66 00 00 00 1c 64 72 65 66 …$dinf….dref
000006c0: 00 00 00 00 00 00 00 01 00 00 00 0c 75 72 6c 20 …………url
000006d0: 00 00 00 01 00 00 01 0b 73 74 62 6c 00 00 00 a7 ……..stbl….
000006e0: 73 74 73 64 00 00 00 00 00 00 00 01 00 00 00 97 stsd…………

size 00 00 00 24

000008d0: 00 00 00 00 00 00 00 24 64 69 6e 66 00 00 00 1c …….$dinf….
000008e0: 64 72 65 66 00 00 00 00 00 00 00 01 00 00 00 0c dref…………
000008f0: 75 72 6c 20 00 00 00 01 00 00 00 a3 73 74 62 6c url ……..stbl

 

mp4文件 minf 解析

Box Type: ‘minf’
Container: Media Box (‘mdia’) Mandatory: Yes
Quantity: Exactly one
This box contains all the objects that declare characteristic information of the media in the track.
aligned(8) class MediaInformationBox extends Box(‘minf’) {
}

00000690: 6c 65 72 00 00 00 01 4b 6d 69 6e 66 00 00 00 14 ler….Kminf….
000006a0: 76 6d 68 64 00 00 00 01 00 00 00 00 00 00 00 00 vmhd…………
000006b0: 00 00 00 24 64 69 6e 66 00 00 00 1c 64 72 65 66 …$dinf….dref
000006c0: 00 00 00 00 00 00 00 01 00 00 00 0c 75 72 6c 20 …………url
000006d0: 00 00 00 01 00 00 01 0b 73 74 62 6c 00 00 00 a7 ……..stbl….
000006e0: 73 74 73 64 00 00 00 00 00 00 00 01 00 00 00 97 stsd…………
000006f0: 61 76 63 31 00 00 00 00 00 00 00 01 00 00 00 00 avc1…………
00000700: 00 00 00 00 00 00 00 00 00 00 00 00 00 0c 00 0c …………….
00000710: 00 48 00 00 00 48 00 00 00 00 00 00 00 01 00 00 .H…H……….
00000720: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …………….
00000730: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 18 …………….
00000740: ff ff 00 00 00 31 61 76 63 43 01 f4 00 0a ff e1 …..1avcC……
00000750: 00 19 67 f4 00 0a 91 9b 2b f2 cb 80 b6 40 00 00 ..g…..+….@..
00000760: 03 00 40 00 00 0c 83 c4 89 65 80 01 00 05 68 eb ..@……e….h.
00000770: e3 c4 48 00 00 00 10 70 61 73 70 00 00 00 01 00 ..H….pasp…..
00000780: 00 00 01 00 00 00 18 73 74 74 73 00 00 00 00 00 …….stts…..
00000790: 00 00 01 00 00 00 01 00 00 0e 10 00 00 00 1c 73 ……………s
000007a0: 74 73 63 00 00 00 00 00 00 00 01 00 00 00 01 00 tsc………….
000007b0: 00 00 01 00 00 00 01 00 00 00 14 73 74 73 7a 00 ………..stsz.
000007c0: 00 00 00 00 00 02 f0 00 00 00 01 00 00 00 14 73 ……………s
000007d0: 74 63 6f 00 00 00 00 00 00 00 01 00 00 00 30 00 tco………..0.
000007e0: 00 01 bc 74 72 61 6b 00 00 00 5c 74 6b 68 64 00 …trak…\tkhd.

size 00 00 01 4b 014b

type 6d 69 6e 66 minf

 

mp4 文件 hdlr 解析

获取track的类型,video&audio&subtitle:

8.4.3 Handler Reference Box
8.4.3.1 Definition

Box Type: ‘hdlr’
Container: Media Box (‘mdia’) or Meta Box (‘meta’)
Mandatory: Yes
Quantity: Exactly one

This box within a Media Box declares media type of the track, and thus the process by which the media‐data in the track is presented. For example, a format for which the decoder delivers video would be stored in a video track, identified by being handled by a video handler. The documentation of the storage of a media format identifies the media type which that format uses.This box when present within a Meta Box, declares the structure or format of the ‘meta’ box contents. There is a general handler for metadata streams of any type; the specific format is identified by the sample entry, as for video or audio, for example.

4.2 Object Structure
aligned(8) class Box (unsigned int(32) boxtype,
optional unsigned int(8)[16] extended_type) {
unsigned int(32) size;
unsigned int(32) type = boxtype;
if (size==1) {
unsigned int(64) largesize;
} else if (size==0) {
// box extends to end of file
}
if (boxtype==‘uuid’) {
unsigned int(8)[16] usertype = extended_type;
}
}

aligned(8) class FullBox(unsigned int(32) boxtype, unsigned int(8) v, bit(24) f)
extends Box(boxtype) {
unsigned int(8) version = v;
bit(24) flags = f;
}

8.4.3.2 Syntax
aligned(8) class HandlerBox extends FullBox(‘hdlr’, version = 0, 0) {
unsigned int(32) pre_defined = 0;
unsigned int(32) handler_type;
const unsigned int(32)[3] reserved = 0;
string name;
}

00000660: 000e 1055 c400 0000 0000 2d68 646c 7200 …U……-hdlr.
00000670: 0000 0000 0000 0076 6964 6500 0000 0000 …….vide…..
00000680: 0000 0000 0000 0056 6964 656f 4861 6e64 …….VideoHand
00000690: 6c65 7200 0000 014b 6d69 6e66 0000 0014 ler….Kminf….

atom box 大小 0000002d=45

整个数据box的数据范围为9+16+16+3 = 45,上面数据加粗部分。

atom box 类型68 646c 72 = hdlr

version 00

flags 00 00 00

pre_defined 00 00 00 00

hander_type 76 69 64 65 vide

reserved 32*3 00000000 00000000 00000000

name 56 6964 656f 4861 6e64 6c65 72 VideoHandler

由上面的 hender_type 可以确定类型为为video。

下面是一个audio track的 hdlr box。

00000880: 0000 0000 00bb 8000 0006 0055 c400 0000 ………..U….
00000890: 0000 2d68 646c 7200 0000 0000 0000 0073 ..-hdlr……..s
000008a0: 6f75 6e00 0000 0000 0000 0000 0000 0053 oun…………S
000008b0: 6f75 6e64 4861 6e64 6c65 7200 0000 00df oundHandler…..

hdlr type 的定义14496-14扩展:
‘vide’ video track
‘soun’ sound track
‘subp’|’clcp’ subtile track
‘odsm’ ObjectDescriptorStream
‘c rsm’ ClockReferenceStream
‘sdsm’ SceneDescriptionStream
‘m7sm’ MPEG7Stream
‘ocsm’ ObjectContentinfoStream
‘ipsm’ IPMP Stream
‘mjsm’ MPEG-J Stream


 

 

 

 

MP4 文件 moov 解析

确定moov数据的位置及大小:

协议中对于moov的描述如下:

The metadata for a presentation is stored in the single Movie Box which occurs at the top‐level of a file.
Normally this box is close to the beginning or end of the file, though this is not required.

先在文件中找到moov (8.2.1 container for all the metadata)

00000540: 6a03 8000 0006 d46d 6f6f 7600 0000 6c6d j……moov…lm

从上面二进制文本中查找,000006d4是moov atom的大小,即8+1740=1748.

从文件地址看,moov开始地址为0x543,0x543+0x6d4 = 0xc17。

文件结尾大小正好为0xc17

00000c10: 2e32 392e 3130 30。

得出0x543->0xc17所有数据属于moov。


按照协议规范 moov中包含必选项如下:

moov * 8.2.1 container for all the metadata

mvhd * 8.2.2 movie header, overall declarations

trak * 8.3.1 container for an individual track or stream

tkhd * 8.3.2 track header, overall information about the track

mdia * 8.4 container for the media information in a track

mdhd * 8.4.2 media header, overall information about the media

hdlr * 8.4.3 handler, declares the media (handler) type

minf * 8.4.4 media information container

dinf * 8.7.1 data information box, container

dref * 8.7.2 data reference box, declares source(s) of media data in track

stbl * 8.5.1 sample table box, container for the time/space
map

stsd * 8.5.2 sample descriptions (codec types, initialization
etc.)

stts * 8.6.1.2 (decoding) time-to-sample

stsc * 8.7.4 sample-to-chunk, partial data-offset information

stco * 8.7.5 chunk offset, partial data-offset information


mp4 文件 mdhd 解析

Box Type:    ‘mdhd’

Container: Media Box (‘mdia’) Mandatory: Yes

Quantity: Exactly one

The media header declares overall information that is media‐independent, and relevant to characteristics of the media in a track.

aligned(8) class MediaHeaderBox extends FullBox(‘mdhd’, version, 0) { 
    if (version==1) { 
        unsigned int(64) creation_time; 
        unsigned int(64) modification_time; 
        unsigned int(32) timescale; 
        unsigned int(64) duration; 
    } else { // version==0 
        unsigned int(32) creation_time; 
        unsigned int(32) modification_time; 
        unsigned int(32) timescale; 
        unsigned int(32) duration; 
    } 
    bit(1) pad = 0; 
    unsigned int(5)[3] language; // ISO-639-2/T language code 
    unsigned int(16) pre_defined = 0; 
} 

version is an integer that specifies the version of this box (0 or 1)

creation_time is an integer that declares the creation time of the media in this track (in seconds since midnight, Jan. 1, 1904, in UTC time).

modification_time is an integer that declares the most recent time the media in this track was modified (in seconds since midnight, Jan. 1, 1904, in UTC time).

timescale is an integer that specifies the timescale for this media; this is the number of time units that pass in one second. For example, a time coordinate system that measures time in sixtieths of a second has a time scale of 60.

duration is an integer that declares the duration of this media (in the scale of the timescale). If the duration cannot be determined then duration is set to all 1s.

language declares the language code for this media. See ISO 639‐2/T for the set of three character codes. Each character is packed as the difference between its ASCII value and 0x60. Since the code is confined to being three lower‐case letters, these values are strictly positive.

ffffff_with_tow_audio.mp4.tar

00000640: 00 01 a0 6d 64 69 61 00 00 00 20 6d 64 68 64 00 …mdia… mdhd.
00000650: 00 00 00 00 00 00 00 00 00 00 00 00 01 5f 90 00 …………._..
00000660: 00 0e 10 55 c4 00 00 00 00 00 2d 68 64 6c 72 00 …U……-hdlr.
00000670: 00 00 00 00 00 00 00 76 69 64 65 00 00 00 00 00 …….vide…..
00000680: 00 00 00 00 00 00 00 56 69 64 65 6f 48 61 6e 64 …….VideoHand

size 00 00 00 20

type 6d 64 68 64

flags 00

version 00 00 00

createtime 32 00 00 00 00

modification_time 32 00 00 00 00

timescale 32 00 01 5f 90 == 90000

duration 32 00 00 0e 10 ==  3600

language 55 c4= 0 101 0101 1100 0100
每5位一个字符,一种3个字符,10101 01110 00100 == 0x15 0x0E 0x04  全部加0x60 == 0x75 0x6E 0x64 == und

00000860: 00 00 00 00 01 00 00 00 00 01 34 6d 64 69 61 00 ……….4mdia.
00000870: 00 00 20 6d 64 68 64 00 00 00 00 00 00 00 00 00 .. mdhd………
00000880: 00 00 00 00 00 bb 80 00 00 06 00 55 c4 00 00 00 ………..U….
00000890: 00 00 2d 68 64 6c 72 00 00 00 00 00 00 00 00 73 ..-hdlr……..s
000008a0: 6f 75 6e 00 00 00 00 00 00 00 00 00 00 00 00 53 oun…………S

mp4 文件 mdia 解析

Box Type:    ‘mdia’
Container: Track Box (‘trak’) Mandatory: Yes
Quantity:     Exactly one
The media declaration container contains all the objects that declare information about the media data within a track.

Syntax

aligned(8) class MediaBox extends Box(‘mdia’) {

}

00000630: 0000 0100 0000 2800 0000 0000 0100 0000 ……(………
00000640: 0001 a06d 6469 6100 0000 206d 6468 6400 …mdia… mdhd.
00000650: 0000 0000 0000 0000 0000 0000 015f 9000 …………._..
00000660: 000e 1055 c400 0000 0000 2d68 646c 7200 …U……-hdlr.

00000860: 0000 0000 0100 0000 0001 346d 6469 6100 ……….4mdia.
00000870: 0000 206d 6468 6400 0000 0000 0000 0000 .. mdhd………
00000880: 0000 0000 00bb 8000 0006 0055 c400 0000 ………..U….
00000890: 0000 2d68 646c 7200 0000 0000 0000 0073 ..-hdlr……..s

mp4 文件 tkhd 解析

协议描述如下:

8.3.2 Track Header Box
8.3.2.1 Definition
Box Type: ‘tkhd’
Container: Track Box (‘trak’)
Mandatory: Yes
Quantity: Exactly one
This box specifies the characteristics of a single track. Exactly one Track Header Box is contained in a track.

In the absence of an edit list, the presentation of a track starts at the beginning of the overall presentation. An empty edit is used to offset the start time of a track. The default value of the track header flags for media tracks is 7 (track_enabled, track_in_movie, track_in_preview). If in a presentation all tracks have neither track_in_movie nor track_in_preview set, then all tracks shall be treated as if both flags were set on all tracks. Server hint tracks should have the track_in_movie and track_in_preview set to 0, so that they are ignored for local playback and preview.

Under the ‘iso3’ brand or brands that share its requirements, the width and height in the track header are measured on a notional ‘square’ (uniform) grid. Track video data is normalized to these dimensions (logically) before any transformation or placement caused by a layup or composition system. Track (and movie) matrices, if used, also operate in this uniformly‐scaled space.

The duration field here does not include the duration of following movie fragments, if any, but only of the media in the enclosing Movie Box. The Movie Extends Header box may be used to document the duration including movie fragments, when desired and possible.

version is an integer that specifies the version of this box (0 or 1 in this specification)

flags is a 24‐bit integer with flags; the following values are defined:

Track_enabled: Indicates that the track is enabled. Flag value is 0x000001. A disabled track (the low bit is zero) is treated as if it were not present.

Track_in_movie: Indicates that the track is used in the presentation. Flag value is 0x000002.

Track_in_preview: Indicates that the track is used when previewing the presentation. Flag value is 0x000004.

Track_size_is_aspect_ratio: Indicates that the width and height fields are not expressed in pixel units. The values have the same units but these units are not specified. The values are only an indication of the desired aspect ratio. If the aspect ratios of this track and other related tracks are not identical, then the respective positioning of the tracks is undefined, possibly defined by external contexts. Flag value is 0x000008.

creation_time is an integer that declares the creation time of this track (in seconds since midnight, Jan. 1, 1904, in UTC time).

modification_time is an integer that declares the most recent time the track was modified (in seconds since midnight, Jan. 1, 1904, in UTC time).

track_ID is an integer that uniquely identifies this track over the entire life‐time of this presentation. Track IDs are never re‐used and cannot be zero.

duration is an integer that indicates the duration of this track (in the timescale indicated in the Movie Header Box). The value of this field is equal to the sum of the durations of all of the track’s edits. If there is no edit list, then the duration is the sum of the sample durations, converted into the timescale in the Movie Header Box. If the duration of this track cannot be determined then duration is set to all 1s.

layer specifies the front‐to‐back ordering of video tracks; tracks with lower numbers are closer to the viewer. 0 is the normal value, and ‐1 would be in front of track 0, and so on.

alternate_group is an integer that specifies a group or collection of tracks. If this field is 0 there is no information on possible relations to other tracks. If this field is not 0, it should be the same for tracks that contain alternate data for one another and different for tracks belonging to different such groups. Only one track within an alternate group should be played or streamed at any one time, and must be distinguishable from other tracks in the group via attributes such as bitrate, codec, language, packet size etc. A group may have only one member.

volume is a fixed 8.8 value specifying the track’s relative audio volume. Full volume is 1.0 (0x0100) and is the normal value. Its value is irrelevant for a purely visual track. Tracks may be composed by combining them according to their volume, and then using the overall Movie Header Box volume setting; or more complex audio composition (e.g. MPEG‐4 BIFS) may be used.

matrix provides a transformation matrix for the video; (u,v,w) are restricted here to (0,0,1), hex (0,0,0×40000000).

width and  height fixed‐point 16.16 values are track‐dependent as follows:

For text and subtitle tracks, they may, depending on the coding format, describe the suggested size of the rendering area. For such tracks, the value 0x0 may also be used to indicate that the data may be rendered at any size, that no preferred size has been indicated and that the actual size may be determined by the external context or by reusing the width and height of another track. For those tracks, the flag track_size_is_aspect_ratio may also be used.

For non‐visual tracks (e.g. audio), they should be set to zero.

For all other tracks, they specify the track’s visual presentation size. These need not be the same as the pixel dimensions of the images, which is documented in the sample description(s); all images in the sequence are scaled to this size, before any overall transformation of the track represented by the matrix. The pixel dimensions of the images are the default values.

aligned(8) class TrackHeaderBox
extends FullBox(‘tkhd’, version, flags){
    if (version==1) {
        unsigned int(64) creation_time;
        unsigned int(64) modification_time;
        unsigned int(32) track_ID;
        const unsigned int(32) reserved = 0;
        unsigned int(64) duration;
    } else { // version==0
        unsigned int(32) creation_time;
        unsigned int(32) modification_time;
        unsigned int(32) track_ID;
        const unsigned int(32) reserved = 0;
        unsigned int(32) duration;
    }
    const unsigned int(32)[2] reserved = 0;
    template int(16) layer = 0;
    template int(16) alternate_group = 0;
    template int(16) volume = {if track_is_audio 0x0100 else 0};
    const unsigned int(16) reserved = 0;
    template int(32)[9] matrix=
    { 0x00010000,0,0,0,0x00010000,0,0,0,0x40000000 };
    // unity matrix
    unsigned int(32) width;
    unsigned int(32) height;
}

000005c0: 0000 5c74 6b68 6400 0000 0300 0000 0000 ..\tkhd………
000005d0: 0000 0000 0000 0100 0000 0000 0000 2800 …………..(.
000005e0: 0000 0000 0000 0000 0000 0000 0000 0000 …………….
000005f0: 0100 0000 0000 0000 0000 0000 0000 0000 …………….
00000600: 0100 0000 0000 0000 0000 0000 0000 0040 ……………@
00000610: 0000 0000 0c00 0000 0c00 0000 0000 2465 …………..$e

000007e0: 0001 bc74 7261 6b00 0000 5c74 6b68 6400 …trak…\tkhd.
000007f0: 0000 0300 0000 0000 0000 0000 0000 0200 …………….
00000800: 0000 0000 0000 2000 0000 0000 0000 0000 …… ………
00000810: 0000 0101 0000 0000 0100 0000 0000 0000 …………….
00000820: 0000 0000 0000 0000 0100 0000 0000 0000 …………….
00000830: 0000 0000 0000 0040 0000 0000 0000 0000 …….@……..
00000840: 0000 0000 0000 2465 6474 7300 0000 1c65 ……$edts….e

 

size == 5c = 92

74 6b 68 64 tkhd

version 00

flags 00 00 03

creation_time 32 00 00 00 00 

modification_time 00 00 00 00

track id = 00 00 00 01 == 1

reserved 32 00 00 00 00

duration 32 00 00 00 28 == 40ms

reserved 32 * 2  00 00 00 00 00 00 00 00

layer 16 00 00

alternate_group 16 00 00

volume 16 00 00 or

reverved 16 00

matrix 32*9 

width 00  0c 00 00>> 16

height 00  0c 00  00 >> 16

mp4 文件 各个box 名称及隶属关系表格

mp4 box name

ISO_IEC_14496-22_2015

取自上面协议 page 29 Table 1 — Box types, structure, and cross-reference (Informative)

Box types, structure, and cross-reference (Informative)
ftyp * 4.3 file type and compatibility
pdin 8.1.3 progressive download information
moov * 8.2.1 container for all the metadata
mvhd * 8.2.2 movie header, overall declarations
meta 8.11.1 metadata
trak * 8.3.1 container for an individual track or stream
tkhd * 8.3.2 track header, overall information about the track
tref 8.3.3 track reference container
trgr 8.3.4 track grouping indication
edts 8.6.4 edit list container
elst 8.6.6 an edit list
meta 8.11.1 metadata
mdia * 8.4 container for the media information in a track
mdhd * 8.4.2 media header, overall information about the media
hdlr * 8.4.3 handler, declares the media (handler) type
elng 8.4.6 extended language tag
minf * 8.4.4 media information container
vmhd 12.1.2 video media header, overall information (video track only)
smhd 12.2.2 sound media header, overall information (sound track only)
hmhd 12.4.2 hint media header, overall information (hint track only)
sthd 12.6.2 subtitle media header, overall information (subtitle track only)
nmhd 8.4.5.2 Null media header, overall information  (some tracks only)
dinf * 8.7.1 data information box, container
dref * 8.7.2 data reference box, declares source(s) of media data in track
stbl * 8.5.1 sample table box, container for the  time/space map
stsd * 8.5.2 sample descriptions (codec types, initialization etc.)
stts * 8.6.1.2 (decoding) time-to-sample
ctts 8.6.1.3 (composition) time to sample
cslg 8.6.1.4 composition to decode timeline mapping
stsc * 8.7.4 sample-to-chunk, partial data-offset information
stsz 8.7.3.2 sample sizes (framing)
stz2 8.7.3.3 compact sample sizes (framing)
stco * 8.7.5 chunk offset, partial data-offset information
co64 8.7.5 64-bit chunk offset
stss 8.6.2 sync sample table
stsh 8.6.3 shadow sync sample table
padb 8.7.6 sample padding bits
stdp 8.7.6 sample degradation priority
sdtp 8.6.4 independent and disposable samples
sbgp 8.9.2 sample-to-group
sgpd 8.9.3 sample group description
subs 8.7.7 sub-sample information
saiz 8.7.8 sample auxiliary information sizes
saio 8.7.9 sample auxiliary information offsets
udta 8.10.1 user-data
mvex 8.8.1 movie extends box
mehd 8.8.2 movie extends header box
trex * 8.8.3 track extends defaults
leva 8.8.13 level assignment
moof 8.8.4 movie fragment
mfhd * 8.8.5 movie fragment header
meta 8.11.1 metadata
traf 8.8.6 track fragment
tfhd * 8.8.7 track fragment header
trun 8.8.8 track fragment run
sbgp 8.9.2 sample-to-group
sgpd 8.9.3 sample group description
subs 8.7.7 sub-sample information
saiz 8.7.8 sample auxiliary information sizes
saio 8.7.9 sample auxiliary information offsets
tfdt 8.8.12 track fragment decode time
meta 8.11.1 metadata
mfra 8.8.9 movie fragment random access
tfra 8.8.10 track fragment random access
mfro * 8.8.11 movie fragment random access offset
mdat 8.2.2 media data container
free 8.1.2 free space
skip 8.1.2 free space
udta 8.10.1 user-data
cprt 8.10.2 copyright etc.
tsel 8.10.3 track selection box
strk 8.14.3 sub track box
stri 8.14.4 sub track information box
strd 8.14.5 sub track definition box
meta 8.11.1 metadata
hdlr * 8.4.3 handler, declares the metadata (handler) type
dinf 8.7.1 data information box, container
dref 8.7.2 data reference box, declares source(s) of metadata items
iloc 8.11.3 item location
ipro 8.11.5 item protection
sinf 8.12.1 protection scheme information box
frma 8.12.2 original format box
schm 8.12.5 scheme type box
schi 8.12.6 scheme information box
iinf 8.11.6 item information
xml 8.11.2 XML container
bxml 8.11.2 binary XML container
pitm 8.11.4 primary item reference
fiin 8.13.2 file delivery item information
paen 8.13.2 partition entry
fire 8.13.7 file reservoir
fpar 8.13.3 file partition
fecr 8.13.4 FEC reservoir
segr 8.13.5 file delivery session group
gitn 8.13.6 group id to name
idat 8.11.11 item data
iref 8.11.12 item reference
meco 8.11.7 additional metadata container
mere 8.11.8 metabox relation
meta 8.11.1 metadata
styp 8.16.2 segment type
sidx 8.16.3 segment index
ssix 8.16.4 subsegment index
prft 8.16.5 producer reference time

mp4 文件 trak 解析

8.3 Track Structure
8.3.1 Track Box
8.3.1.1 Definition

Box Type: ‘trak’
Container: Movie Box (‘moov’)
Mandatory: Yes
Quantity: One or more
This is a container box for a single track of a presentation. A presentation consists of one or more tracks. Each track is independent of the other tracks in the presentation and carries its own temporal and spatial information. Each track will contain its associated Media Box. Tracks are used for two purposes: (a) to contain media data (media tracks) and (b) to contain packetization information for streaming protocols (hint tracks). There shall be at least one media track within an ISO file, and all the media tracks that contributed to the hint tracks shall remain in the file, even if the media data within them is not referenced by the hint tracks; after deleting all hint tracks, the entire un‐hinted presentation shall remain.

8.3.1.2 Syntax
aligned(8) class TrackBox extends Box(‘trak’) {
}

000005b0: 0000 0000 0000 0400 0002 2874 7261 6b00 ……….(trak.
000005c0: 0000 5c74 6b68 6400 0000 0300 0000 0000 ..\tkhd………

size 00 00 02 28 == 552

type 74 7261 6b trak