`
weiyinchao88
  • 浏览: 1213445 次
文章分类
社区版块
存档分类
最新评论

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

....................................
分享到:
评论

相关推荐

    mp4v2库实现h264格式转换成MP4格式

    本文将深入探讨如何使用`mp4v2`库将H264格式的视频转换为MP4格式。 首先,了解H264与MP4的关系是至关重要的。H264是一种视频编码算法,负责将原始视频数据压缩成更小的体积,以便于存储和传输。而MP4(MPEG-4 Part ...

    基于大华SDK及c++的标准H264裸码封装MP4文件+保存.h264文件+实时预览

    总的来说,基于大华SDK及C++实现标准H264裸码封装MP4文件、保存.H264文件以及实时预览,是视频处理领域的一项基础任务,涉及了视频编码、容器格式、网络通信、本地显示等多个方面的知识。掌握这些技能对于开发视频...

    Mp4视频文件格式分析工具

    MP4视频文件格式是数字媒体领域中广泛应用的一种多媒体容器格式,由Moving Picture Experts Group(MPEG)开发。这种格式能够包含视频、音频、字幕、图像等多种类型的数据,并且具有良好的兼容性和压缩效率。在处理...

    Mp4,H264文件查看器0.1.3B源码.rar

    MP4是一种容器格式,而H264则是其中常用的视频编码标准。本篇文章将深入探讨这两种格式以及与其相关的0.1.3B版本的文件查看器源码。 首先,我们需要了解MP4文件格式。MP4全称为MPEG-4 Part 14,是基于ISO/IEC 14496...

    H264转化MP4源码

    在提供的源码`H264ToMp4`中,应该详细实现了以上所述的步骤,包括读取H264流、解析NAL单元、构建MP4结构、写入文件等功能。通过阅读和理解这段源码,开发者可以学习到如何在实际项目中进行视频格式转换,并了解H264...

    基于mp4v2-标准H264文件转MP4(mp4v2+VS2015)

    然而,并非所有播放器都直接支持H264流,特别是某些老旧的或特定平台的播放器可能需要视频文件以MP4容器格式存在,以便能够解析和播放。 MP4(MPEG-4 Part 14)是多媒体数据的一种容器格式,它可以包含多种音频、...

    H264和MP4分析工具

    3. **Elecard MP4 Inspector**:这是一款专业的MP4文件分析工具,它可以解析MP4文件的结构,显示详细的轨道信息、时间轴、箱结构等,对于MP4文件的故障排查和格式转换非常有用。虽然在标签中提到,但这里并未提供...

    h264格式视频文件播放

    总之,H264视频播放涉及到视频编码、解码、容器格式、网络传输等多个层面的技术。理解这些概念并能实际操作,对于开发流媒体应用或者进行视频处理的IT从业者来说至关重要。通过研究“H264Demo”这样的实例,可以加深...

    h264裸流文件

    标题提到的“h264裸流文件”是指未经封装的H264编码视频数据,它通常是以二进制流的形式存在,不含容器格式中的元数据信息,如时间戳、帧类型等。这种文件类型的优点是体积小,编码效率高,但处理起来需要特定的技术...

    如何使用mp4v2将H264+AAC裸流录制成mp4文件,并保持音视频同步。

    在IT行业中,尤其是在流媒体开发领域,将H264+AAC裸流录制为MP4文件是一项基础且重要的任务。MP4(MPEG-4 Part 14)是一种广泛使用的容器格式,它能够包含多种类型的音频、视频以及字幕数据。H264是高效的视频编码...

    ffmpeg封装H264成MP4、AVI视频格式,及提取出png、jpg格式图片

    在这个特定的项目中,我们看到用户分享了一个Qt工程,该工程利用FFmpeg库将H264编码的视频流封装成MP4或AVI格式,并且能够从中提取出PNG和JPG格式的静态图像。下面我们将深入探讨这些知识点。 1. **H264编码**:H...

    ffmpeg封装H246为MP4

    在本文中,我们将详细讨论如何使用FFmpeg将H264编码的视频流封装到MP4容器中,这是一项常见的任务,特别是在处理网络视频流或进行多媒体文件格式转换时。 首先,理解H264和MP4是非常必要的。H264,也称为AVC...

    H264裸流文件

    在压缩包文件19a96434064646d5a53729708dc2b7b4中,可能包含了这样的H264裸流数据,这些数据可能来自于视频编码器,经过H264编码后,没有被封装到如MP4、FLV或MKV等容器格式中,而是直接准备用于RTP传输。分析这个...

    H265\HEVC MP4测试影片

    描述中提到"MP4封装格式,内含H264和H265两个文件,可通过VLC播放,分析",这说明我们有两个不同编码的1080p视频文件,一个是用H264(也称为AVC,Advanced Video Coding),另一个是用H265(也称为HEVC,High ...

    h264 pcm to mp4

    本文将深入探讨这些概念以及如何将PCM转换为AAC,H264编码,最终封装成MP4文件。 首先,让我们了解这三个概念: 1. **H264**:全称为Advanced Video Coding(高级视频编码),是MPEG-4 Part 10或AVC(高级视频编码...

    H264\H265裸码流提取工具

    描述中提到的“从多种封装格式的视频文件中提取”,这意味着该工具能处理如MP4、MKV、TS等常见的视频容器格式,这些格式内部可能包含H264或H265编码的视频流。值得注意的是,由于该工具当前仅支持视频裸码流的提取,...

    利用ffmpeg将RTSP传输的h264原始码流保存到文件中

    注意,这个文件仅包含视频数据,不包含任何时间戳或其他元数据,因此通常需要一个容器格式(如MP4或MKV)来封装这些信息,以便于播放。 在实际应用中,可能还需要考虑网络稳定性、码率控制、错误处理等因素。例如,...

    mp4info,解析mp4文件必备工具

    3. **格式检测**:mp4info能识别出MP4文件中包含的各种编码格式,例如H.264视频、AAC音频等,这对于确保文件的兼容性和选择合适的解码器至关重要。 4. **错误检查**:在处理或转换MP4文件时,可能会出现各种问题,...

    mp4info mp4文件格式分析工具

    MP4文件格式是一种广泛用于存储音频、视频和字幕数据的数字媒体容器。它基于ISO基础媒体文件格式,是MPEG-4 Part 14的简称。MP4info是一款实用的工具,专为分析和理解MP4文件的内部结构而设计。通过这款工具,用户...

Global site tag (gtag.js) - Google Analytics