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