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

Track Data Layout Structures

Data Information Box

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

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

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

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时,该标志的值不会改变,因为在传输操作之后(逻辑上)重新组装文件。

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; //a URL or URN entry.
}
}

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中的所有样本定义常量大小。第二个变体允许较小的字段, 以便在大小不同但较小时节省空间。这些盒子中的一个必须存在;第一个版本是首选的,具有最大兼容性。

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

Compact Sample Size Box

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

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计数。

aligned(8) class SampleToChunkBox extends FullBox(‘stsc’, version = 0, 0) {
unsigned int(32) entry_count; //gives the number of entries in the following table
for (i=1; i <= entry_count; i++) {
unsigned int(32) first_chunk;
unsigned int(32) samples_per_chunk; //the number of samples in each of these chunks
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
the Sample Description Box
}

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偏移。

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

Padding Bits Box

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

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

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

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。

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

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值,为此辅助信息提供偏移信息。

aligned(8) class SampleAuxiliaryInformationSizesBox extends FullBox(‘saiz’, version = 0, flags)
{
if (flags & 1) {
unsigned int(32) aux_info_type; //identifies the type of the sample auxiliary information
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.
}
unsigned int(8) default_sample_info_size;
unsigned int(32) sample_count; //gives the number of samples for which a size is defined
if (default_sample_info_size == 0) {
unsigned int(8) sample_info_size[ sample_count ]; //the size of the sample auxiliary information in bytes
}
}

Sample Auxiliary Information Offsets Box

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

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

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

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. 从零探索Java网络编程01之 TCP/IP 与 Socket

    最近完成了几项比较简单的项目, 终于是在996里偷了点闲暇时光, 想着来研究研究些啥吧?  一个普通的控制台日志映入了我的眼帘(孽缘呀): (图中使用 SpringBoot 的 log4j 来输出日志 ...

  2. Windows10和Windows Server 2019支持OpenSSH

    从 Win10 1809 和 Windows Server 2019 开始 Windows 开始支持 OpenSSH Server.本文介绍一下其基本的概念和配置方法,本文演示用的环境为 Win10 ...

  3. Leetcode之动态规划(DP)专题-121. 买卖股票的最佳时机(Best Time to Buy and Sell Stock)

    Leetcode之动态规划(DP)专题-121. 买卖股票的最佳时机(Best Time to Buy and Sell Stock) 股票问题: 121. 买卖股票的最佳时机 122. 买卖股票的最 ...

  4. 微信扫码无法直接下载APP的apk的解决办法

    PHP的处理方式:http://blog.sina.com.cn/s/blog_4cd978f90102wx92.html

  5. selenium实现京东商城首页查找元素

    语言:Python 京东商城想要找到某个未加载出的元素,需要将页面加载出来. 使用js实现 流程: 1. 需要引入包: # 引入需要的包 import time from selenium impor ...

  6. 蓝鲸智云安装proxy和p-agent过程记录

    1.agent_setup_pro.sh: no such file or directory 2.参考:https://bk.tencent.com/s-mart/community/questio ...

  7. 记录解决一个项目中遇到的maven打包问题

    拿到同时给的代码,进行打jar包,这个jar包依赖一个第三方的jar包,一开始用IDEA打出来的包,没有把依赖的包打进去,后来查了相关的资料, 发现需要在maven的pom中添加相关的maven插件, ...

  8. Daily Temperatures

    Given a list of daily temperatures T, return a list such that, for each day in the input, tells you ...

  9. Android笔记01--手机振动

    一.android任务栈  不懂? 栈:先进后出 队列:先进先出 任务栈Task中:打开一个Activity叫进栈 关闭一个activit出栈 任务栈是用来维护Activity的.是用来维护用户的操作 ...

  10. 七牛云图床及MPIC工具使用

    考虑到图片更容易被人接受,但是大量图片又会延迟博客加载速度.因此,个人感觉可以把静态文件资源托管在云端,这样加载的话就不至于太慢. 注册七牛云 实名验证通过 创建文件存储 内容管理-上传图片 下载Mp ...