📄 3gp文件格式研究 (转windcao的专栏) - 嵌入式 - it博客网.htm
字号:
(red, green, blue)如果gmod不是copy的话会用到.<BR>SMHD包括两个字段
<BR>+--+--+<BR>|bl|rs|<BR>+--+--+<BR> <BR>bl:balance 是一个定点小数(精度
8.8) 前8bits是整数,后8bits是小数.如果值为0说明左右声道是相同的.全左的情况下值为-1.0
全右则为1.0.<BR>rs:reserved
保留字段.<BR>HMHD包括5个字段.如下:<BR>+--+--+[4]-+[4]-+[4]-+<BR>|mp|ap|mbrt|abrt|resv|<BR>+--+--+----+----+----+<BR> <BR>mp:maxPDUsize
最大PDU长度 <FONT color=#ff0000>-pdu是啥????????
知道啥是pdu的朋友请告诉我.</FONT><BR>ap:avgPDUsize 平均PDU长度 <BR>mbrt:maxbitrate
最大比特率 <BR>abrt:avgbitrate 平均比特率 <BR>resv:reserved 保留字段
<BR><BR>NMHD是个空的fullbox
<BR><BR>DINF是一个普通的box,也是一个容器,它包括url,urn,dref三个fullbox<BR>url
内部是一个UTF-8编码的0结尾的字符串<BR>string location;<BR>url里面则是两个<BR>string
name;<BR>string
location;<BR>这两个都被称为DataEntryBox.<BR>dref里面是一个url或者urn的列表.首先它有一个字段<BR>unsigned
int(32)
entry_count;DataEntryBox的列表的个数.<BR>然后就是DataEntryBox的列表<BR><BR>STBL是一个普通的box,也是一个容器,里面包含了很多媒体采样信息.<BR><BR>STTS是一个fullbox里面包含了采样的时间长度信息<BR>内部的数据首先是列表长度<BR>unsigned
int(32) entry_count;<BR>然后就是采用时长列表.<BR>列表每一项都由两个字段组成.<BR>unsigned
int(32) sample_count;采样个数<BR>unsigned int(32)
sample_delta;每个采样的时间长度.<BR><BR>在认识stsd之前我们首先要了解一个数据结构SampleEntry和它的子类AudioSampleEntry,VisualSampleEntry和HintSampleEntry<BR></P>
<P><IMG height=91 alt=sample_e
src="3gp文件格式研究 (转windcao的专栏) - 嵌入式 - IT博客网.files/sampleentry.gif"
width=372></P>SampleEntry
是一个继成box的抽象的数据结构模型.<BR>除了size,type外它包括两个字段,如下:<BR>+[4]-+[4]-+[6]---+--+<BR>|size|type|resved|di|<BR>+----+----+------+--+<BR>resved:reserved,保留字段<BR>di:data_reference_index,序号.<BR>从这个抽象数据结构继承下来的三个子类分别增加了几个独特的新字段.<BR><BR>HintSampleEntry<BR>+[4]-+[4]-+[6]---+--+[n]-+<BR>|size|type|resved|di|data|<BR>+----+----+------+--+----+<BR>resved:reserved,保留字段<BR>di:data_reference_index,序号.<BR>data:是一个0结尾的utf8编码的字符串.<BR><BR>VisualSampleEntry<BR>+[4]-+[4]-+[6]---+--+--+--+[12]---------+--+--+[4]-+[4]-+[4]-+--+[32]----...---+--+--+<BR>|size|type|resved|di|pd|rs|pre_defined
|wd|ht|hrsl|vrsl|resv|fc|compressorname|dp|pd|<BR>+----+----+------+--+--+--+-------------+--+--+----+----+----+--+--------...---+--+--+<BR>size:box长度<BR>type:box:类型<BR>resved:reserved,保留字段<BR>di:data_reference_index,序号.<BR>pd:
pre_defined 保留字段<BR>rs: reserved 保留字段<BR>pd: pre_defined 保留字段<BR>wd:
width 视频的宽<BR>ht: height 视频的高<BR>hrsl: horizresolution
水平分辨率如0x00480000; // 72 dpi<BR>vtsl: vertresolution
垂直分辨率如0x00480000; // 72 dpi<BR>rd: reserved 保留字段<BR>fc: frame_count
每个采样里面的贞数,一般是1;<BR>cmpn: compressorname
是一个数字开头的字符串.并且末尾有填料.对齐到32位.<BR> +-+[n]-+[x]-+<BR> |n|data|xpad|<BR> +-+----+----+<BR>n:number
of data.数据的长度,x+n+1=32<BR>dp: depth 视频的色深 0x18 表示24位色<BR>pd:
pre_defined
保留字段<BR><BR>AudioSampleEntry<BR>+[4]-+[4]-+[6]---+--+[8]-----+--+--+--+--+[4]-+<BR>|size|type|resved|di|reserved|cc|ss|pd|rs|sprt|<BR>+----+----+------+--+--------+--+--+--+--+----+<BR><BR>resved:reserved,保留字段<BR>di:data_reference_index,序号.<BR>reserved:保留字段<BR>cc:
channelcount 声道数1或者2;<BR>ss: samplesize 采样位数大小 8bit 8 ;16bit
16;<BR>pd: pre_defined 保留字段<BR>rs: reserved保留字段<BR>sprt:samplerate
采样率<BR><BR>stsd是一个采样包(SampleEntry)的列表,一般来讲同一个列表中只有一种SampleEntry.<BR>可以通过hdlr里面的handler_type来判断属于哪种SampleEntry.<BR>内部的数据首先是列表长度,一个32位无符号整数
entry_count;<BR>然后就是采样包列表.<BR>采样包有很多具体的实现.如下:
<DIV id=MP4VisualSampleEntry style="CURSOR: hand; COLOR: blue"
onclick="document.all.MP4VisualSampleEntryDisc.style.display=(document.all.MP4VisualSampleEntryDisc.style.display =='none')?'':'none'">+MP4VisualSampleEntry:MP4视频采样包.
</DIV>
<DIV id=MP4VisualSampleEntryDisc
style="DISPLAY: none; MARGIN-LEFT: 20px">+[4]-+[4]-+[6]---+--+--+--+[12]---------+--+--+[4]-+[4]-+[4]-+--+[32]----...---+--+--+[n]-+<BR>|size|type|resved|di|pd|rs|pre_defined
|wd|ht|hrsl|vrsl|resv|fc|compressorname|dp|pd|esds|<BR>+----+----+------+--+--+--+-------------+--+--+----+----+----+--+--------...---+--+--+----+<BR>size:box长度<BR>type:box类型,内容'mp4v'<BR>resved:reserved,保留字段<BR>di:data_reference_index,序号.<BR>pd:
pre_defined 保留字段<BR>rs: reserved 保留字段<BR>pd: pre_defined 保留字段<BR>wd:
width 视频的宽<BR>ht: height 视频的高<BR>hrsl: horizresolution
水平分辨率如0x00480000; // 72 dpi<BR>vtsl: vertresolution
垂直分辨率如0x00480000; // 72 dpi<BR>rd: reserved 保留字段<BR>fc: frame_count
每个采样里面的贞数,一般是1;<BR>compressorname:
是一个数字开头的字符串.并且末尾有填料.对齐到32位.<BR>dp: depth 视频的色深 0x18 表示24位色<BR>pd:
pre_defined 保留字段<BR>
<DIV id=esdsv style="CURSOR: hand; COLOR: blue"
onclick="document.all.esdsvDisc.style.display=(document.all.esdsvDisc.style.display =='none')?'':'none'">+esds:原子数据流描述包(Elementary
Stream Data Box). </DIV>
<DIV id=esdsvDisc style="DISPLAY: none; MARGIN-LEFT: 20px">ES_ID —
set to 0 as stored; when built into a stream, the lower 16 bits of
the TrackID are used.<BR>streamDependenceFlag — set to 0 as stored;
if a dependency exists, it is indicated using a track reference of
type ‘dpnd’.<BR>URLflag — kept untouched, i.e. set to false, as the
stream is in the file, not remote.<BR>SLConfigDescriptor — is
predefined type 2.<BR>OCRStreamFlag — set to false in the file.
<BR></DIV></DIV>
<DIV id=MP4AudioSampleEntry style="CURSOR: hand; COLOR: blue"
onclick="document.all.MP4AudioSampleEntryDisc.style.display=(document.all.MP4AudioSampleEntryDisc.style.display =='none')?'':'none'">+MP4AudioSampleEntry:Entry
type for audio samples defined in the MP4 specification. </DIV>
<DIV id=MP4AudioSampleEntryDisc
style="DISPLAY: none; MARGIN-LEFT: 20px">+[4]-+[4]-+[6]---+--+[8]-----+--+--+--+--+[4]-+[n]-+<BR>|size|type|resved|di|reserved|cc|ss|pd|rs|sprt|esds|<BR>+----+----+------+--+--------+--+--+--+--+----+----+<BR>resved:reserved,保留字段<BR>di:data_reference_index,序号.<BR>reserved:保留字段<BR>cc:
channelcount 声道数1或者2;<BR>ss: samplesize 采样位数大小 8bit 8 ;16bit
16;<BR>pd: pre_defined 保留字段<BR>rs: reserved保留字段<BR>sprt:samplerate
采样率<BR>
<DIV id=esdsa style="CURSOR: hand; COLOR: blue"
onclick="document.all.esdsaDisc.style.display=(document.all.esdsaDisc.style.display =='none')?'':'none'">+esds:Elementary
Stream Data Box.Box containing an elementary stream descriptor for
this stream. </DIV>
<DIV id=esdsaDisc style="DISPLAY: none; MARGIN-LEFT: 20px">ES_ID —
set to 0 as stored; when built into a sntream, the lower 16 bits of
the TrackID are used.<BR>streamDependenceFlag — set to 0 as stored;
if a dependency exists, it is indicated using a track reference of
type ‘dpnd’.<BR>URLflag — kept untouched, i.e. set to false, as the
stream is in the file, not remote.<BR>SLConfigDescriptor — is
predefined type 2.<BR>OCRStreamFlag — set to false in the file.
<BR></DIV></DIV>
<DIV id=AMRSampleEntry style="CURSOR: hand; COLOR: blue"
onclick="document.all.AMRSampleEntryDisc.style.display=(document.all.AMRSampleEntryDisc.style.display =='none')?'':'none'">+AMRSampleEntry:Entry
type for AMR and AMR-WB speech samples defined in clause 6.5 of the
present document. </DIV>
<DIV id=AMRSampleEntryDisc
style="DISPLAY: none; MARGIN-LEFT: 20px">+[4]-+[4]-+[6]---+--+[8]-----+--+--+--+--+[4]-+[n]-+<BR>|size|type|resved|di|reserved|cc|ss|pd|rs|sprt|damr|<BR>+----+----+------+--+--------+--+--+--+--+----+----+<BR>type:'samr'
resved:reserved,保留字段<BR>di:data_reference_index,序号.<BR>reserved:保留字段<BR>cc:
channelcount 声道数1或者2;<BR>ss: samplesize 采样位数大小 8bit 8 ;16bit
16;<BR>pd: pre_defined 保留字段<BR>rs: reserved保留字段<BR>sprt:samplerate
采样率<BR>
<DIV id=damr style="CURSOR: hand; COLOR: blue"
onclick="document.all.damrDisc.style.display=(document.all.damrDisc.style.display =='none')?'':'none'">+damr:AMRSpecificBox
</DIV>
<DIV id=damrDisc
style="DISPLAY: none; MARGIN-LEFT: 20px">+[4]-+[4]-+[4]-+-+--+-+-+<BR>|size|type|vend|d|ms|m|f|<BR>+----+----+----+-+--+-+-+<BR>type:'damr'
vend:vendor<BR>d:decoder_version<BR>ms:mode_set<BR>m:mode_change_period<BR>f:frames_per_sample<BR></DIV></DIV>
<DIV id=AMRWPSampleEntry style="CURSOR: hand; COLOR: blue"
onclick="document.all.AMRWPSampleEntryDisc.style.display=(document.all.AMRWPSampleEntryDisc.style.display =='none')?'':'none'">+AMRWPSampleEntry:Entry
type for AMR and AMR-WB speech samples defined in clause 6.5 of the
present document. </DIV>
<DIV id=AMRWPSampleEntryDisc
style="DISPLAY: none; MARGIN-LEFT: 20px">+[4]-+[4]-+[6]---+--+[8]-----+--+--+--+--+[4]-+[n]-+<BR>|size|type|resved|di|reserved|cc|ss|pd|rs|sprt|dawp|<BR>+----+----+------+--+--------+--+--+--+--+----+----+<BR>type:'sawb'
resved:reserved,保留字段<BR>di:data_reference_index,序号.<BR>reserved:保留字段<BR>cc:
channelcount 声道数1或者2;<BR>ss: samplesize 采样位数大小 8bit 8 ;16bit
16;<BR>pd: pre_defined 保留字段<BR>rs: reserved保留字段<BR>sprt:samplerate
采样率<BR>
<DIV id=dawp style="CURSOR: hand; COLOR: blue"
onclick="document.all.dawpDisc.style.display=(document.all.dawpDisc.style.display =='none')?'':'none'">+dawp:AMRWPDecSpecStruc
</DIV>
<DIV id=dawpDisc style="DISPLAY: none; MARGIN-LEFT: 20px">The
AMRWPDecSpecStruc is defined as follows:
+[4]-+[4]-+[4]-+-+<BR>|size|type|vend|d|<BR>+----+----+----+-+<BR>type:'dawp'<BR>vend:vendor<BR>d:decoder_version<BR></DIV></DIV>
<DIV id=H263SampleEntry style="CURSOR: hand; COLOR: blue"
onclick="document.all.H263SampleEntryDisc.style.display=(document.all.H263SampleEntryDisc.style.display =='none')?'':'none'">+H263SampleEntry:Entry
type for H.263 visual samples defined in clause 6.6 of the present
document. </DIV>
<DIV id=H263SampleEntryDisc
style="DISPLAY: none; MARGIN-LEFT: 20px">+[4]-+[4]-+[6]---+--+--+--+[12]---------+--+--+[4]-+[4]-+[4]-+--+[32]----...---+--+--+[n]-+<BR>|size|type|resved|di|pd|rs|pre_defined
|wd|ht|hrsl|vrsl|resv|fc|compressorname|dp|pd|d263|<BR>+----+----+------+--+--+--+-------------+--+--+----+----+----+--+--------...---+--+--+----+<BR>size:box长度<BR>type:box类型,内容's263'<BR>resved:reserved,保留字段<BR>di:data_reference_index,序号.<BR>pd:
pre_defined 保留字段<BR>rs: reserved 保留字段<BR>pd: pre_defined 保留字段<BR>wd:
width 视频的宽<BR>ht: height 视频的高<BR>hrsl: horizresolution
水平分辨率如0x00480000; // 72 dpi<BR>vtsl: vertresolution
垂直分辨率如0x00480000; // 72 dpi<BR>resv: reserved 保留字段<BR>fc:
frame_count 每个采样里面的贞数,一般是1;<BR>compressorname:
是一个数字开头的字符串.并且末尾有填料.对齐到32位.<BR>dp: depth 视频的色深 0x18 表示24位色<BR>pd:
pre_defined 保留字段<BR>
<DIV id=H263SpecificBox style="CURSOR: hand; COLOR: blue"
onclick="document.all.H263SpecificBoxDisc.style.display=(document.all.H263SpecificBoxDisc.style.display =='none')?'':'none'">+d263:H263SpecificBox
Information specific to the H.263 decoder. </DIV>
<DIV id=H263SpecificBoxDisc
style="DISPLAY: none; MARGIN-LEFT: 20px">+[4]-+[4]-+[n]-------------+[m]-------+<BR>|size|type|H263DecSpecStruc|BitrateBox|<BR>+----+----+----------------+----------+<BR>type:内容'd263'<BR>
<DIV id=H263DecSpecStruc style="CURSOR: hand; COLOR: blue"
onclick="document.all.H263DecSpecStrucDisc.style.display=(document.all.H263DecSpecStrucDisc.style.display =='none')?'':'none'"><BR>+H263DecSpecStruc:
H.263 信息包<BR></DIV>
<DIV id=H263DecSpecStrucDisc
style="DISPLAY: none; MARGIN-LEFT: 20px">H263DecSpecStruc
注意这不是一个包而是个结构.<BR><BR>+[4]-+-+-+-+<BR>|vend|d|l|p|<BR>+----+-+-+-+<BR><BR>vend:vendor
销售商,4位的字符串例如 'VXYZ'<BR>d:decoder_version解码器版本<BR>l:H263_Level
h263版本<BR>p:H263_Profile h263特性<BR>l和p这两个定义是基于MIME media type
video/H263-2000标准的<BR>The profile and level specifications can be
found in [9].<BR>请参考ITU-T Recommendation H.263 (1998): "Video coding
for low bit rate communication".<BR>例 1: H.263 基本 = {H263_Level =
10, H263_Profile = 0}<BR>例 2: H.263 Profile 3 @ Level 10 =
{H263_Level = 10 , H263_Profile = 3}<BR>注意:hint轨迹也可能引用这个结构中的信息.
<BR></DIV>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -