稍后再看

翻译:QuickTime文件格式规范-Movie Atoms(1

2016-10-24  本文已影响0人  HaloMartin

译者注:
这里面的内容主要是分析mp4/3gp文件的层级结构,详细的介绍了各种不同的box的结构等,网上有一些参考资源,他们大多都是结合实际的例子来说明,篇幅较大,而且笼统,建议读者分多次结合网上资源来理解这部分内容。

翻译正文:

Movie Atoms

本章简单介绍了QuickTime movie atoms,以及这些atoms的布局和用法的具体细节。本章中讨论的每种atom类型都有包含偏移量信息的附图,以及字段说明。

本章分为以下主要部分:

📝 :media atoms和sample atoms不包含实际采样数据,如视频帧或音频采样。 它们包含用于定位和解释这些采样的元数据。

Overview of Movie Atoms(Movie Atoms概述)

QuickTime movie atoms的atom类型为“moov”。 这些atom作为描述movie数据的信息的容器。 该信息或元数据存储在多种不同类型的atom中。 一般来说,只有元数据存储在movie原子中。 movie的样本数据,例如音频或视频样本,在movie atom中引用,但不包含在其中。

movie atom基本上是其他atoms的容器。 这些atoms一起描述了movie的内容。 在顶层,movie atom通常包含轨道atoms,轨道atom又包含media atoms。 在最底层是叶atoms,其包含非atom数据,通常以表或一组数据元素的形式。 例如,轨道atom包含edit atom,edit atom又包含edit list atom,叶atom包含edit list table的数据。 所有这些atom将在本文档的后面讨论。

图2-1提供了一个简单的单轨QuickTime movie的组织的概念图。图中的每个嵌套框表示属于其父atom的atom。该图不显示任何atom的数据区域。这些区域在这部分的后面介绍。

注意,该图显示了标准movie atom的组织结构。可以使用无损压缩算法来压缩movie元数据。在这种情况下,movie atom只包含一个子atom - compressed movie atom('cmov')。当这个子atom未压缩时,其内容符合下图所示的结构。有关详细信息,请参阅Compressed Movie Resources。

还可以创建reference movie,引用其他movie的movie;在这种情况下,movie atom可以仅包含reference movie atom('rmra')。有关详细信息,请参阅“Reference Movies”。最终,这种链关系必须以标准movie atom(如图2-1中的atom)或压缩的movie atom(可以解压缩以获得相同的结构)结束。

图 2-1 Sample organization of a one-track video movie

📝 注意:在单轨QuickTime movie文件中,其他的atoms可能存在,但不显示在图2-1中。

Movie Atom

您使用movie atoms来指定定义movie的信息,即允许程序解释存储在其他位置的sample数据的信息。movie atom通常包含movie header atom,其定义整个movie的时间尺度和持续时间信息,以及其显示特性。现有movie可能包含movie profile atom,其中总结了movie的主要功能,例如必要的编解码器和最大比特率。此外,movie atom包含movie中每个轨道的track atom。

movie atom的atom类型为“moov”。它包含其他类型atoms,包括三个可能atoms中的至少一个 - movie header atom('mvhd'),compressed movie atom('cmov')或reference movie atom('rmra')。uncompressed movie atom可以包含movie header atom和reference movie atom,但它必须包含这两个中的至少一个。它还可以包含几个其他atoms,如clipping atom('clip'),一个或多个track atoms('trak'),colour table atom('ctab')和user data atom('udta') 。

compressed movie atoms和reference movie atoms被分开讨论。 本节介绍正常的uncompressed movie atoms。

图 2-2 显示了典型的movie atom的布局。

📝 注意:如前所述,叶子atoms显示为白色框,容器atoms显示为灰色框。

图 2-2 The layout of a movie atom

movie atom可能包含以下字段:

Movie Profile Atom

📝 注意:profile atoms在QuickTime文件格式中已弃用。 以下信息旨在记录包含profile atoms的现有内容,不应用于新开发。

movie profile atom总结了movie的特征和复杂性,例如所需的编解码器和最大比特率,以帮助播放器应用或设备快速确定他们是否具有播放movie的必要资源。

movie的特征通常包括movie的最大视频和音频比特率,音频和视频编解码器类型的列表,movie的视频尺寸以及任何适用的MPEG-4配置文件和级别。 这是也可以通过更详细地检查movie文件的内容而获得的所有信息。 此摘要旨在允许应用程序或设备快速确定他们是否可以播放movie。 它不打算作为movie中其他地方找不到的信息的容器,不应该用作单独的一个。

📝 注意:实际上,不出现在profile atom中的特征并不意味着它不在movie中。 profile atom本身可以不存在,或者可以仅列出movie特征集的子集。 profile atom中列出的特征都是存在的,但列表不一定是完整的。

创建profile atom时,可以省略movie中存在的某些要素,但需要完全指定profile atom中包含的任何要素。例如,包含视频的movie在profile atom中可以具有或可以不具有视频编解码器类型特征,但是如果在profile atom中包括任何视频编解码器类型特征,则必须在profile atom中列出每个所需的视频编解码器。

movie profile atom是profile atom('prfl'),其父结点是movie atom。这与轨道profile atom不同,其父结点是track atom。在两种情况下,profile atom的结构是相同的,但是movie profile atom的内容将movie作为一个整体描述,而轨道profile atom的内容特定于某个轨道。

profile atom包含一个特征列表。在movie profile atom中,这些特征将movie作为一个整体进行了总结。在轨道profile atom中,这些特征描述特定轨道。

特征列表中的每个条目由四个32位字段组成:

有关profile atoms的结构和内容的详细信息,请参阅Profile Atom Guidelines

Movie Header Atoms

您使用movie header atom来指定整个QuickTime movie的特征。 该atom中包含的数据定义了整个QuickTime movie的特征,例如时间尺度和持续时间。 它的atom类型值为'mvhd'。

图 2-3 显示了movie header atom的布局。 movie header atom是叶子atom。

图 2-3 The layout of a movie header atom

您可以通过指定以下数据元素来定义movie header atom。

📝 注意:创建和修改日期应使用协调世界时(UTC)设置。 在QuickTime文件格式的先前版本中,未指定这个,并且这些字段通常设置为创建电影的时区的本地时间。

Color Table Atoms

Color table atoms定义了在仅支持256种颜色的设备上显示movie的首选颜色列表。 该列表最多可以包含256种颜色。 这些可选atoms类型值为'ctab'。 color table atom包含Macintosh颜色表数据结构。

图 2-4 显示了color table atom的布局。

图 2-4 The layout of a color table atom

color table atom包含以下数据元素。

User Data Atoms

user data atoms允许您定义和存储与QuickTime对象相关联的数据,例如movie 'moov',track 'trak'或media 'mdia'。这也包括QuickTime寻找的信息,例如版权信息或movie是否应该循环,以及由应用程序提供的任意信息 - QuickTime完全忽略的。

其直接父结点是movie atom的user data atom包含与movie作为整体相关的数据。其父结点是轨道atom的user data atom包含与该特定轨道相关的信息。 QuickTime movie文件可以包含许多user data atoms,但是只允许一个user data atom作为任何给定movie atom或轨道atom的直接子节点。

user data atom的atom类型为“udta”。在user data atom内的是描述每条用户数据的atoms列表。用户数据提供了一种扩展存储在QuickTime movie中的信息的简单方法。例如,user data atom可以存储movie的窗口位置,回放特性或创建信息。

本节介绍QuickTime可识别的 data atoms。您可以创建自己的应用程序可识别的新的data atom类型。应用程序应忽略它们不能识别的任何data atom类型。

图2-5 显示了user data atom的布局。

图 2-5 The layout of a user data atom
user data atom包含以下数据元素。
List entry type Description For Sorting
'©arg' Name of arranger
'©ark' Keywords for arranger X
'©con' Keywords for composer X
'©com' Name of composer
'©cpy' Copyright statement
'©day' Date the movie content was created
'©dir' Name of movie’s director
'©ed1' to '©ed9' Edit dates and descriptions
'©fmt' Indication of movie format (computer-generated, digitized, and so on)
'©inf' Information about the movie
'©isr' ISRC code
'©lab' Name of record label
'©lal' URL of record label
'©mak' Name of file creator or maker
'©mal' URL of file creator or maker
'©nak' Title keywords of the content X
'©nam' Title of the content
'©pdk' Keywords for producer X
'©phg' Recording copyright statement, normally preceded by the symbol
'©pre' Name of producer
'©prf' Names of performers
'©prk' Keywords of main artist and performer X
'©prl' URL of main artist and performer
'©req' Special hardware and software requirements
'©snk' Subtitle keywords of the content X
'©snm' Subtitle of content
'©src' Credits for those who provided movie source content
'©swf' Name of songwriter
'©swk' Keywords for songwriter X
'©swr' Name and version number of the software (or hardware) that generated this movie
'©wrt' Name of movie’s writer
'AllF' Play all frames—byte indicating that all frames of video should be played, regardless of timing
'hinf' Hint track information—statistical data for real-time streaming of a particular track. For more information, see Hint Track User Data Atom.
'hnti' Hint info atom—data used for real-time streaming of a movie or a track. For more information, see Movie Hint Info Atom and Hint Track User Data Atom.
'name' Name of object
'tnam' Localized track name optionally present in Track user data. The payload is described in Track Name.
'tagc' Media characteristic optionally present in Track user data—specialized text that describes something of interest about the track. For more information, see Media Characteristic Tags.
'LOOP' Long integer indicating looping style. This atom is not present unless the movie is set to loop. Values are 0 for normal looping, 1 for palindromic looping.
'ptv ' Print to video—display movie in full screen mode. This atom contains a 16-byte structure, described in Print to Video (Full Screen Mode).
'SelO' Play selection only—byte indicating that only the selected area of the movie should be played
'WLOC' Default window location for movie—two 16-bit values, {x,y}

当显示文本不具有预定排序顺序时(例如,当排序取决于上下文含义时,在东方语言中),使用标记为“keywords”并且标记为“For Sorting”的用户数据项。 这些关键字可以按算法排序以按正确的顺序放置相应的项目。

窗口位置,循环,仅播放选择,播放所有帧,和打印到video这些atoms控制QuickTime显示movie的方式。 只有当user data atom的直接父节点是一个movie atom('moov')时,这些atom才被解释。 如果它们作为轨道atom的用户数据的一部分被包括,它们被忽略。

User Data Text Strings and Language Codes(用户数据文本字符串和语言代码)

类型以©字符(ASCII 169)开头的所有用户数据列表条目都被定义为国际文本。这些列表条目必须包含具有相关语言代码的文本字符串列表。通过存储相同文本的多个版本,单个用户数据文本项可以包含不同语言的翻译。

文本字符串列表使用一个小的整数atom格式,它与QuickTime atom格式相同,除了它使用16位的值来表示大小和类型,而不是32位的值。第一个值是字符串的大小,包括大小和类型,第二个值是字符串的语言代码。

user data text strings可以使用Macintosh文本编码或Unicode文本编码。语言代码的格式决定了文本编码格式。 Macintosh语言代码后面是Macintosh编码的文本。如果使用规范ISO 639-2/T中列出的ISO语言代码指定语言代码,则文本使用Unicode文本编码。当使用Unicode时,文本为UTF-8,除非它以字节顺序标记(BOM,0xFEFF)开头,在这种情况下,文本为UTF-16。 BOM和UTF-16文本都应该是big-endian。相同文本的多个版本可以使用不同的编码方案。

⚠️ 重要:小于0x400的语言代码值为Macintosh语言代码。 大于或等于0x400的语言代码值为ISO语言代码。 该规则的例外是语言代码0x7FFF,它表示未指定的Macintosh语言。

ISO语言代码是三字符代码。 为了适应16位字段,字符必须被打包成三个5位子字段。 该包在“ISO Language Codes”中描述。

Media Characteristic Tags(媒体特征标签)

轨道('trak')atom的user data atom可以包含零个或多个media characteristic tag atoms('tagc')。

media characteristic tag atom的有效载荷数据是指示关于轨道的有趣的标签。这是一个特殊的字符串,由US-ASCII(7位加上一个清除高位)字符的子集组成,符合以下段落中描述的结构。这不是一个C字符串;没有终止null,所以从atom的大小确定字符数。合法字符是字母(A-Z,a-z),数字(0-9),破折号( - ),句点(.),下划线(_)和波浪号(〜)。

QuickTime文件的任何轨道可以与指示媒体特性的一个或多个标签相关联。标签表示关于轨道的有趣的东西。例如,标签可以指示轨道的目的(它是注释),轨道的抽象特性(其需要硬件解码)或轨道包括可读文本的指示(章节轨道和字幕轨道都可以是由用户读取)。

标签的比较区分大小写;如果字符串的字节匹配,则两个标记匹配。不应该使用两种仅区分大小写的标记字符串,以避免开发人员或内容创建者可能产生混淆。

允许在单个轨道中使用重复的标签,但不鼓励。复制没有特殊意义。

标记字符串不是本地化的,并且意在进行机器解释;但是,鼓励记忆字符串。

标记要么是public或是private:

标记字符串具有以下结构:

📝 注意:公共标记是公开的,因为它们已记录在本规范中或在Apple API中可用。其他定义的带有“public.”前缀的标签被禁止;请用私人标签替代。

📝 注意:支持除“public”之外的通用顶级域(如果要分配)。字符串“public”保留用于表示公共媒体特征标签。

此规范定义了以下几个公共媒体特征标签。其他公共和私人标签可以在规范之外定义;无法识别的标记应该被忽略。

Track Name

movie atom的user data atom可以包含track name atom('tnam')。
track name atom的有效载荷数据由以下数据组成。

轨道可以具有多个具有不同语言代码的“tnam”atom。 通常,每个轨道具有与轨道内容相同的语言的单个“tnam”atom是足够的。 备选轨道也可以具有'tnam' atoms; 它们的存在意味着该名称是轨道的好的用户可读标签。

Print to Video (Full Screen Mode)

movie atom的user data atom可以包含print to video atom('ptv ')。注意,第四个字符是一个ASCII(space)(0x20)。如果存在print to video atom,QuickTime以全屏模式播放movie,没有窗口,没有可见的控制器。未被movie占据的屏幕的任何部分被清除为黑色。用户必须按Esc(Escape)键退出全屏模式。

这个atom通常被暂时添加和删除以控制用于单个演示的movie的显示模式,但是它也可以被存储为永久movie文件的一部分。

print to video atom的有效载荷数据包括以下内容。

Track Atoms

track atom定义了movie的单个轨道。 movie可能由一个或多个曲目(tracks)组成。 每个轨道独立于movie中的其他轨道并且携带其自己的时间和空间信息。 每个轨道atom包含其相关联的媒体atom。
轨道专门用于以下目的:

📝 注意:QuickTime movie不能只包括提示轨道或修改轨道; 必须至少有一个媒体轨道。 此外,不能从提示的movie中删除媒体轨道,即使提示轨道包含媒体样本数据的副本 - 除了提示轨道,整个未提示的电影必须保留。

图 2-6 显示了track atom的布局。 轨道atom的atom类型值为'trak'。 轨道atom需要track header atom('tkhd')和media atom('mdia')。 其他子atom是可选的,并且可以包括track clipping atom('clip'),track matte atom('matt'),edit atom('edts'),track reference atom('tref'),track load settings atom('load'),track input map atom('imap')和user data atom('udta')。

📝 注意图2-6包含可选的track profile atom'prfl'。 轨迹配置文件atom在当前版本的QuickTime中已弃用,但可能存在于现有的QuickTime文件中。 这里的包含旨在记录包含profile atom的现有内容,它们不应当用于新的开发。

图 2-6 The layout of a track atom

track atoms包含以下数据元素。

Track Profile Atom

📝 注意:profile atoms在QuickTime文件格式中已弃用。 以下信息旨在记录包含profile atom的现有内容,不应用于新开发。

profile atom可以是movie atoms或track atoms的子结点。 有关profile atoms的详细信息,请参阅Movie Profile Atom。

Track Header Atoms

track header atom指定movie内单个轨道的特性。 track header atom包含指定字节数的size字段和指示数据格式(由atom类型“tkhd”定义)的type字段。

图 2-7 显示了track header atom的结构。

图 2-7 The layout of a track header atom
track header atom包含track的track特性,包括时间,空间和音量信息。

track header atom包含以下数据元素。

Track Exclude From Autoselection Atoms

一些替代轨道包含除主要内容的直接翻译(或非翻译书写形式)之外的东西。评论轨道就是一个例子。这些轨道不应自动选择。在轨道中存在Track Exclude From Autoselection atom表示不应该自动选择该轨道。

这种轨道应该具有用户可读的名称,以帮助用户识别轨道的目的。这些名称存储在“trak” atom内的user data('udta')atom内的一个或多个轨道名称('tnam')atom中,每个atom被翻译成不同的语言。

Track Exclude From Autoselection atom的类型是'txas'。这个atom,如果使用,必须在“tkhd” atom之后的某处。

Track Exclude From Autoselction atoms包含以下数据元素。

Track Aperture Mode Dimension Atoms

QuickTime Movie中的视频轨道可以通过图像描述扩展发出清晰的光圈和像素宽高比信息。清洁光圈定义要显示的编码像素的部分。像素宽高比是编码像素的宽高比。概念上,基于像素高宽比对编码像素进行解压缩,拉伸(或收缩),并且根据清洁孔径裁剪额外像素。

📝 注意:QuickTime轨道在track header dimensions中定义其内容的简单尺寸。在没有轨道孔径模式维度原子的情况下,轨道头部中的尺寸用于所有模式。

考虑到这种上下文,记录在图像描述中的尺寸定义了编码像素(编码尺寸)的尺寸。实际显示的是应用像素宽高比和净光圈(显示尺寸)的结果。

尽管应用清洁孔径和像素宽高比的结果是用于最终显示的,但是存在为了各种不同的有用的目的而显示存在于内容中的所有像素。解析QuickTime影片的读者需要允许这些不同显示模式的信息,以提供这种灵活性:

这些呈现模式中的每一者所需的信息在optional track aperture mode dimensions atoms中表示。

📝 注意:在QuickTime 7之前构建的旧应用程序将继续使用存储在轨道header中的dimension值。

Track Aperture Mode Dimensions Atom

一个container atom,其以三个所需atom的形式存储用于视频校正的信息。 该atom可选地包括在轨道atom中。 Track Aperture Mode Dimensions atom的类型是“tapt”。

*** 图 2-9*** 显示了track aperture mode dimensions atom的布局。

图 2-9 The layout of a track aperture mode dimensions atom
Track Clean Aperture Dimensions Atom

这个atom携带轨道的clean aperture的像素尺寸。 track clean aperture dimensions atom的类型是'clef'。

图 2-10 显示了track clean aperture dimensions atom的布局。

图 2-10 The layout of a track clean aperture dimensions atom.jpg
Track Production Aperture Dimensions Atom

该atom携带轨道的production aperture的像素尺寸。 track production aperture dimensions atom的类型是“prof”。

图 2-11 显示了track production aperture dimensions atom的布局。

图 2-11 The layout of a track production aperture dimensions atom
Track Encoded Pixels Dimensions Atom

该atom携带轨道编码像素的像素尺寸。 track encoded pixels dimensions atom的类型是'enof'。
图 2-12 显示了这个atom的布局。

图 2-12 The layout of a track encoded pixels dimensions atom

Clipping Atoms

Clipping atoms指定movie和轨道的剪辑区域。 Clipping atom的atom类型值为'clip'。

图 2-13 显示了这个atom的布局。

图 2-13 The layout of a clipping atom

Clipping atoms包含以下数据元素。

Clipping Region Atoms

Clipping Region Atoms包含指定clipping region的数据,包括其大小,边界框和区域。 Clipping region atoms具有atom类型值“crgn”。

Clipping region atom的布局如图 2-13 所示。

Clipping region atom包含以下数据元素。

Track Matte Atoms

Track matte atoms用于在显示轨迹图像时可视地混合轨迹图像。

track matte atoms的atom类型值为'matt'。

图 2-14 显示了track matte atoms的布局。

图 2-14 The layout of a track matte atom

track matte atoms包含以下数据元素。

Compressed Matte Atoms

Compressed matte atom指定图像描述结构和与特定matte atom相关联的遮罩数据。 Compressed matte atoms的atom类型值为'kmat'。

Compressed matte atoms的布局如图 2-14所示。

Compressed matte atoms包含以下数据元素。

Edit Atoms

您可以使用edit atoms来定义要用于为movie建立轨道的媒体部分。 edit本身包含在edit list table中,该表由每个段的时间偏移量和持续时间值组成。 Edit atoms的原子类型值为'edts'。

图 2-15显示了edit atom的布局。

在没有edit list的情况下,轨道的呈现立即开始。 空的edit用于补偿曲目的开始时间。

📝 注意:如果缺少edit atom或edit list atom,则可以假定轨道使用整个媒体。

图 2-15 The layout of an edit atom

Edit atoms包含以下数据元素。

Edit List Atoms

使用edit list atom(如图 2-15 所示)可将电影中的时间映射到媒体中的时间,最终映射到媒体数据。 此信息以edit list table表中的条目的形式显示,如图 2-16 所示。 edit list atoms的atom类型值为'elst'。

edit list atoms包含以下数据元素。

Track Load Settings Atoms

Track load settings atoms包含指示如何在其电影中使用轨道的信息。 读取QuickTime文件的应用程序可以使用此信息更高效地处理电影数据。 track load settings atoms的atom类型值为'load'。

图 2-17 显示了这个atom的布局。

图 2-17 The layout of a track load settings atom
Track load settings atoms包含以下数据元素。

Track Reference Atoms

Track reference atoms定义轨道之间的关系。Track reference atoms允许一个轨道指定它如何与其他轨道相关。例如,如果电影有三个视频轨道和三个音轨,track reference允许您识别相关的声音和视频轨道。track reference atom具有atom类型值“tref”。

Track reference是单向的,并从接收轨道指向源轨道。例如,视频轨道可以参考时间代码轨道以指示其时间代码被存储在何处,但是时间代码轨道将不参考视频轨道。时间码轨道(time code track)是视频轨道的时间信息的源。

单个轨道可以引用多个轨道。例如,视频轨道可以参考声音轨迹以指示两者是同步的,并且指示时间代码轨道以指示其时间代码被存储在何处。

单个轨道也可以由多个轨道引用。例如,如果声音和视频轨道共享相同的定时信息,则它们可以引用相同的时间代码轨道。

如果这个atom不存在,轨道不以任何方式引用任何其他轨道。 注意,track reference type atoms的阵列的大小被设置为填充track reference atom。 允许使用参考索引为0的轨道引用。 这表示没有参考。

有关Track References的更多信息,请参阅Track References

图 2-18 显示了track reference atom的布局。

图 2-18 The layout of a track reference atom
Track reference atom包含以下数据元素。

每个track reference atom定义与特定类型的轨道的关系。 参考类型意味着轨道类型。 表2-2显示了轨道参考类型及其说明。

表 2-2 轨道参考类型(Track reference types)

Reference type Description
'cdsc' The track reference is contained in a timed metadata track (see Timed Metadata Media for more detail) and provides links to the tracks for which it contains descriptive characteristics.Note: If the timed metadata track describes characteristics of the entire movie, there will be no track reference of type ‘cdsc’ between it and another track.
'chap' Chapter or scene list. Usually references a text track.
'clcp' Closed caption. In any track, this identifies a closed captioning track that contains text that is appropriate for the referring track. See Closed Captioning Media for more information.
'fall' In a sound track, this references a track in a different format but with identical content, if one exists; for example, an AC3 track might reference an AAC track with identical content. See Alternate Sound Tracks.
'folw' In a sound track, this references a subtitle track that is to be used as the sound track’s default subtitle track. If the subtitle track is part of a subtitle track pair, this should reference the the forced subtitle track of the pair. This is needed only if language tagging cannot be used. See Relationships Across Alternate Groups.
'forc' Forced subtitle track. In the regular track of a subtitle track pair, this references the forced track. See Subtitle Sample Data for more information.
'hint' The referenced tracks contain the original media for this hint track.
'scpt' Transcript. Usually references a text track.
'ssrc' Non-primary source. Indicates that the referenced track should send its data to this track, rather than presenting it. The referencing track will use the data to modify how it presents its data. See Track Input Map Atoms for more information.
'sync' Synchronization. Usually between a video and sound track. Indicates that the two tracks are synchronized. The reference can be from either track to the other, or there may be two references.
'tmcd' Time code. Usually references a time code track.

每个track reference type atom包含以下数据元素。

您可以通过从track reference type atom的总大小减去其头大小,然后除以轨道ID的大小(以字节为单位)来确定存储在track reference type atom中的轨道引用数。

Track Input Map Atoms

Track input map atoms定义如何解释从其非主要源发送到该轨道的数据。 “ssrc”类型的轨道引用定义了轨道的辅助数据源。 这些源提供在处理轨道时使用的附加数据。 track input map atoms具有atom类型值“imap”。

图 2-19 显示了track input atom的布局。 该atom包含一个或多个track input atoms。 注意,track input map atom是QT atom结构。

图 2-19 The layout of a track input map atom

每个track input map atom包含以下数据元素。

输入映射(input map)定义了所有轨道的辅助输入。 每个辅助输入使用单独的track input atom来定义。

每个track input atom包含以下数据元素。

Track input atom又可以包含两种其他类型的atom:input type atoms和object ID atoms。 input type atom是必需的; 它指定如何解释数据。

input type atom包含以下数据元素。

表 2-3 输入类型(Input types)

Input identifier Value Description
kTrackModifierTypeMatrix 1 A 3 × 3 transformation matrix to transform the track’s location, scaling, and so on.
kTrackModifierTypeClip 2 A QuickDraw clipping region to change the track’s shape.
kTrackModifierTypeVolume 3 An 8.8 fixed-point value indicating the relative sound volume. This is used for fading the volume.
kTrackModifierTypeBalance 4 A 16-bit integer indicating the sound balance level. This is used for panning the sound location.
kTrackModifierTypeGraphicsMode 5 A graphics mode record (32-bit integer indicating graphics mode, followed by an RGB color) to modify the track’s graphics mode for visual fades.
kTrackModifierObjectMatrix 6 A 3 × 3 transformation matrix to transform an object within the track’s location, scaling, and so on.
kTrackModifierObjectGraphicsMode 7 A graphics mode record (32-bit integer indicating graphics mode, followed by an RGB color) to modify an object within the track’s graphics mode for visual fades.
kTrackModifierTypeImage 'vide’ Compressed image data for an object within the track. Note that this was kTrackModifierTypeSpriteImage.

如果输入对轨道内的对象(例如,子画面轨道内的子画面)进行操作,则obejct ID atom必须包括在track input atom中以识别对象。

object ID atom包含以下数据元素。

Media Atoms

Media atoms描述和定义轨道的媒体类型和样本数据。 media atom包含指定以下内容的信息:

media atom的原子类型为“mdia”。 它必须包含媒体头(media header)('mdhd')atom,它可以包含处理程序引用(handler reference)('hdlg')atom,媒体信息(media information)('minf')atom和用户数据(user data)('udta')atom。

📝 注意:不要混淆media atom('media')与media data atom('mdat')。 media atom只包含对media data的引用; media data atom包含实际的媒体采样。

图 2-20 显示了media atom的布局。

图 2-20 The layout of a media atom

Media atoms包含以下数据元素。

Media Header Atoms

Media header atoms指定媒体的特性,包括时间尺度和持续时间。 Media header atom的atom类型为“mdhd”。

图 2-21 显示了media header atom的布局。

图 2-21 The layout of a media header atom
Media header atom包含以下数据元素。

To be Continue

译者注:
第一次翻译英文文档,纯手工翻译,难免出现错误,欢迎指正!感谢!
资料链接:[英文原文][Movie Atoms]

上一篇下一篇

猜你喜欢

热点阅读