OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/st
rict.dtd"> |
| 2 <html> |
| 3 <head> |
| 4 <link rel="stylesheet" type="text/css" href="opus_in_isobmff.css"/> |
| 5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
| 6 <title>Encapsulation of Opus in ISO Base Media File Format</title> |
| 7 </head> |
| 8 <body bgcolor="0x333333" text="#60B0C0"> |
| 9 <b><u>Encapsulation of Opus in ISO Base Media File Format</u></b><br> |
| 10 <font size="2">last updated: January 12, 2015</font><br> |
| 11 <br> |
| 12 <div class="normal_link pre frame_box"> |
| 13 |
| 14 Encapsulation of Opus in ISO Base Media File For
mat |
| 15 Version 0.6.6 (incomplete) |
| 16 |
| 17 |
| 18 Table of Contents |
| 19 <a href="#1">1</a> Scope |
| 20 <a href="#2">2</a> Normative References |
| 21 <a href="#3">3</a> Terms and Definitions |
| 22 <a href="#4">4</a> Design Rules of Encapsulation |
| 23 <a href="#4.1">4.1</a> File Type Indentification |
| 24 <a href="#4.2">4.2</a> Overview of Track Structure |
| 25 <a href="#4.3">4.3</a> Definitions of Opus sample |
| 26 <a href="#4.3.1">4.3.1</a> Sample entry format |
| 27 <a href="#4.3.2">4.3.2</a> Opus Specific Box |
| 28 <a href="#4.3.3">4.3.3</a> Sample format |
| 29 <a href="#4.3.4">4.3.4</a> Duration of Opus sample |
| 30 <a href="#4.3.5">4.3.5</a> Sub-sample |
| 31 <a href="#4.3.6">4.3.6</a> Random Access |
| 32 <a href="#4.3.6.1">4.3.6.1</a> Random Access Point |
| 33 <a href="#4.3.6.2">4.3.6.2</a> Pre-roll |
| 34 <a href="#4.4">4.4</a> Trimming of Actual Duration |
| 35 <a href="#4.5">4.5</a> Channel Layout (informative) |
| 36 <a href="#4.6">4.6</a> Basic Structure (informative) |
| 37 <a href="#4.6.1">4.6.2</a> Initial Movie |
| 38 <a href="#4.6.2">4.6.3</a> Movie Fragments |
| 39 <a href="#4.7">4.7</a> Example of Encapsulation (informative) |
| 40 <a href="#5">5</a> Author's Address |
| 41 |
| 42 <a name="1"></a> |
| 43 1 Scope |
| 44 This specification specifies the fundamental way of the encapsulation of Opu
s coded bitstreams in ISO Base Media |
| 45 file format and its derivatives. The encapsulation of Opus coded bitstreams
in QuickTime file format is outside |
| 46 the scope of this specification. |
| 47 |
| 48 <a name="2"></a> |
| 49 2 Normative References |
| 50 [1] ISO/IEC 14496-12:2012 Corrected version |
| 51 Information technology — Coding of audio-visual objects — Part 12: ISO b
ase media file format |
| 52 |
| 53 [2] ISO/IEC 14496-12:2012/Amd.1:2013 |
| 54 Information technology — Coding of audio-visual objects — Part 12: ISO b
ase media file format |
| 55 AMENDMENT 1: Various enhancements including support for large metadata |
| 56 |
| 57 [3] RFC 6716 |
| 58 Definition of the Opus Audio Codec |
| 59 |
| 60 [4] draft-ietf-codec-oggopus-06 |
| 61 Ogg Encapsulation for the Opus Audio Codec |
| 62 |
| 63 <a name="3"></a> |
| 64 3 Terms and Definitions |
| 65 3.1 active track |
| 66 enabled track from the non-alternate group or selected track from altern
ate group |
| 67 |
| 68 3.2 actual duration |
| 69 duration constructed from valid samples |
| 70 |
| 71 3.3 edit |
| 72 entry in the Edit List Box |
| 73 |
| 74 3.4 padded samples |
| 75 PCM samples after decoding Opus sample(s) which are not valid samples |
| 76 An Opus bitstream always contains them partially at the beginning and ma
y contain them in part at the end, as |
| 77 long as not physically removed yet at the beginning and/or the end. |
| 78 |
| 79 3.5 priming samples |
| 80 padded samples at the beginning of the Opus bitstream |
| 81 |
| 82 3.6 sample-accurate |
| 83 for any PCM sample, a timestamp exactly matching its sampling timestamp
is present in the media timeline. |
| 84 |
| 85 3.7 valid samples |
| 86 PCM samples after decoding Opus sample(s) corresponding to input PCM sam
ples |
| 87 |
| 88 <a name="4"></a> |
| 89 4 Design Rules of Encapsulation |
| 90 4.1 File Type Indentification<a name="4.1"></a> |
| 91 This specification does not define any brand to declare files are confor
mant to this specification. However, |
| 92 files conformant to this specification shall contain at least one brand,
which supports the requirements and the |
| 93 requirements described in this clause without contradiction, in the comp
atible brands list of the File Type Box. |
| 94 As an example, the minimal support of the encapsulation of Opus bitstrea
ms in ISO Base Media file format requires |
| 95 the 'iso2' brand in the compatible brands list since support of roll gro
ups is required. |
| 96 <a name="4.2"></a> |
| 97 4.2 Overview of Track Structure |
| 98 This clause summarizes requirements of the encapsulation of Opus coded b
itstream as media data in audio tracks |
| 99 in file formats compliant with the ISO Base Media File Format. The detai
ls are described in clauses after this |
| 100 clause. |
| 101 + The handler_type field in the Handler Reference Box shall be set t
o 'soun'. |
| 102 + The Media Information Box shall contain the Sound Media Header Box
. |
| 103 + The codingname of the sample entry is 'Opus'. |
| 104 This specification does not define any encapsulation using MP4Au
dioSampleEntry with objectTypeIndication |
| 105 specified by the MPEG-4 Registration Authority (http://www.mp4ra
.org/). |
| 106 See 4.3.1 Sample entry format to get the details about the sampl
e entry. |
| 107 + The 'dOps' box is added to the sample entry to convey initializing
information for the decoder. |
| 108 See 4.3.2 Opus Specific Box to get the details. |
| 109 + An Opus sample is exactly one Opus packet for each of different Op
us bitstreams. |
| 110 See 4.3.3 Sample format to get the details. |
| 111 + Every Opus sample is a sync sample but requires pre-roll for every
random access to get correct output. |
| 112 See 4.3.6 Random Access to get the details. |
| 113 <a name="4.3"></a> |
| 114 4.3 Definitions of Opus sample |
| 115 4.3.1 Sample entry format<a name="4.3.1"></a> |
| 116 For any track containing Opus bitstreams, at least one sample entry
describing corresponding Opus bitstream |
| 117 shall be present inside the Sample Table Box. This version of the sp
ecification defines only one sample |
| 118 entry format named OpusSampleEntry whose codingname is 'Opus'. This
sample entry includes exactly one Opus |
| 119 Specific Box defined in 4.3.2 as a mandatory box and indicates that
Opus samples described by this sample |
| 120 entry are stored by the sample format described in 4.3.3. |
| 121 |
| 122 The syntax and semantics of the OpusSampleEntry is shown as follows. |
| 123 |
| 124 class OpusSampleEntry() extends AudioSampleEntry ('Opus'){ |
| 125 OpusSpecificBox(); |
| 126 } |
| 127 |
| 128 + channelcount: |
| 129 The channelcount field shall be set to the sum of the total numb
er of Opus bitstreams and the number |
| 130 of Opus bitstreams producing two channels. This value is indenti
cal with (M+N), where M is the value of |
| 131 the *Coupled Stream Count* field and N is the value of the *Stre
am Count* field in the *Channel Mapping |
| 132 Table* in the identification header defined in Ogg Opus [4]. |
| 133 + samplesize: |
| 134 The samplesize field shall be set to 16. |
| 135 + samplerate: |
| 136 The samplerate field shall be set to 48000<<16. |
| 137 + OpusSpecificBox |
| 138 This box contains initializing information for the decoder as de
fined in 4.3.2. |
| 139 |
| 140 4.3.2 Opus Specific Box<a name="4.3.2"></a> |
| 141 Exactly one Opus Specific Box shall be present in each OpusSampleEnt
ry. |
| 142 The Opus Specific Box contains the Version field and this specificat
ion defines version 0 of this box. |
| 143 If incompatible changes occured in the fields after the Version fiel
d within the OpusSpecificBox in the |
| 144 future versions of this specification, another version will be defin
ed. |
| 145 This box refers to Ogg Opus [4] at many parts but all the data are s
tored as big-endian format. |
| 146 |
| 147 The syntax and semantics of the Opus Specific Box is shown as follow
s. |
| 148 |
| 149 class ChannelMappingTable (unsigned int(8) OutputChannelCount){ |
| 150 unsigned int(8) StreamCount; |
| 151 unsigned int(8) CoupledCount; |
| 152 unsigned int(8 * OutputChannelCount) ChannelMapping; |
| 153 } |
| 154 |
| 155 aligned(8) class OpusSpecificBox extends Box('dOps'){ |
| 156 unsigned int(8) Version; |
| 157 unsigned int(8) OutputChannelCount; |
| 158 unsigned int(16) PreSkip; |
| 159 unsigned int(32) InputSampleRate; |
| 160 signed int(16) OutputGain; |
| 161 unsigned int(8) ChannelMappingFamily; |
| 162 if (ChannelMappingFamily != 0) { |
| 163 ChannelMappingTable(OutputChannelCount); |
| 164 } |
| 165 } |
| 166 |
| 167 + Version: |
| 168 The Version field shall be set to 0. |
| 169 In the future versions of this specification, this field may be
set to other values. And without support |
| 170 of those values, the reader shall not read the fields after this
within the OpusSpecificBox. |
| 171 + OutputChannelCount: |
| 172 The OutputChannelCount field shall be set to the same value as t
he *Output Channel Count* field in the |
| 173 identification header defined in Ogg Opus [4]. |
| 174 + PreSkip: |
| 175 The PreSkip field indicates the number of the priming samples, t
hat is, the number of samples at 48000 Hz |
| 176 to discard from the decoder output when starting playback. The v
alue of the PreSkip field could be zero |
| 177 when removing Opus samples containing the number of PCM samples
equal to or more than of the priming |
| 178 samples. The PreSkip field is not used for discarding the primin
g samples at the whole playback at all |
| 179 since it is informative only, and that task falls on the Edit Li
st Box. |
| 180 + InputSampleRate: |
| 181 The InputSampleRate field shall be set to the same value as the
*Input Sample Rate* field in the |
| 182 identification header defined in Ogg Opus [4]. |
| 183 + OutputGain: |
| 184 The OutputGain field shall be set to the same value as the *Outp
ut Gain* field in the identification |
| 185 header define in Ogg Opus [4]. Note that the value is stored as
8.8 fixed-point. |
| 186 + ChannelMappingFamily: |
| 187 The ChannelMappingFamily field shall be set to the same value as
the *Channel Mapping Family* field in |
| 188 the identification header defined in Ogg Opus [4]. |
| 189 + StreamCount: |
| 190 The StreamCount field shall be set to the same value as the *Str
eam Count* field in the identification |
| 191 header defined in Ogg Opus [4]. |
| 192 + CoupledCount: |
| 193 The CoupledCount field shall be set to the same value as the *Co
upled Count* field in the identification |
| 194 header defined in Ogg Opus [4]. |
| 195 + ChannelMapping: |
| 196 The ChannelMapping field shall be set to the same octet string a
s *Channel Mapping* field in the identi- |
| 197 fication header defined in Ogg Opus [4]. |
| 198 |
| 199 4.3.3 Sample format<a name="4.3.3"></a> |
| 200 An Opus sample is exactly one Opus packet for each of different Opus
bitstreams. Due to support more than |
| 201 two channels, an Opus sample can contain frames from multiple Opus b
itstreams but all Opus packets shall |
| 202 share with the total of frame sizes in a single Opus sample. The way
of how to pack an Opus packet from |
| 203 each of Opus bitstreams into a single Opus sample follows Appendix B
. in RFC 6716 [3]. |
| 204 The endianness has nothing to do with any Opus sample since every Op
us packet is processed byte-by-byte. |
| 205 In this specification, 'sample' means 'Opus sample' except for 'padd
ed samples', 'priming samples', 'valid |
| 206 sample' and 'sample-accurate', i.e. 'sample' is 'sample' in the term
defined in ISO/IEC 14496-12 [1]. |
| 207 |
| 208 +-----------------------------------------+---------------------
----------------+ |
| 209 | Opus packet 0 (self-delimiting framing) | Opus packet 1 (undel
imited framing) | |
| 210 +-----------------------------------------+---------------------
----------------+ |
| 211 |<---------------------------- the size of Opus sample ---------
--------------->| |
| 212 |
| 213 Figure 1 - Example structure of an Opus sample containing tw
o Opus bitstreams |
| 214 |
| 215 4.3.4 Duration of Opus sample<a name="4.3.4"></a> |
| 216 The duration of Opus sample is given by multiplying the total of fra
me sizes for a single Opus bitstream |
| 217 expressed in seconds by the value of the timescale field in the Medi
a Header Box. |
| 218 Let's say an Opus sample consists of two Opus bitstreams, where the
frame size of one bitstream is 40 milli- |
| 219 seconds and the frame size of another is 60 milliseconds, and the ti
mescale field in the Media Header Box |
| 220 is set to 48000, then the duration of that Opus sample shall be 120
milliseconds since three 40 millisecond |
| 221 frame and two 60 millisecond frames shall be contained because of th
e maximum duration of Opus packet, 120 |
| 222 milliseconds, and 5760 in the timescale indicated in the Media Heade
r Box. |
| 223 |
| 224 To indicate the valid samples excluding the padded samples at the en
d of Opus bitstream, the duration of |
| 225 the last Opus sample of an Opus bitstream is given by multiplying th
e number of the valid samples by the |
| 226 value produced by dividing the value of the timescale field in the M
edia Header Box by 48000. |
| 227 |
| 228 4.3.5 Sub-sample<a name="4.3.5"></a> |
| 229 The structure of the last Opus packet in an Opus sample is different
from the others in the same Opus sample, |
| 230 and the others are invalid Opus packets as an Opus sample because of
self-delimiting framing. To avoid |
| 231 complexities, sub-sample is not defined for Opus sample in this spec
ification. |
| 232 |
| 233 4.3.6 Random Access<a name="4.3.6"></a> |
| 234 This subclause describes the nature of the random access of Opus sam
ple. |
| 235 |
| 236 4.3.6.1 Random Access Point<a name="4.3.6.1"></a> |
| 237 All Opus samples can be independently decoded i.e. every Opus sa
mple is a sync sample. Therefore, the |
| 238 Sync Sample Box shall not be present as long as there are no sam
ples other than Opus samples in the same |
| 239 track. And the sample_is_non_sync_sample field for Opus samples
shall be set to 0. |
| 240 |
| 241 4.3.6.2 Pre-roll<a name="4.3.6.2"></a> |
| 242 Opus bitstream requires at least 80 millisecond pre-roll after e
ach random access to get correct output. |
| 243 Pre-roll is indicated by the roll_distance field in AudioRollRec
overyEntry. AudioPreRollEntry shall not |
| 244 be used since every Opus sample is a sync sample in Opus bitstre
am. Note that roll_distance is expressed |
| 245 in sample units in a term of ISO Base Media File Format, and alw
ays takes negative values. |
| 246 |
| 247 For any track containing Opus bitstreams, at least one Sample Gr
oup Description Box and at least one |
| 248 Sample to Group Box within the Sample Table Box shall be present
and these have the grouping_type field |
| 249 set to 'roll'. If any Opus sample is contained in a track fragme
nt, the Sample to Group Box with the |
| 250 grouping_type field set to 'roll' shall be present for that trac
k fragment. |
| 251 |
| 252 For the requirement of AudioRollRecoveryEntry, the compatible_br
ands field in the File Type Box shall |
| 253 contain at least one brand which requires support for roll group
s. |
| 254 <a name="4.4"></a> |
| 255 4.4 Trimming of Actual Duration |
| 256 Due to the priming samples (or the padding at the beginning) derived fro
m the pre-roll for the startup and the |
| 257 padded samples at the end, we need trim from media to get the actual dur
ation. An edit in the Edit List Box can |
| 258 achieve this demand, and the Edit Box and the Edit List Box shall be pre
sent. |
| 259 |
| 260 For sample-accurate trimming, proper timescale should be set to the time
scale field in the Movie Header Box |
| 261 and the Media Header Box inside Track Box(es) for Opus bitstream. The ti
mescale field in the Media Header Box is |
| 262 typically set to 48000. It is recommended that the timescale field in th
e Movie Header Box be set to the same |
| 263 value of the timescale field in the Media Header Box in order to avoid t
he rounding problem when specifying |
| 264 duration of edit if the timescales in all of the Media Header Boxes are
set to the same value. |
| 265 |
| 266 For example, to indicate the actual duration of an Opus bitstream in a t
rack with the timescale fields of both |
| 267 the Movie Header Box and the Media Header Box set to 48000, we would use
the following edit: |
| 268 segment_duration = the number of the valid samples |
| 269 media_time = the number of the priming samples |
| 270 media_rate = 1 << 16 |
| 271 |
| 272 The Edit List Box is applied to whole movie including all movie fragment
s. Therefore, it is impossible to tell |
| 273 the actual duration in the case producing movie fragments on the fly suc
h as live-streaming. In such cases, |
| 274 the duration of the last Opus sample may be helpful by setting zero to t
he segment_duration field since the |
| 275 value 0 represents implicit duration equal to the sum of the duration of
all samples. |
| 276 <a name="4.5"></a> |
| 277 4.5 Channel Layout (informative) |
| 278 By the application of alternate_group in the Track Header Box, whole aud
io channels in all active tracks from |
| 279 non-alternate group and/or different alternate group from each other are
composited into the presentation. If |
| 280 an Opus sample consists of multiple Opus bitstreams, it can be splitted
into individual Opus bitstreams and |
| 281 reconstructed into new Opus samples as long as every Opus bitstream has
the same total duration in each Opus |
| 282 sample. This nature can be utilized to encapsulate a single Opus bitstre
am in each track without breaking the |
| 283 original channel layout. |
| 284 |
| 285 As an example, let's say there is a following track: |
| 286 OutputChannelCount = 6; |
| 287 StreamCount = 4; |
| 288 CoupledCount = 2; |
| 289 ChannelMapping = {0, 4, 1, 2, 3, 5}; // front left, front center
, front right, rear left, rear right, LFE |
| 290 Here, to couple front left to front right channels into the first stream
, and couple rear left to rear right |
| 291 channels into the second stream, reordering is needed since coupled stre
ams must precede any non-coupled stream. |
| 292 You extract the four Opus bitstreams from this track and you encapsulate
two of the four into a track and the |
| 293 others into another track. The former track is as follows. |
| 294 OutputChannelCount = 6; |
| 295 StreamCount = 2; |
| 296 CoupledCount = 2; |
| 297 ChannelMapping = {0, 255, 1, 2, 3, 255}; // front left, front ce
nter, front right, rear left, rear right, LFE |
| 298 And the latter track is as follows. |
| 299 OutputChannelCount = 6; |
| 300 StreamCount = 2; |
| 301 CoupledCount = 0; |
| 302 ChannelMapping = {255, 0, 255, 255, 255, 1}; // front left, fron
t center, front right, rear left, rear right, LFE |
| 303 In addition, the value of the alternate_group field in the both tracks i
s set to 0. As the result, the player |
| 304 may play as if channels with 255 are not present, and play the presentat
ion constructed from the both tracks |
| 305 in the same channel layout as the one of the original track. Keep in min
d that the way of the composition, i.e. |
| 306 the mixing for playback, is not defined here, and maybe different result
s could occur except for the channel |
| 307 layout of the original, depending on an implementation or the definition
of a derived file format. |
| 308 |
| 309 Note that some derived file formats may specify the restriction to ignor
e alternate grouping. In the context of |
| 310 such file formats, this application is not available. This unavailabilit
y does not mean incompatibilities among |
| 311 file formats unless the restriction to the value of the alternate_group
field is specified and brings about |
| 312 any conflict among their definitions. |
| 313 <a name="4.6"></a> |
| 314 4.6 Basic Structure (informative) |
| 315 4.6.1 Initial Movie<a name="4.6.1"></a> |
| 316 This subclause shows a basic structure of the Movie Box as follows: |
| 317 |
| 318 +----+----+----+----+----+----+----+----+---------------------------
---+ |
| 319 |moov| | | | | | | | Movie Box
| |
| 320 +----+----+----+----+----+----+----+----+---------------------------
---+ |
| 321 | |mvhd| | | | | | | Movie Header Box
| |
| 322 +----+----+----+----+----+----+----+----+---------------------------
---+ |
| 323 | |trak| | | | | | | Track Box
| |
| 324 +----+----+----+----+----+----+----+----+---------------------------
---+ |
| 325 | | |tkhd| | | | | | Track Header Box
| |
| 326 +----+----+----+----+----+----+----+----+---------------------------
---+ |
| 327 | | |edts| | | | | | Edit Box
| |
| 328 +----+----+----+----+----+----+----+----+---------------------------
---+ |
| 329 | | | |elst| | | | | Edit List Box
| |
| 330 +----+----+----+----+----+----+----+----+---------------------------
---+ |
| 331 | | |mdia| | | | | | Media Box
| |
| 332 +----+----+----+----+----+----+----+----+---------------------------
---+ |
| 333 | | | |mdhd| | | | | Media Header Box
| |
| 334 +----+----+----+----+----+----+----+----+---------------------------
---+ |
| 335 | | | |hdlr| | | | | Handler Reference Box
| |
| 336 +----+----+----+----+----+----+----+----+---------------------------
---+ |
| 337 | | | |minf| | | | | Media Information Box
| |
| 338 +----+----+----+----+----+----+----+----+---------------------------
---+ |
| 339 | | | | |smhd| | | | Sound Media Header Box
| |
| 340 +----+----+----+----+----+----+----+----+---------------------------
---+ |
| 341 | | | | |dinf| | | | Data Information Box
| |
| 342 +----+----+----+----+----+----+----+----+---------------------------
---+ |
| 343 | | | | | |dref| | | Data Reference Box
| |
| 344 +----+----+----+----+----+----+----+----+---------------------------
---+ |
| 345 | | | | | | |url | | DataEntryUrlBox
| |
| 346 +----+----+----+----+----+----+ or +----+---------------------------
---+ |
| 347 | | | | | | |urn | | DataEntryUrnBox
| |
| 348 +----+----+----+----+----+----+----+----+---------------------------
---+ |
| 349 | | | | |stbl| | | | Sample Table
| |
| 350 +----+----+----+----+----+----+----+----+---------------------------
---+ |
| 351 | | | | | |stsd| | | Sample Description Box
| |
| 352 +----+----+----+----+----+----+----+----+---------------------------
---+ |
| 353 | | | | | | |Opus| | OpusSampleEntry
| |
| 354 +----+----+----+----+----+----+----+----+---------------------------
---+ |
| 355 | | | | | | | |dOps| Opus Specific Box
| |
| 356 +----+----+----+----+----+----+----+----+---------------------------
---+ |
| 357 | | | | | |stts| | | Decoding Time to Sample Bo
x | |
| 358 +----+----+----+----+----+----+----+----+---------------------------
---+ |
| 359 | | | | | |stsc| | | Sample To Chunk Box
| |
| 360 +----+----+----+----+----+----+----+----+---------------------------
---+ |
| 361 | | | | | |stsz| | | Sample Size Box
| |
| 362 +----+----+----+----+----+ or +----+----+---------------------------
---+ |
| 363 | | | | | |stz2| | | Compact Sample Size Box
| |
| 364 +----+----+----+----+----+----+----+----+---------------------------
---+ |
| 365 | | | | | |stco| | | Chunk Offset Box
| |
| 366 +----+----+----+----+----+ or +----+----+---------------------------
---+ |
| 367 | | | | | |co64| | | Chunk Large Offset Box
| |
| 368 +----+----+----+----+----+----+----+----+---------------------------
---+ |
| 369 | | | | | |sgpd| | | Sample Group Description B
ox | |
| 370 +----+----+----+----+----+----+----+----+---------------------------
---+ |
| 371 | | | | | |sbgp| | | Sample to Group Box
| |
| 372 +----+----+----+----+----+----+----+----+---------------------------
---+ |
| 373 | |mvex|* | | | | | | Movie Extends Box
| |
| 374 +----+----+----+----+----+----+----+----+---------------------------
---+ |
| 375 | | |trex|* | | | | | Track Extends Box
| |
| 376 +----+----+----+----+----+----+----+----+---------------------------
---+ |
| 377 |
| 378 Figure 2 - Basic structure of Movie Box |
| 379 |
| 380 It is strongly recommended that the order of boxes should follow the
above structure. |
| 381 Boxes marked with an asterisk (*) may be present. |
| 382 For most boxes listed above, the definition is as is defined in ISO/
IEC 14496-12 [1]. The additional boxes |
| 383 and the additional requirements, restrictions and recommendations to
the other boxes are described in this |
| 384 specification. |
| 385 |
| 386 4.6.2 Movie Fragments<a name="4.6.2"></a> |
| 387 This subclause shows a basic structure of the Movie Fragment Box as
follows: |
| 388 |
| 389 +----+----+----+----+----+----+----+----+---------------------------
---+ |
| 390 |moof| | | | | | | | Movie Fragment Box
| |
| 391 +----+----+----+----+----+----+----+----+---------------------------
---+ |
| 392 | |mfhd| | | | | | | Movie Fragment Header Box
| |
| 393 +----+----+----+----+----+----+----+----+---------------------------
---+ |
| 394 | |traf| | | | | | | Track Fragment Box
| |
| 395 +----+----+----+----+----+----+----+----+---------------------------
---+ |
| 396 | | |tfhd| | | | | | Track Fragment Header Box
| |
| 397 +----+----+----+----+----+----+----+----+---------------------------
---+ |
| 398 | | |trun| | | | | | Track Fragment Run Box
| |
| 399 +----+----+----+----+----+----+----+----+---------------------------
---+ |
| 400 | | |sgpd|* | | | | | Sample Group Description B
ox | |
| 401 +----+----+----+----+----+----+----+----+---------------------------
---+ |
| 402 | | |sbgp|* | | | | | Sample to Group Box
| |
| 403 +----+----+----+----+----+----+----+----+---------------------------
---+ |
| 404 |
| 405 Figure 3 - Basic structure of Movie Fragment Box |
| 406 |
| 407 It is strongly recommended that the Movie Fragment Header Box and th
e Track Fragment Header Box be |
| 408 placed first in their container. |
| 409 Boxes marked with an asterisk (*) may be present. |
| 410 For the boxes listed above, the definition is as is defined in ISO/I
EC 14496-12 [1]. |
| 411 <a name="4.7"></a> |
| 412 4.7 Example of Encapsulation (informative) |
| 413 [File] |
| 414 size = 17790 |
| 415 [ftyp: File Type Box] |
| 416 position = 0 |
| 417 size = 24 |
| 418 major_brand = mp42 : MP4 version 2 |
| 419 minor_version = 0 |
| 420 compatible_brands |
| 421 brand[0] = mp42 : MP4 version 2 |
| 422 brand[1] = iso2 : ISO Base Media file format version 2 |
| 423 [moov: Movie Box] |
| 424 position = 24 |
| 425 size = 757 |
| 426 [mvhd: Movie Header Box] |
| 427 position = 32 |
| 428 size = 108 |
| 429 version = 0 |
| 430 flags = 0x000000 |
| 431 creation_time = UTC 2014/12/12, 18:41:19 |
| 432 modification_time = UTC 2014/12/12, 18:41:19 |
| 433 timescale = 48000 |
| 434 duration = 33600 (00:00:00.700) |
| 435 rate = 1.000000 |
| 436 volume = 1.000000 |
| 437 reserved = 0x0000 |
| 438 reserved = 0x00000000 |
| 439 reserved = 0x00000000 |
| 440 transformation matrix |
| 441 | a, b, u | | 1.000000, 0.000000, 0.000000 | |
| 442 | c, d, v | = | 0.000000, 1.000000, 0.000000 | |
| 443 | x, y, w | | 0.000000, 0.000000, 1.000000 | |
| 444 pre_defined = 0x00000000 |
| 445 pre_defined = 0x00000000 |
| 446 pre_defined = 0x00000000 |
| 447 pre_defined = 0x00000000 |
| 448 pre_defined = 0x00000000 |
| 449 pre_defined = 0x00000000 |
| 450 next_track_ID = 2 |
| 451 [iods: Object Descriptor Box] |
| 452 position = 140 |
| 453 size = 33 |
| 454 version = 0 |
| 455 flags = 0x000000 |
| 456 [tag = 0x10: MP4_IOD] |
| 457 expandableClassSize = 16 |
| 458 ObjectDescriptorID = 1 |
| 459 URL_Flag = 0 |
| 460 includeInlineProfileLevelFlag = 0 |
| 461 reserved = 0xf |
| 462 ODProfileLevelIndication = 0xff |
| 463 sceneProfileLevelIndication = 0xff |
| 464 audioProfileLevelIndication = 0xfe |
| 465 visualProfileLevelIndication = 0xff |
| 466 graphicsProfileLevelIndication = 0xff |
| 467 [tag = 0x0e: ES_ID_Inc] |
| 468 expandableClassSize = 4 |
| 469 Track_ID = 1 |
| 470 [trak: Track Box] |
| 471 position = 173 |
| 472 size = 608 |
| 473 [tkhd: Track Header Box] |
| 474 position = 181 |
| 475 size = 92 |
| 476 version = 0 |
| 477 flags = 0x000007 |
| 478 Track enabled |
| 479 Track in movie |
| 480 Track in preview |
| 481 creation_time = UTC 2014/12/12, 18:41:19 |
| 482 modification_time = UTC 2014/12/12, 18:41:19 |
| 483 track_ID = 1 |
| 484 reserved = 0x00000000 |
| 485 duration = 33600 (00:00:00.700) |
| 486 reserved = 0x00000000 |
| 487 reserved = 0x00000000 |
| 488 layer = 0 |
| 489 alternate_group = 0 |
| 490 volume = 1.000000 |
| 491 reserved = 0x0000 |
| 492 transformation matrix |
| 493 | a, b, u | | 1.000000, 0.000000, 0.000000 | |
| 494 | c, d, v | = | 0.000000, 1.000000, 0.000000 | |
| 495 | x, y, w | | 0.000000, 0.000000, 1.000000 | |
| 496 width = 0.000000 |
| 497 height = 0.000000 |
| 498 [edts: Edit Box] |
| 499 position = 273 |
| 500 size = 36 |
| 501 [elst: Edit List Box] |
| 502 position = 281 |
| 503 size = 28 |
| 504 version = 0 |
| 505 flags = 0x000000 |
| 506 entry_count = 1 |
| 507 entry[0] |
| 508 segment_duration = 33600 |
| 509 media_time = 312 |
| 510 media_rate = 1.000000 |
| 511 [mdia: Media Box] |
| 512 position = 309 |
| 513 size = 472 |
| 514 [mdhd: Media Header Box] |
| 515 position = 317 |
| 516 size = 32 |
| 517 version = 0 |
| 518 flags = 0x000000 |
| 519 creation_time = UTC 2014/12/12, 18:41:19 |
| 520 modification_time = UTC 2014/12/12, 18:41:19 |
| 521 timescale = 48000 |
| 522 duration = 34560 (00:00:00.720) |
| 523 language = und |
| 524 pre_defined = 0x0000 |
| 525 [hdlr: Handler Reference Box] |
| 526 position = 349 |
| 527 size = 51 |
| 528 version = 0 |
| 529 flags = 0x000000 |
| 530 pre_defined = 0x00000000 |
| 531 handler_type = soun |
| 532 reserved = 0x00000000 |
| 533 reserved = 0x00000000 |
| 534 reserved = 0x00000000 |
| 535 name = Xiph Audio Handler |
| 536 [minf: Media Information Box] |
| 537 position = 400 |
| 538 size = 381 |
| 539 [smhd: Sound Media Header Box] |
| 540 position = 408 |
| 541 size = 16 |
| 542 version = 0 |
| 543 flags = 0x000000 |
| 544 balance = 0.000000 |
| 545 reserved = 0x0000 |
| 546 [dinf: Data Information Box] |
| 547 position = 424 |
| 548 size = 36 |
| 549 [dref: Data Reference Box] |
| 550 position = 432 |
| 551 size = 28 |
| 552 version = 0 |
| 553 flags = 0x000000 |
| 554 entry_count = 1 |
| 555 [url : Data Entry Url Box] |
| 556 position = 448 |
| 557 size = 12 |
| 558 version = 0 |
| 559 flags = 0x000001 |
| 560 location = in the same file |
| 561 [stbl: Sample Table Box] |
| 562 position = 460 |
| 563 size = 321 |
| 564 [stsd: Sample Description Box] |
| 565 position = 468 |
| 566 size = 79 |
| 567 version = 0 |
| 568 flags = 0x000000 |
| 569 entry_count = 1 |
| 570 [Opus: Audio Description] |
| 571 position = 484 |
| 572 size = 63 |
| 573 reserved = 0x000000000000 |
| 574 data_reference_index = 1 |
| 575 reserved = 0x0000 |
| 576 reserved = 0x0000 |
| 577 reserved = 0x00000000 |
| 578 channelcount = 6 |
| 579 samplesize = 16 |
| 580 pre_defined = 0 |
| 581 reserved = 0 |
| 582 samplerate = 48000.000000 |
| 583 [dOps: Opus Specific Box] |
| 584 position = 520 |
| 585 size = 27 |
| 586 Version = 0 |
| 587 OutputChannelCount = 6 |
| 588 PreSkip = 312 |
| 589 InputSampleRate = 48000 |
| 590 OutputGain = 0 |
| 591 ChannelMappingFamily = 1 |
| 592 StreamCount = 4 |
| 593 CoupledCount = 2 |
| 594 ChannelMapping |
| 595 0 -> 0: front left |
| 596 1 -> 4: fron center |
| 597 2 -> 1: front right |
| 598 3 -> 2: side left |
| 599 4 -> 3: side right |
| 600 5 -> 5: rear center |
| 601 [stts: Decoding Time to Sample Box] |
| 602 position = 547 |
| 603 size = 24 |
| 604 version = 0 |
| 605 flags = 0x000000 |
| 606 entry_count = 1 |
| 607 entry[0] |
| 608 sample_count = 18 |
| 609 sample_delta = 1920 |
| 610 [stsc: Sample To Chunk Box] |
| 611 position = 571 |
| 612 size = 40 |
| 613 version = 0 |
| 614 flags = 0x000000 |
| 615 entry_count = 2 |
| 616 entry[0] |
| 617 first_chunk = 1 |
| 618 samples_per_chunk = 13 |
| 619 sample_description_index = 1 |
| 620 entry[1] |
| 621 first_chunk = 2 |
| 622 samples_per_chunk = 5 |
| 623 sample_description_index = 1 |
| 624 [stsz: Sample Size Box] |
| 625 position = 611 |
| 626 size = 92 |
| 627 version = 0 |
| 628 flags = 0x000000 |
| 629 sample_size = 0 (variable) |
| 630 sample_count = 18 |
| 631 entry_size[0] = 977 |
| 632 entry_size[1] = 938 |
| 633 entry_size[2] = 939 |
| 634 entry_size[3] = 938 |
| 635 entry_size[4] = 934 |
| 636 entry_size[5] = 945 |
| 637 entry_size[6] = 948 |
| 638 entry_size[7] = 956 |
| 639 entry_size[8] = 955 |
| 640 entry_size[9] = 930 |
| 641 entry_size[10] = 933 |
| 642 entry_size[11] = 934 |
| 643 entry_size[12] = 972 |
| 644 entry_size[13] = 977 |
| 645 entry_size[14] = 958 |
| 646 entry_size[15] = 949 |
| 647 entry_size[16] = 962 |
| 648 entry_size[17] = 848 |
| 649 [stco: Chunk Offset Box] |
| 650 position = 703 |
| 651 size = 24 |
| 652 version = 0 |
| 653 flags = 0x000000 |
| 654 entry_count = 2 |
| 655 chunk_offset[0] = 797 |
| 656 chunk_offset[1] = 13096 |
| 657 [sgpd: Sample Group Description Box] |
| 658 position = 727 |
| 659 size = 26 |
| 660 version = 1 |
| 661 flags = 0x000000 |
| 662 grouping_type = roll |
| 663 default_length = 2 (constant) |
| 664 entry_count = 1 |
| 665 roll_distance[0] = -2 |
| 666 [sbgp: Sample to Group Box] |
| 667 position = 753 |
| 668 size = 28 |
| 669 version = 0 |
| 670 flags = 0x000000 |
| 671 grouping_type = roll |
| 672 entry_count = 1 |
| 673 entry[0] |
| 674 sample_count = 18 |
| 675 group_description_index = 1 |
| 676 [free: Free Space Box] |
| 677 position = 781 |
| 678 size = 8 |
| 679 [mdat: Media Data Box] |
| 680 position = 789 |
| 681 size = 17001 |
| 682 <a name="5"></a> |
| 683 5 Authors' Address |
| 684 Yusuke Nakamura |
| 685 Email: muken.the.vfrmaniac |at| gmail.com |
| 686 </div> |
| 687 </body> |
| 688 </html> |
OLD | NEW |