感谢Google Translate,Microsoft Translate,通篇机翻,不保证绝对正确

Track Data Layout Structures

Data Information Box

类型 容器 强制性 数量
'dinf' 'minf' 或'meta' Yes(In 'minf') No(optional 'meta') 1

包含声明track中media信息位置的对象。

  1. aligned(8) class DataInformationBox extends Box(‘dinf’) {
  2. }

Data Reference Box

类型 容器 强制性 数量
'dref' 'dinf' Yes 1
类型 容器 强制性 数量
'url' 'urn' 'dref' Yes(至少一个'url'或'urn' 出现) 1 或更多

数据引用对象包含一个数据引用表(通常是URL),用于声明表示中使用的media数据的位置。 示例说明中的数据引用索引将此表中的entry与track中的示例联系起来。 以这种方式可以将track分成多个源。

如果设置了标志,指示数据与此box在同一文件中,则在输入字段中不应提供任何字符串(甚至不是空字符串)。

DataReferenceBox中的entry_count应为1或更大; DataReferenceBox中的每个DataEntryBox都应该是DataEntryUrnBox或DataEntryUrlBox。

当具有标志设置的数据entry表明media数据在同一文件中的文件被分割成用于传输的segments时,该标志的值不会改变,因为在传输操作之后(逻辑上)重新组装文件。

  1. aligned(8) class DataEntryUrlBox (bit(24) flags) extends FullBox(‘url ’, version = 0, flags) {
  2. string location;
  3. }
  1. aligned(8) class DataEntryUrnBox (bit(24) flags) extends FullBox(‘urn ’, version = 0, flags) {
  2. string name;
  3. string location;
  4. }
  1. aligned(8) class DataReferenceBox extends FullBox(‘dref’, version = 0, 0) {
  2. unsigned int(32) entry_count;
  3. for (i=1; i <= entry_count; i++) {
  4. DataEntryBox(entry_version, entry_flags) data_entry; //a URL or URN entry.
  5. }
  6. }

data_entry是URL或URN条目。 Name是URN,在URN条目中是必需的。 位置是一个URL,在URL条目中是必需的,在URN条目中是可选的,它提供了一个位置来查找具有给定名称的资源。 每个都是使用UTF-8字符的以null结尾的字符串。 如果设置了自包含标志,则使用URL表单并且不存在字符串; 该框终止于entry-flags字段。 URL类型应该是提供文件的服务(例如,类型为file,http,ftp等的URL),并且理想情况下哪些服务也允许随机访问。 相对URL是允许的,并且相对于包含包含此数据引用的Movie Box的文件。

Sample Size Boxes

类型 容器 强制性 数量
'stsz' 'stz2' 'stbl' Yes Exactly one variant must be present

此box包含sample 数量,和一张表,含有每个sample的size(in bytes)。这允许media数据本身被解构。media中的sample总数始终显示在sample计数中。

sample size box有两个变体。第一个变体具有用于表示sample大小的固定大小32‐bit 字段;它允许为track中的所有样本定义常量大小。第二个变体允许较小的字段, 以便在大小不同但较小时节省空间。这些盒子中的一个必须存在;第一个版本是首选的,具有最大兼容性。

  1. aligned(8) class SampleSizeBox extends FullBox(‘stsz’, version = 0, 0) {
  2. unsigned int(32) sample_size; //为0,代表samples具有不同的size,具体值存储在sample size table。为其他,所有的sample具有相同的size,就是这个值,no array follows
  3. unsigned int(32) sample_count;
  4. if (sample_size==0) {
  5. for (i=1; i <= sample_count; i++) {
  6. unsigned int(32) entry_size; //size of a sample
  7. }
  8. }
  9. }

Compact Sample Size Box

  1. aligned(8) class CompactSampleSizeBox extends FullBox(‘stz2’, version = 0, 0) {
  2. unsigned int(24) reserved = 0;
  3. unisgned int(8) field_size; //size in bits of the entries in the following table
  4. unsigned int(32) sample_count; //gives the number of entries in the following table
  5. for (i=1; i <= sample_count; i++) {
  6. unsigned int(field_size) entry_size; //size of a sample, indexed by its number.
  7. }
  8. }

Sample To Chunk Box

类型 容器 强制性 数量
'stsc' 'stbl' Yes 1

media数据中的示例被分组为多个chunks。chunks 可以有不同的大小, 并且chunk中的sample数量可以有不同的大小。此表可用于查找包含sample的chunk、其位置和关联的sample description。

此表紧凑编码。每个entry给出接连具有相同特征的一组chunks的第一个chunk的index。通过从前一个entry中减去一个entry,可以计算在此组中有多少chunks。您可以通过乘以适当的每个chunk的sample数目将其转换为sample计数。

  1. aligned(8) class SampleToChunkBox extends FullBox(‘stsc’, version = 0, 0) {
  2. unsigned int(32) entry_count; //gives the number of entries in the following table
  3. for (i=1; i <= entry_count; i++) {
  4. unsigned int(32) first_chunk;
  5. unsigned int(32) samples_per_chunk; //the number of samples in each of these chunks
  6. unsigned int(32) sample_description_index; //the index of the sample entry that describes the samples in this chunk , range : 1~ the number of sample entries in
  7. the Sample Description Box
  8. }

first_chunk 给出了它给出了这组chunks的第一个chunk的索引,它们共享相同的samples-per-chunk和sample-description-index;track中第一个chunk的索引值为1(此box的第一个记录中的first_chunk字段的值为1,表示第一个样本映射到第一个块)。

Chunk Offset Box

类型 容器 强制性 数量
‘stco’, ‘co64’ 'stbl' Yes Exactly one variant must be present

chunk offset table将每个chunk的索引提供给包含文件。 有两种变体,允许使用32位或64位偏移。 后者在管理非常大的presentation时非常有用。 这些变体中的至多一个将出现在sample table的任何单个sample中。

偏移是文件偏移,而不是文件中任何box(例如Media Data Box)的偏移。 这允许在没有任何box结构的文件中引用media data。 这也意味着在构造一个自包含的ISO文件时必须小心,因为Movie Box的大小会影响媒体数据的chunk偏移。

  1. aligned(8) class ChunkOffsetBox extends FullBox(‘stco’, version = 0, 0) {
  2. unsigned int(32) entry_count; //number of entries in the following table
  3. for (i=1; i <= entry_count; i++) {
  4. unsigned int(32) chunk_offset; //gives the offset of the start of a chunk into its
  5. containing media file.
  6. }
  7. }
  1. aligned(8) class ChunkLargeOffsetBox extends FullBox(‘co64’, version = 0, 0) {
  2. unsigned int(32) entry_count;
  3. for (i=1; i <= entry_count; i++) {
  4. unsigned int(64) chunk_offset;
  5. }
  6. }

Padding Bits Box

类型 容器 强制性 数量
‘padb’ 'stbl' No 0 / 1

在某些流中,media sample不占用sample size给出的所有字节位,并在末尾填充到字节边界。 在某些情况下,有必要额外记录使用的填充位数。 该表提供了该信息。

  1. aligned(8) class PaddingBitsBox extends FullBox(‘padb’, version = 0, 0) {
  2. unsigned int(32) sample_count; //number of samples in the track
  3. int i;
  4. for (i=0; i < ((sample_count + 1)/2); i++) {
  5. bit(1) reserved = 0;
  6. bit(3) pad1; //a value from 0 to 7, indicating the number of bits at the end of sample (i*2)+1.
  7. bit(1) reserved = 0;
  8. bit(3) pad2; //a value from 0 to 7, indicating the number of bits at the end of sample (i*2)+2
  9. }
  10. }

Sub-Sample Information Box

类型 容器 强制性 数量
‘subs’ 'stbl' 'traf' No 0 / more

此box为了包含sub-sample 信息。

一个sub-sample是一个sample的一段连续字节范围。 应为给定的编码系统提供sub-sample的具体定义(例如,对于ISO / IEC 14496-10,高级视频编码)。 在没有这种特定定义的情况下,该box不适用于使用该编码系统的samples。

如果任何sample的subsample_count为0,那么这些sample没有sub-sample信息,后面没有数组。table是稀疏编码的。该表通过记录每个entry之间的sample数差异来识别哪些sample 具有sub-sample结构。 表格中的第一个entry记录了具有sub-sample信息的第一个sample的sample编号。

如果同一container box中存在多个Sub-Sample Information Box,则每个Sub-Sample Information Box中的flag应不同。 应为给定的编码系统提供falg的语义(如果有的话)。 如果falg对于给定的编码系统没有语义,则flag应为0。

  1. aligned(8) class SubSampleInformationBox extends FullBox(‘subs’, version, flags) {
  2. unsigned int(32) entry_count; //gives the number of entries in the following table
  3. int i,j;
  4. for (i=0; i < entry_count; i++) {
  5. unsigned int(32) sample_delta;
  6. unsigned int(16) subsample_count; //number of sub‐sample for the current sample . 0 means no sub-sample structure
  7. if (subsample_count > 0) {
  8. for (j=0; j < subsample_count; j++) {
  9. if(version == 1){
  10. unsigned int(32) subsample_size; //the size, in bytes, of the current sub‐sample.
  11. }
  12. else{
  13. unsigned int(16) subsample_size;
  14. }
  15. unsigned int(8) subsample_priority; //the degradation priority for each sub‐sample.
  16. unsigned int(8) discardable;
  17. unsigned int(32) codec_specific_parameters; //is defined by the codec in use. If no such definition is available,
  18. this field shall be set to 0
  19. }
  20. }
  21. }
  22. }

sample_delta用于指定具有sub-sample结构的sample数。它被编码为所需的sample编号与上一项中指示的sample编号之间的差异。如果当前entry是第一个entry, the value indicates the sample number of the first sample having sub‐sample information, 即该值是sample数与零 (0) 之间的差异。

discardable = 0意味着sub-sample需要解码当前sample。= 1则不需要,但增强,例如,sub-sample由补充增强信息(SEI)消息组成。

Sample Auxiliary Information Sizes Box

类型 容器 强制性 数量
‘saiz’ 'stbl' 'traf' No 0 / more

每个sample辅助信息可以存储在sample数据所在文件中的任何位置; 对于自包含的媒体文件,其通常位于Media Data box或派生的box中。 它存储在(a)多个chunk中,每个chunk的sample数量,以及chunk的数量,匹配主要sample数据的分chunk,或者(b)在单个chunk中用于电影中的所有sample sample表(或movie fragment)。 单个chunk(或track run)中包含的所有sample的sample辅助信息是连续存储的(类似于sample数据)。

Sample Auxiliary Information(如果存在)始终存储在与其相关的样本相同的文件中,因为它们共享相同的数据引用('dref')结构。 但是,此数据可能位于此文件中的任何位置,使用辅助信息偏移('saio')来指示数据的位置。

是否允许或要求样本辅助信息可以由品牌或使用的编码格式指定。 样本辅助信息的格式由aux_info_type确定。 如果省略aux_info_type和aux_info_type_parameter,则aux_info_type的隐含值是(a)在转换内容的情况下,例如受保护内容,scheme_type包括在Protection Scheme Information box中(b)sample entry类型。 aux_info_type_parameter的默认值为0.可以限制aux_info_type的某些值仅用于特定track类型。 track可以具有多个不同类型的样本辅助信息流。 这些类型在注册机构注册。

虽然aux_info_type确定辅助信息的格式,但是当aux_info_type_parameter的值不同时,可以使用具有相同格式的若干辅助信息流。 必须指定特定aux_info_type值的aux_info_type_parameter的语义,同时指定特定aux_info_type值和隐含辅助信息格式的语义。

此box提供每个sample的辅助信息的大小。 对于此box的每个实例,必须存在匹配的SampleAuxiliaryInformationOffsetsBox,其具有相同的aux_info_typeaux_info_type_parameter值,为此辅助信息提供偏移信息。

  1. aligned(8) class SampleAuxiliaryInformationSizesBox extends FullBox(‘saiz’, version = 0, flags)
  2. {
  3. if (flags & 1) {
  4. unsigned int(32) aux_info_type; //identifies the type of the sample auxiliary information
  5. unsigned int(32) aux_info_type_parameter; //identifies the “stream” of auxiliary information having the same value of `aux_info_type` and associated to the same track.
  6. }
  7. unsigned int(8) default_sample_info_size;
  8. unsigned int(32) sample_count; //gives the number of samples for which a size is defined
  9. if (default_sample_info_size == 0) {
  10. unsigned int(8) sample_info_size[ sample_count ]; //the size of the sample auxiliary information in bytes
  11. }
  12. }

Sample Auxiliary Information Offsets Box

类型 容器 强制性 数量
‘saio’ 'stbl' 'traf' No 0 / more

此box以类似于sample数据的chunk偏移的方式提供sample辅助信息的位置信息。

  1. aligned(8) class SampleAuxiliaryInformationOffsetsBox extends FullBox(‘saio’, version, flags)
  2. {
  3. if (flags & 1) {
  4. unsigned int(32) aux_info_type;
  5. unsigned int(32) aux_info_type_parameter;
  6. }
  7. unsigned int(32) entry_count; //the number of entries in the following table.
  8. if ( version == 0 ) {
  9. unsigned int(32) offset[ entry_count ]; //gives the position in the file of the Sample Auxiliary Information for each Chunk or Track Fragment Run.
  10. // 该 saio/saiz 在 stbl 中,此值是绝对的; 在 traf 中,该值是相对的(tfhd box 的flag, 如果该 flag == 0x020000(default-base-is-moof)则表示该相对偏移量是相对于 moof box的开始位置)
  11. }
  12. else {
  13. unsigned int(64) offset[ entry_count ];
  14. }
  15. }

ISO/IEC 15444-12 MP4 封装格式标准摘录 3的更多相关文章

  1. ISO/IEC 15444-12 MP4 封装格式标准摘录 5

    目录 Segments Segment Type Box Segment Index Box Subsegment Index Box Producer Reference Time Box Supp ...

  2. ISO/IEC 15444-12 MP4 封装格式标准摘录 4

    目录 Movie Fragments Movie Extends Box Movie Extends Header Box Track Extends Box Movie Fragment Box M ...

  3. ISO/IEC 15444-12 MP4 封装格式标准摘录 2

    目录 Track Media Structure Media Box Media Header Box Handler Reference Box Media Information Box Medi ...

  4. mp4封装格式各box类型讲解及IBP帧计算

    mp4封装格式各box类型讲解及IBP帧计算 目录 mp4封装格式各box类型讲解及IBP帧计算 box ftyp box moov box mvhd box (Movie Header Box) t ...

  5. H.264标准(一)mp4封装格式详解

    在网络层,互联网提供所有应用程序都要使用的两种类型的服务,尽管目前理解这些服务的细节并不重要,但在所有TCP/IP概述中,都不能忽略他们: 无连接分组交付服务(Connectionless Packe ...

  6. ISO/IEC 14496 文档内容简介, MPEG标准

    ISO/IEC 14496是MPEG专家组制定的MPEG-4标准于1998年10月公布第1版,1999年1月成为国际标准,1999年12月公布了第2版,2000年初成为国际标准. 全文分为21个部分: ...

  7. 最简单的基于FFmpeg的封装格式处理:视音频复用器(muxer)

    ===================================================== 最简单的基于FFmpeg的封装格式处理系列文章列表: 最简单的基于FFmpeg的封装格式处理 ...

  8. 多媒体封装格式详解---MP4

    MP4文件格式详解——结构概述 http://blog.csdn.net/pirateleo/article/details/7061452 一.基本概念 1. 文件,由许多Box和FullBox组成 ...

  9. ISO日期格式标准,浏览器到服务器到mysql中的时区

    时区简单理解 https://zh.wikipedia.org/wiki/%E6%97%B6%E5%8C%BA 上面的链接是时区的wiki说明,下面说说我记住的部分: GMT时区是格林威治标准时间,我 ...

随机推荐

  1. three.js效果之热力图和轨迹线

    1.热力图 开始的时候,是用一个网上找的canvas画渐变热点的demo,原理就是给定顶点坐标,然后画圆,颜色使用渐变色,根据权重决定渐变的层数(红色->橙色->绿色) . 但是终究觉得这 ...

  2. VMware虚拟机桥接方式与真实主机共享上网

    原始出处 .http://meiling.blog.51cto.com/6220221/1367695 一.先介绍一下VMware网络设置的三种方式: VMWare提供了三种工作模式,host-onl ...

  3. 安装heat

    在控制节点上执行 controller-heat(){mysql -uroot -p${MYSQL_PASSWD} << EOF DROP DATABASE IF EXISTS heat; ...

  4. 又做了个新的Blog

    http://inkhin.com 服务器比较渣,访问不了的请见谅.

  5. 产品之我见(3)-ZEN在产品上的延伸

    ZEN 在WIKIPEDIA上的解释是这样的: 禅,禅宗强调严格的自我控制能力,冥想实践,洞察到的事物性质,而这种洞察力在日常生活中的个人表达,尤其是为了别人的利益. 因此,它不再强调对经典和学说的了 ...

  6. eclipse Maven Bootstrap 导航栏

    1.在pom.xml添加两个依赖 Bootstrap 依赖和jQuery依赖 代码如下 <!-- https://mvnrepository.com/artifact/org.webjars/b ...

  7. lower_bound( )和upper_bound( )的常见用法

    lower_bound( )和upper_bound( )都是利用二分查找的方法在一个排好序的数组中进行查找的. 在从小到大的排序数组中, lower_bound( begin,end,num):从数 ...

  8. jQuery 虚拟数字键盘代码

    先上效果:    js直接应用:  $('input').mynumkb(); 就出来效果 HTML: <input maxlength="4" type="tex ...

  9. [CF544D]Destroying Roads_最短路_bfs

    D. Destroying Roads 题目大意: In some country there are exactly n cities and m bidirectional roads conne ...

  10. Linux系列(11):之bash进阶与数据流导向、管线命令

    1.万用字符与特殊字符 在bash的环境下有一个特别有用的功能,那就是万用字符!下面展示常见的万用字符: 1.万用字符 除了万用字符还有一些其他的特殊字符,接下来显示特殊字符. 2.特殊字符 2.数据 ...