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