mp4(H264容器)的详细文件格式分析

十六进制码流分析:

ftyp Box
00 00 00 1C:size ,28,表示此BOX有28个字节,表示长度的四个字节也计算在内。以下同
66 74 79 70:type,表示BOX TYPE,此处为ftyp
6D 70 34 32:可能是兼容的格式信息,/////mp42
00 00 00 00:可能是插入的空字节,/////也可能是version ,flags
6D 70 34 32:可能是兼容的格式信息,mp42///// major-brand
6D 70 34 31:可能是兼容的格式信息,mp41///// minor-version
69 73 6F 6D:isom, ftyp中的最后一个标识,compatible-brands[];// to end of the box

The brand ‘mp41’ is defined as identifying version 1 of this specification (ISO/IEC 14496-1:2001), and the brand ‘mp42’ identifies this version of the specification;at least one of these brands shall appear in the compatible-brands list in the file-type box, in all files conforming to this specification.

moov Box
00 03 B0 59:size of moov.241753个字节
6D 6F 6F 76:moov

mvhd Box
00 00 00 6C:size,mvhd Box的大小为108个字节
6D 76 68 64:mvhd
00 00 00 00:version,flags
BE EE 87 C5:creation-time创建文件的时间,是距离1904年1月1日0点的秒数
BE EE 87 C5:modifiation-time修改文件的时间,
00 01 5F 90:timescale时标,时间刻度的单位,为1/90 000秒
01 A8 61 B8:duration持续时间
00 01 00 00:rate播放描述的等级
01 00:volume播放时的音量
00 00:保留的16bits的0
00 00 00 00:保留的32bits的0
00 00 00 00: 保留的32bits的0
00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00
40 00 00 00:matrix给视频提供的转换矩阵
00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 0000 00 00 00 00 00 00 00:6个32bits的pre-defined 的0
00 01 00 CA:next-track-ID下一个轨迹ID

iods Box
00 00 00 21:size of iods,33个字节
69 6F 64 73:iods, Initial Object Descriptor
00 00 00 00:version,flags
10 13 00 4F:可能是OD, Object Descriptor
FF FF 0F FE:
FF 0E 04 00:
00 00 01 0E:
04 00 00 00:
02

udta Box
00 00 06 8F:size of udta ,1679
75 64 74 61:udta,


uuid Box
00 00 04 A9:size of uuid,1193
75 75 69 64:uuid
F7 8C AA 0C 36 BE 4C E9 88 D2 03 C2 56 DA BE B2:由于boxtype = uuid而定义的16个字节的usertype

EES-3-0-410
VE
AE
AudioEncoder-2-1-11
V bitRate=2000000bps
V keyFrame Period In Ms=10000
V number of Pass=2
V progressive Interlaced=0
V rateControlMode=cbr
V smoothVsSharp=0
V sourceNature=natural
V useBFrame =false.此处表明本码流没有使用B帧
V videoEncoderType=mpeg4
V advVideo EncoderType=mpeg4
V allowBitRateUnderflow=false
V change Rgb Yuv Conversion=false
V setCustomBitmapSize=false
V useCustomPixedAspectRatio=false
V useExpertFeaturesASP=false
V useMotionFiltering=false
V useVideoPacket=false
V vbvSizeInMs=1000
V burnLogo=false
V changeframerate=false
V useColorAdjustment=false
V useCropFilter=false
V useScaleFilter=false
V useSpatialFilter=false
V useTimecodes=false

A audioEncoderType=aac
A bitRate=64000bps
A useAutomaticBandwidth=true
A useMS=true
A balanceLeftRight=0
A volumeInDB=0
starttime=0
stoptime=9223372036854775807,
MTUSize=1448
exportType=mp4
hinted=true
progressiveDownload=true
allowDebugInformationInStream=true
avoidQuickTime6Warnings=false
forceETV15compatibility=false
forcePlayerCompatibility=false
multiThreadedOptimization=0
openAVIWith=DirectShow
previewOnOff=1
previewlayout=0
showEncodingStatistics=true
.......................


hnti Box
00 00 01 DE:size of hnti,478
68 6E 74 69:hnti

rtp Box
00 00 01 D6:size of rtp,470
72 74 70 20:rtp
73 64 70 20:sdp
a=mpeg4-iod:”data:application/mpeg4-iod;
base64

................................

trak Box
00 00 01 A4:size of trak,420
74 72 61 6B:trak

tkhd Box
00 00 00 5C:size of tkhd,92
74 6B 68 64:tkhd, track head box
00 00 00 01:00,version;00 00 01,track enable flags
BE EE 87 C5:creation-time创建文件的时间
BE EE 87 C5:modifiation-time修改文件的时间,两个时间应该相同
00 00 00 01:track-ID
00 00 00 00:保留的32bits的0
01 A8 5E 16:duration持续的时间
00 00 00 00 00 00 00 00:保留的2个32bits的0
00 00:layer 0
00 00:pre-defined 0
00 00:volume,as non audio,if audio ,0x0100
00 00:reserved 0
00 01 00 00 00 00 00 00
00 00 00 0000 00 00 0000 01 00 0000 00 00 00
00 00 00 0000 00 00 0040 00 00 00:matrix
00 00 00 00:width,if track_is_visual 0x01400000 else 0
00 00 00 00:height,if track_is_visual 0x00F00000 else 0


mdia Box
00 00 01 28:size of mdia,296
6D 64 69 61:mdia


mdhd Box
00 00 00 20:size of mdhd ,32
6D 64 68 64:mdhd
00 00 00 00:version
BE EE 87 C5:creation-time
BE EE 87 C5:modification-time
00 00 03 E8:timescale
00 04 B7 17:duration
0:pad
10101 01110 00100:3个5bits的language
00 00 :pre-defined 0



hdlr Box
00 00 00 21:size of hdlr,33
68 64 6C 72:hdlr
00 00 00 00:version
00 00 00 00:pre-defined 0
6F 64 73 6D:odsm,handler-type. ObjectDescriptorStream
00 00 00 00 00 00 00 00 00 00 00 00 :3个reserved
00:stringname

minfBox
00 00 00 DF:size of minf,223
6D 69 6E 66:minf

nmhd Box
00 00 00 0C:size of nmhd,12
6E 6D 68 64:nmhd
00 00 00 00:version

dinf Box
00 00 00 24:size of dinf,36
64 69 6E 66:dinf

dref Box
00 00 00 1C:size of dref,28
64 72 65 66:dref
00 00 00 00:version
00 00 00 01:entry-count

url Box
00 00 00 0C: size of url ,12
75 72 6C 20:url
00 00 00 01:location

stbl Box
00 00 00 A7:size of stbl,167
73 74 62 6C:stbl

stsd Box
00 00 00 43:size of stsd,67
73 74 73 64:stsd
00 00 00 00:version,flags
00 00 00 01:entry-count

mp4s Box
00 00 00 33:size of mp4s, 51
6D 70 34 73:mp4s
00 00 00 00:version
00 00 00 01:ES

esds Box
00 00 00 23:size of esds,35
65 73 64 73:esds
00 00 00 00:version
03 15 00 00:
00 04 0D 01:
05 00 00 C8:
00 00 00 00:
00 00 00 00:
06 01 02:

stts Box
00 00 00 18: size of stts,24
73 74 74 73:stts
00 00 00 00:version
00 00 00 01:entry-count
00 00 00 01:sample-count
00 04 B7 17:sample-delta

stsc Box
00 00 00 1C:size of stsc ,28
73 74 73 63:stsc
00 00 00 00:version
00 00 00 01:entry-count
00 00 00 01:first-chunk
00 00 00 01:samples-per-chunk
00 00 00 01:sample-description-index

stsz Box
00 00 00 14:size of stsz,20
73 74 73 7A:stsz
00 00 00 00:version
00 00 00 12:sample-size
00 00 00 01:sample-count

stco Box
00 00 00 14:size of stco,20
73 74 63 6F:stco
00 00 00 00:version
00 00 00 01:entry-count
00 03 B0 7D:chunk-offset

tref Box
00 00 00 18:size of tref,24
74 72 65 66:tref

mpod Box
00 00 00 10:size of mpod,16
6D 70 6F 64:mpod
00 00 00 C9:
00 00 00 65:

trak Box
00 00 0191: size of trak,401
74 72 61 6B:trak

tkhd Box
00 00 00 5C:size of tkhd,92
74 6B 68 64:tkhd
00 00 00 01:00,version;00 00 01,track enable flags
BE EE 87 C5:creation-time创建文件的时间
BE EE 87 C5:modifiation-time修改文件的时间,两个时间应该相同
00 00 00 02:track-ID
00 00 00 00:保留的32bits的0
01 A8 5E 16:duration持续的时间
00 00 00 00 00 00 00 00:保留的2个32bits的0
00 00:layer 0
00 00:pre-defined 0
00 00:volume,as non audio,if audio ,0x0100
00 00:reserved 0
00 01 00 00 00 00 00 00
00 00 00 0000 00 00 0000 01 00 0000 00 00 00
00 00 00 0000 00 00 0040 00 00 00:matrix
00 00 00 00:width,if track_is_visual 0x01400000 else 0
00 00 00 00:height,if track_is_visual 0x00F00000 else 0

mdia Box
00 00 01 2D:size of mdia,301
6D 64 69 61:mdia

mdhd Box
00 00 00 20:32
6D 64 68 64:mdhd
00 00 00 00 :version,flags
BE EE 87 C5: creation-time创建文件的时间
BE EE 87C5: modifiation-time修改文件的时间,两个时间应该相同
00 00 03 E8: timescale时标
00 04 B7 17: duration持续的时间
55 C4:pad, 3个5bits的language
00 00: pre-defined 0

hdlr Box
00 00 00 21:size of hdlr ,33
68 64 6C 72:hdlr
00 00 00 00:version
00 00 00 00:pre-defined 0
73 64 73 6D:sdsm,handler-type, SceneDescriptionStream
00 00 00 00 00 00 00 00 00 00 00 00 :3个reserved
00:stringname

minfBox
00 00 00 E4:size of minf,228
6D 69 6E 66:minf

nmhd Box
00 00 00 0C:size of nmhd,12
6E 6D 68 64:nmhd
00 00 00 00:version

dinf Box
00 00 00 24:size of dinf,36
64 69 6E 66:dinf

dref Box
00 00 00 1C:size of dref,28
64 72 65 66:dref
00 00 00 00:version
00 00 00 01:entry-count

url Box
00 00 00 0C: size of url ,12
75 72 6C 20:url
00 00 00 01:location

stbl Box
00 00 00 AC:size of stbl,172
73 74 62 6C:stbl

stsd Box
00 00 00 48:size of stsd,72
73 74 73 64:stsd
00 00 00 00:version,flags
00 00 00 01:entry-count

mp4s Box
00 00 00 38:size of mp4s, 56
6D 70 34 73:mp4s
00 00 00 00:version
00 00 00 01:ES

esds Box
00 00 00 28:size of esds,40
65 73 64 73:esds
00 00 00 00:version
03 1A 00 00:
00 04 12 02:
0D 00 00 20:
00 00 00 00:
00 00 00 00:
05 03 00 00:
40 06 01 02:

stts Box
00 00 00 18: size of stts,24
73 74 74 73:stts
00 00 00 00:version
00 00 00 01:entry-count
00 00 00 01:sample-count
00 04 B7 17:sample-delta

stsc Box
00 00 00 1C:size of stsc ,28
73 74 73 63:stsc
00 00 00 00:version
00 00 00 01:entry-count
00 00 00 01:first-chunk
00 00 00 01:samples-per-chunk
00 00 00 01:sample-description-index

stsz Box
00 00 00 14:size of stsz,20
73 74 73 7A:stsz
00 00 00 00:version
00 00 00 18:sample-size
00 00 00 01:sample-count

stco Box
00 00 00 14:size of stco,20
73 74 63 6F:stco
00 00 00 00:version
00 00 00 01:entry-count
00 03 B0 8F:chunk-offset


trak Box
00 01 71 55:size of trak,
74 72 61 6B:trak

tkhd Box
00 00 00 5C:size of tkhd,92
74 6B 68 64:tkhd, track head box
00 00 00 01:00,version;00 00 01,track enable flags
BE EE 87 C5:creation-time创建文件的时间
BE EE 87 C5:modifiation-time修改文件的时间,两个时间应该相同
00 00 00 C9:track-ID
00 00 00 00:保留的32bits的0
01 A8 61 B8:duration持续的时间
00 00 00 00 00 00 00 00:保留的2个32bits的0
00 00:layer 0
00 00:pre-defined 0
00 00:volume,as non audio,if audio ,0x0100
00 00:reserved 0
00 01 00 00 00 00 00 00
00 00 00 0000 00 00 0000 01 00 0000 00 00 00
00 00 00 0000 00 00 0040 00 00 00:matrix
02 D0 00 00:width,if track_is_visual 0x01400000 else 0
01 E0 00 00:height,if track_is_visual 0x00F00000 else 0

mdia Box
00 01 70 CD:size of mdia
6D 64 69 61:mdia


mdhd Box
00 00 00 20:size of mdhd ,32
6D 64 68 64:mdhd
00 00 00 00:version
BE EE 87 C5:creation-time
BE EE 87 C5:modification-time
00 01 5F 90:timescale
01 A8 61 B8:duration
0:pad
10101 01110 00100:3个5bits的language
00 00 :pre-defined 0

hdlr Box
00 00 00 21:size of hdlr,33
68 64 6C 72:hdlr
00 00 00 00:version
00 00 00 00:pre-defined 0
76 69 64 65:vide,handler-type,表示此trak为视频
00 00 00 00 00 00 00 00 00 00 00 00 :3个reserved
00:stringname


minfBox
00 01 70 84:size of minf,94340
6D 69 6E 66:minf

vmhd Box
00 00 00 14:size of nmhd
76 6D 68 64:nmhd
00 00 00 01:version,flags
00 00 00 00:
00 00 00 00:




dinf Box
00 00 00 24:size of dinf,36
64 69 6E 66:dinf

dref Box
00 00 00 1C:size of dref,28
64 72 65 66:dref
00 00 00 00:version
00 00 00 01:entry-count

url Box
00 00 00 0C: size of url ,12
75 72 6C 20:url
00 00 00 01:location

stbl Box
00 01 70 44:size of stbl
73 74 62 6C:stbl

stsd Box
00 00 00 AC:size of stsd,72
73 74 73 64:stsd
00 00 00 00:version,flags
00 00 00 01:entry-count

mp4v Box
00 00 00 9C:size of mp4v
6D 70 34 76:mp4v
00 00 00 00:version
00 00 00 01:ES
00 00 00 00 00 00 :
00 00 00 00 00 00 00 00 00 00 02 D0 01 E0 00 48
00 00 00 48 00 00 00 00 00 00 00 01 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 18 FF FF

esds Box
00 00 00 46:size of esds
65 73 64 73:esds
00 00 00 00:version
03 38 00 00:
00 04 30 20:
11 03 D0 90:
00 1E 84 80:
00 1E 84 80:
05 21 00 00:
01 B0 00 00:
00 01 B5 0E:
A0 20 20 2F:
00 00 01 00:
00 00 01 20:
00 C7 88 BA:
98 51 68 43:
C1 46 3F 06:
01 02 :

stts Box
00 00 E7 90: size of stts
73 74 74 73:stts
00 00 00 00:version
00 00 1C F0:entry-count
00 00 00 01:sample-count
00 00 0B BB:sample-delta
00 00 00 01
00 00 11 97
00 00 00 01
00 00 0B BB
00 00 00 01
00 00 11 9A
...........

stsc Box
00 00 0E 8C:size of stsc ,
73 74 73 63:stsc
00 00 00 00:version
00 00 01 35:entry-count

00 00 00 01:first-chunk
00 00 00 15:samples-per-chunk
00 00 00 01:sample-description-index

00 00 00 02
00 00 00 18
00 00 00 01

00 00 00 03
00 00 00 18
00 00 00 01

00 00 00 04
00 00 00 18
00 00 00 01
.............

stsz Box
00 00 73 D8size of stsz,20
73 74 73 7A:stsz
00 00 00 00:version
00 00 00 00:sample-size
00 00 1C F1:sample-count
00 00 86 24(从此开始,为当前chunk中每帧视频数据的字节大小,此大小与offset相对应,用offset找到偏移的绝对地址(指向mdat box中)后,从000001B6的第一个字节开始,加上对应的视频字节数,就是本帧的大小。一个视频chunk中首先是连续的视频帧,然后也包含其他数据,暂不清楚视频数据后面的数据类型)
00 00 08 F9
00 00 3B 04
00 00 1D F2
00 00 49 00
00 00 60 A6
00 00 2E 30
00 00 33 F9
00 00 22 19
00 00 15 DB
00 00 17 47
00 00 1D 16
00 00 3A 4A
00 00 1C 1B
00 00 2C EA
00 00 37 28
00 00 3D 70
00 00 36 0B
00 00 16 D0
00 00 39 0F
00 00 22 79
第一个chunk中所有的视频帧大小结束
下面为当前chunk中视频数据后面暂不清楚为什么数据类型的开始
00 00 15 DB
00 00 17 47
................



stco Box
00 00 04 E4:size of stco,20
73 74 63 6F:stco
00 00 00 00:version
00 00 01 35:entry-count
00 03 B0 A7:chunk-offset(帧数据偏移的绝对地址(指向mdat box中),此处为视频数据,一个chunk约包含1S的数据,但不固定)
00 07 F1 5D
00 0B 58 D7
00 0E 58 9D
00 11 A5 3E
00 15 11 0B
00 18 15 4E



stss Box
00 00 00 B8:size
73 74 73 73:stss
00 00 00 00:version,flags
00 00 00 2A:entry_count
00 00 00 01
00 00 00 12
00 00 00 38
00 00 01 63
00 00 02 8E
00 00 03 B9
00 00 04 E4
00 00 05 83
00 00 06 AE
00 00 07 26
00 00 07 47
00 00 07 68
00 00 08 67
00 00 08 73


...............

udta Box
00 00 00 24:
75 64 74 61:

uuid Box
00 00 00 1C:size of uuid
75 75 69 64:uuid
F7 8C AA 0C 36 BE 4C E9 87 D2 03 C2 56 DA BE B2:由于boxtype = uuid而定义的16个字节的usertype
与前面不同
00 01 19 9A

trak Box
00 01 72 D5
74 72 61 6B

tkhd Box
00 00 00 5C:size of tkhd,92
74 6B 68 64:tkhd, track head box
00 00 00 00:00,version;00 00 00,track enable flags
BE EE 87 C5:creation-time创建文件的时间
BE EE 87 C5:modifiation-time修改文件的时间,两个时间应该相同
00 01 00 C9:track-ID
00 00 00 00:保留的32bits的0
01 A8 61 B8:duration持续的时间
00 00 00 00 00 00 00 00:保留的2个32bits的0
00 00:layer 0
00 00:pre-defined 0
00 00:volume,as non audio,if audio ,0x0100
00 00:reserved 0
00 01 00 00 00 00 00 00
00 00 00 0000 00 00 0000 01 00 0000 00 00 00
00 00 00 0000 00 00 0040 00 00 00:matrix
00 00 00 00:width,if track_is_visual 0x01400000 else 0
00 00 00 00:height,if track_is_visual 0x00F00000 else 0

mdia Box
00 01 70 5D:size of mdia
6D 64 69 61:mdia


mdhd Box
00 00 00 20:size of mdhd ,32
6D 64 68 64:mdhd
00 00 00 00:version
BE EE 87 C5:creation-time
BE EE 87 C5:modification-time
00 01 5F 90:timescale
01 A8 61 B8:duration
0:pad
10101 01110 00100:3个5bits的language
00 00 :pre-defined 0


hdlr Box
00 00 00 21:size of hdlr,33
68 64 6C 72:hdlr
00 00 00 00:version
00 00 00 00:pre-defined 0
68 69 6E 74:hint,handler-type
00 00 00 00 00 00 00 00 00 00 00 00 :3个reserved
00:stringname

minfBox
00 01 70 14:size of minf
6D 69 6E 66:minf

hmhd Box
00 00 00 1C
68 6D 68 64
00 00 00 00
05 A8 05 3B
00 1E 84 80
00 18 70 4E
00 1E 84 80


dinf Box
00 00 00 24:size of dinf,36
64 69 6E 66:dinf

dref Box
00 00 00 1C:size of dref,28
64 72 65 66:dref
00 00 00 00:version
00 00 00 01:entry-count

url Box
00 00 00 0C: size of url ,12
75 72 6C 20:url
00 00 00 01:location

stbl Box
00 01 6F CC:size of stbl,
73 74 62 6C:stbl

stsd Box
00 00 00 34:size of stsd,
73 74 73 64:stsd
00 00 00 00:version,flags
00 00 00 01:entry-count


rtp
00 00 00 24
72 74 70 20:rtp
00 00 00 00
00 00 00 01
00 01 00 01
00 00 05 A8


tims
00 00 00 0C
74 69 6D 73
00 01 5F 90

stts
00 00 E7 90
73 74 74 73
00 00 00 00:version
00 00 1C F0:entry-count
00 00 00 01:sample-count
00 00 0B BB:sample-delta
00 00 00 01
00 00 11 97
00 00 00 01
00 00 0B BB
00 00 00 01
00 00 11 9A
..................

stsc
00 00 0E 8C
73 74 73 63
00 00 00 00:version
00 00 01 35:entry-count

00 00 00 01:first-chunk
00 00 00 18:samples-per-chunk
00 00 00 01:sample-description-index

00 00 00 02
00 00 00 18
00 00 00 01

00 00 00 03
00 00 00 18
00 00 00 01

..............




stsz Box
00 00 73 D8:size of stsz,20
73 74 73 7A:stsz
00 00 00 00:version
00 00 00 00:sample-size
00 00 1C F1:sample-count

..................

stco
00 00 04 E4
73 74 63 6F
00 00 00 00:version
00 00 01 35:entry-count
00 07 B1 24:chunk_offset
00 0B 20 81


..............

stss
00 00 00 B8
73 74 73 73
.............

tref
00 00 00 14
74 72 65 66

hint
00 00 00 0C
68 69 6E 74
00 00 00 C9

udta
00 00 02 00
75 64 74 61

hinf
00 00 00 E2
68 69 6E 66

trpy
00 00 00 10
74 72 70 79
00 00 00 00
03 B8 8E 51

nump
00 00 00 10
6E 75 6D 70
00 00 00 00
00 00 B6 0A

tpyl
00 00 00 10
74 70 79 6C
00 00 00 00
03 B0 05 D9

totl
00 00 00 0C
74 6F 74 6C
03 B8 8E 51

npck
00 00 00 0C
6E 70 63 6B
00 00 B6 0A

tpay
00 00 00 0C
74 70 61 79
03 B0 05 D9

dmed
00 00 00 10
64 6D 65 64
00 00 00 00
03 B0 05 B8

dimm
00 00 00 10
64 69 6D 6D
00 00 00 00
00 00 00 21

drep
00 00 00 10
64 72 65 70
00 00 00 00
00 00 00 00

tmin
00 00 00 0C
74 6D 69 6E
FF FF FC 18

tmax
00 00 00 0C
74 6D 61 78
00 00 00 00

pmax
00 00 00 0C
70 6D 61 78
00 00 05 A8

dmax
00 00 00 0C
64 6D 61 78
00 00 00 32

payt
00 00 00 26
70 61 79 74
00 00 00 60 19
a=rtpmap:96 MP4V-ES/90000
hnti
sdp m=video 0 RTP/AVP 96
b=AS:2048
a=rtpmap:96 MP4V-ES/90000
a=fmtp:96 profile-level-id=254;config=
a=cliprect:0,0,480,720
a=mpeg4-esid:201
a=x-envivio-verid:0001199A
a=control:trackID=65737

trak
00 00 AB 60
74 72 61 6B

tkhd Box
00 00 00 5C:size of tkhd,92
74 6B 68 64:tkhd
00 00 00 01:00,version;00 00 01,track enable flags
BE EE 87 C5:creation-time创建文件的时间
BE EE 87 C5:modifiation-time修改文件的时间,两个时间应该相同
00 00 00 65:track-ID
00 00 00 00:保留的32bits的0
01 A8 07 40:duration持续的时间
00 00 00 00 00 00 00 00:保留的2个32bits的0
00 00:layer 0
00 00:pre-defined 0
00 00:volume,as non audio,if audio ,0x0100
00 00:reserved 0
00 01 00 00 00 00 00 00
00 00 00 0000 00 00 0000 01 00 0000 00 00 00
00 00 00 0000 00 00 0040 00 00 00:matrix
00 00 00 00:width,if track_is_visual 0x01400000 else 0
00 00 00 00:height,if track_is_visual 0x00F00000 else 0

mdia Box
00 00 AA D8:size of mdia,301
6D 64 69 61:mdia

mdhd Box
00 00 00 20:32
6D 64 68 64:mdhd
00 00 00 00 :version,flags
BE EE 87 C5: creation-time创建文件的时间
BE EE 87C5: modifiation-time修改文件的时间,两个时间应该相同
00 00 7D 00: timescale时标
00 96 C4 00: duration持续的时间
55 C4:pad, 3个5bits的language
00 00: pre-defined 0

hdlr Box
00 00 00 21:size of hdlr ,33
68 64 6C 72:hdlr
00 00 00 00:version
00 00 00 00:pre-defined 0
73 6F 75 6E:soun,handler-type,表示此trak为音频
00 00 00 00 00 00 00 00 00 00 00 00 :3个reserved
00:stringname



minf Box
00 00 AA 8F:size of minf
6D 69 6E 66:minf

smhd Box
00 00 00 10:size of smhd
73 6D 68 64:smhd
00 00 00 00:version
00 00 :balance,
balance is a fixed-point 8.8 number that places mono audio tracks in a stereo space; 0 is center (the normal value); full left is -1.0 and full right is 1.0.
00 00:reserved

dinf Box
00 00 00 24:size of dinf
64 69 6E 66:dinf

dref Box
00 00 00 1C:size of dref,28
64 72 65 66:dref
00 00 00 00:version
00 00 00 01:entry-count


url Box
00 00 00 0C: size of url ,12
75 72 6C 20:url
00 00 00 01:location


stbl Box
00 00 AA 53:size of stbl
73 74 62 6C:stbl

stsd Box
00 00 00 5B:size of stsd
73 74 73 64:stsd
00 00 00 00:version,flags
00 00 00 01:entry-count


mp4a Box
00 00 00 4B:
6D 70 34 61:mp4a
00 00 00 00:version
00 00 00 01:ES
00 00 00 00
00 00 00 00
00 02 00 10
00 00 00 00
7D 00 00 00

esds box
00 00 00 27
65 73 64 73
00 00 00 00:version
03 19 00 00:
00 04 11 40:
15 00 06 00:
00 00 FA 00:
00 00 FA 00:
05 02 12 90:
06 01 02 :

stts
00 00 00 18
73 74 74 73:stts
00 00 00 00:version
00 00 00 01:entry-count
00 00 25 B1:sample-count
00 00 04 00:sample-delta

stsc Box
00 00 0E 38:size of stsc
73 74 73 63:stsc
00 00 00 00:version
00 00 01 2E:entry-count
00 00 00 01:first-chunk
00 00 00 20:samples-per-chunk
00 00 00 01:sample-description-index
00 00 00 02
00 00 00 20
00 00 00 01
00 00 00 03
00 00 00 20
00 00 00 01
00 00 00 04
00 00 00 20
00 00 00 01

..........................

stsz box
00 00 96 D8:size of stsz,
73 74 73 7A:stsz
00 00 00 00:version
00 00 00 00:sample-size
00 00 25 B1:sample-count

.................................

stco
00 00 04 C8
73 74 63 6F:stco
00 00 00 00:version
00 00 01 2E:entry-count
00 07 C9 54:chunk-offset
00 0B 32 0D
00 0E 32 9B
............................

udta box
00 00 00 24
75 64 74 61

uuid
00 00 00 1C
75 75 69 64
F7 8C AA 0C 36 BE 4C E9 87 D2 03 C2 56 DA BE
B2:由于boxtype = uuid而定义的16个字节的usertype
00 01 19 9A


trak
00 00 16 76
74 72 61 6B:trak

tkhd Box
00 00 00 5C:size of tkhd,92
74 6B 68 64:tkhd, track head box
00 00 00 00:00,version;00 00 00,track enable flags
BE EE 87 C5:creation-time创建文件的时间
BE EE 87 C5:modifiation-time修改文件的时间,两个时间应该相同
00 01 00 65:track-ID
00 00 00 00:保留的32bits的0
01 A8 07 40:duration持续的时间
00 00 00 00 00 00 00 00:保留的2个32bits的0
00 00:layer 0
00 00:pre-defined 0
00 00:volume,as non audio,if audio ,0x0100
00 00:reserved 0
00 01 00 00 00 00 00 00
00 00 00 0000 00 00 0000 01 00 0000 00 00 00
00 00 00 0000 00 00 0040 00 00 00:matrix
00 00 00 00:width,if track_is_visual 0x01400000 else 0
00 00 00 00:height,if track_is_visual 0x00F00000 else 0

mdia box
00 00 13 F9
6D 64 69 61

mdhd box
00 00 00 20
6D 64 68 64:mdhd
00 00 00 00
BE EE 87 C5
BE EE 87 C5
00 00 7D 00:timescale
00 96 C4 00:duration
55 C4=
0:pad
10101 01110 00100:3个5bits的language
00 00 :pre-defined 0


hdlr box
00 00 00 21:size of hdlr,33
68 64 6C 72:hdlr
00 00 00 00:version
00 00 00 00:pre-defined 0
68 69 6E 74:hint,handler-type
00 00 00 00 00 00 00 00 00 00 00 00 :3个reserved
00:stringname




minfBox
00 00 13 B0:size of minf
6D 69 6E 66:minf

hmhd box
00 00 00 1C
68 6D 68 64
00 00 00 00
05 A8 :maxPDU
01 0C :avgPDU
00 00 FA 00: maxbitrate
00 00 FA 00: avgbitrate
00 00 FA 00:此处应该为保留的0,有误?

dinf Box
00 00 00 24:size of dinf,36
64 69 6E 66:dinf

dref Box
00 00 00 1C:size of dref,28
64 72 65 66:dref
00 00 00 00:version
00 00 00 01:entry-count

url Box
00 00 00 0C: size of url ,12
75 72 6C 20:url
00 00 00 01:location


stbl box
00 00 13 68
73 74 62 6C:stbl

stsd Box
00 00 00 34:size of stsd,67
73 74 73 64:stsd
00 00 00 00:version,flags
00 00 00 01:entry-count

rtp box
00 00 00 24
72 74 70 20:rtp
00 00 00 00
00 00
00 01: hinttrackversion
00 01: highestcompatibleversion
00 01 00 00 : maxpacketsize
05 A8: additionaldata[]



tims box
00 00 00 0C
74 69 6D 73
00 00 7D 00: timescale




stts box
00 00 00 18
73 74 74 73
00 00 00 00:version
00 00 00 01:entry-count
00 00 25 B1:sample-count
00 00 04 00:sample-delta

stsc Box
00 00 0E 38:size of stsc
73 74 73 63:stsc
00 00 00 00:version
00 00 01 2E:entry-count
00 00 00 01:first-chunk
00 00 00 20:samples-per-chunk
00 00 00 01:sample-description-index

00 00 00 02:first-chunk
00 00 00 20:samples-per-chunk
00 00 00 01:sample-description-index

00 00 00 03:first-chunk
00 00 00 20:samples-per-chunk
00 00 00 01:sample-description-index

00 00 00 04:first-chunk
00 00 00 20:samples-per-chunk
00 00 00 01:sample-description-index


.............................

stsz Box
00 00 00 14:size of stsz,20
73 74 73 7A:stsz
00 00 00 00:version
00 00 00 30:sample-size
00 00 25 B1:sample-count

stco Box
00 00 04 C8:size of stco
73 74 63 6F:stco
00 00 00 00:version
00 00 01 2E:entry-count
00 07 EB 5D:chunk-offset
00 0B 52 D7
...........................

tref Box
00 00 00 14:size of tref,
74 72 65 66:tref

hint box
00 00 00 0C
68 69 6E 74
00 00 00 65:track-IDS

udta box
00 00 02 05
75 64 74 61

hinf box
00 00 00 EA
68 69 6E 66

trpy Box
00 00 00 10:size of trpy,16
74 72 70 79:trpy
00 00 00 00 00 28 0E DE: uint(64)bytessent; // total bytes sent, including 12-byte RTP headers


nump Box
00 00 00 10:size of nump,16
6E 75 6D 70:nump
00 00 00 00 00 00 25 B1: uint(64)packetssent

tpyl Box
00 00 00 10:size of tpyl,16
74 70 79 6C:tpyl
00 00 00 00 00 26 4A 92: uint(64)bytessent;// total bytes sent, not including RTP headers


totl Box
00 00 00 0C:size of totl,12
74 6F 74 6C:totl
00 28 0E DE: bytessent; }// total bytes sent, including 12-byte RTP headers

npck Box
00 00 00 0C:size of npck,12
6E 70 63 6B:npck
00 00 25 B1: packetssent; }// total packets sent

tpay Box
00 00 00 0C:size of tpay,12
74 70 61 79:tpay
00 26 4A 92: bytessent; }// total bytes sent, not including RTP headers

dmed Box
00 00 00 10:16
64 6D 65 64:dmed
00 00 00 00 00 25 B3 CE: bytessent; }// total bytes sent from media tracks

dimm Box
00 00 00 10:16
64 69 6D 6D:dimm
00 00 00 00 00 00 96 C4: bytessent; }// total bytes sent immediate mode



drep Box
00 00 00 10:16
64 72 65 70:drep
00 00 00 00 00 00 00 00: bytessent; }// total bytes in repeated packets


tmin Box
00 00 00 0C:12
74 6D 69 6E: tmin
FF FF FF 40: time; // smallest relative transmission time, milliseconds


tmax Box
00 00 00 0C:12
74 6D 61 78:tmax
00 00 00 00: time; }// largest relative transmission time, milliseconds


pmax Box
00 00 00 0C:12
70 6D 61 78:pamx
00 00 01 45: bytes; }// largest packet sent, including RTP header


dmax Box
00 00 00 0C:12
64 6D 61 78:dmax
00 00 00 20: time; }// longest packet duration, milliseconds

payt Box
00 00 00 2E:
70 61 79 74:payt
00 00 00 61: payloadID
21 : count,
a=rtpmap:97 mpeg4-generic/32000/2


hnti Box
00 00 01 13:
68 6E 74 69:hnti

sdp Box
00 00 01 0B:
73 64 70 20:sdp
sdptext[]:
m=audio 0 RTP/AVP 97
b=AS:75
a=rtpmap:97 mpeg4-generic/32000/2
a=fmtp:97 profile-level-id =15
config=1290
streamtype=5
mode=AAC-hbr
SizeLength=13
IndexLength=3
IndexDeltaLength=3
a=mpeg4-esid:101
a=x-envivio=verid:0001199A
a=control:trackID=65637

mdat box
03 F1 27 F4
6D 64 61 74:mdat

....................................

你可能感兴趣的:(文件)