Export (0) Print
Expand All

2.2.4.7 TrunBox

The TrunBox and related fields encapsulate per sample metadata for the requested fragment. The syntax of TrunBox is a strict subset of the syntax of the Track Fragment Run Box defined in [ISO/IEC-14496-12].

TrunBox (variable): Container for per sample metadata.

TrunBoxLength (4 bytes): The length of the TrunBox field, in bytes, including TrunBoxLength field. If the value of the TrunBoxLength field is %00.00.00.01, the TrunBoxLongLength field MUST be present.

TrunBoxLongLength (8 bytes): The length of the TrunBox field, in bytes, including the TrunBoxLongLength field.

SampleCount (4 bytes): The number of samples in the fragment.

FirstSampleFlagsPresent (1 bit): Indicates that the default flags for the first sample are replaced if this field takes the value %b1.

SampleSizePresent (1 bit): Indicates that each sample has its own size if this field takes the value %b1. If this field is not present, then the default value specified by the DefaultSampleSize field is used.

SampleDurationPresent (1 bit): Indicates that each sample has its own duration if this field takes the value %b1. If this field is not present, then the default value specified by the DefaultSampleDuration field is used.

SampleFlagsPresent (1 bit): Indicates that each sample has its own flags if this field takes the value %b1. If this field is not present, then the default value specified by the DefaultSampleFlags field is used.

SampleCompositionTimeOffsetPresent (1 bit): Indicates that each sample has a composition time offset if this field takes the value %b1.

FirstSampleFlags (4 bytes): The value of the SampleFlags field for the first sample. This field MUST be present if and only if the FirstSampleFlagsPresent takes the value %b1.

SampleSize (4 bytes): The size of each sample, in bytes. This field MUST be present if and only if the SampleSizePresent field takes the value %b1. If this field is not present, its implicit value is the value of the DefaultSampleSize field.

SampleDuration (4 bytes): The duration of each sample, in increments defined by the TimeScale for the track. This field MUST be present if and only if SampleDurationPresent takes the value %b1. If this field is not present, its implicit value is the value of the DefaultSampleDuration field.

TrunBoxSampleFlags (4 bytes): The Sample flags of each sample. This field MUST be present if and only if the SampleFlagsPresent field takes the value %b1. If this field is not present, its implicit value is the value of the DefaultSampleFlags field. If the FirstSampleFlags field is present and this field is omitted, this field's implicit value for the first sample in the fragment MUST be the value of the FirstSampleFlags field.

SampleCompositionTimeOffset (4 bytes): The Sample Composition Time offset of each sample, as defined in [ISO/IEC-14496-12]. This field MUST be present if and only if the SampleCompositionTimeOffsetPresent field takes the value %b1.

The syntax of the fields defined in this section, specified in ABNF [RFC5234], is as follows:

TrunBox = TrunBoxLength TrunBoxType [TrunBoxLongLength] TrunBoxFields                                                          
          TrunBoxChildren                                                          
TrunBoxType = %d116 %d114 %d117 %d110                                                          
TrunBoxLength = BoxLength                                                          
TrunBoxLongLength = LongBoxLength                                                          
TrunBoxFields = TrunBoxVersion                                                          
                TrunBoxFlags                                                          
                SampleCount                                                          
                [ FirstSampleFlags ]                                                           
                *( TrunBoxPerSampleFields )                                                          
                ; TrunBoxPerSampleFields MUST be repeated exactly SampleCount times                                                          
TrunBoxFlags = 12*12 RESERVED_BIT                                                           
               SampleCompositionTimeOffsetPresent                                                          
               SampleFlagsPresent                                                          
               SampleSizePresent                                                          
               SampleDurationPresent                                                          
               RESERVED_BIT                                                          
               RESERVED_BIT                                                          
               RESERVED_BIT                                                          
               RESERVED_BIT                                                          
               RESERVED_BIT                                                          
               FirstSampleFlagsPresent                                                          
               RESERVED_BIT                                                          
               RESERVED_BIT                                                          
SampleCompositionTimeOffsetPresent = BIT                                                          
SampleFlagsPresent = BIT                                                          
SampleSizePresent = BIT                                                          
SampleDurationPresent = BIT                                                          
FirstSampleFlagsPresent = BIT                                                          
FirstSampleFlags = SampleFlags                                                          
TrunBoxPerSampleFields = [ SampleDuration ]                                                           
                         [ SampleSize ]                                                           
                         [ TrunBoxSampleFlags ]                                                           
                         [ SampleCompositionTimeOffset ]                                                          
SampleDuration = UNSIGNED_INT32                                                          
SampleSize = UNSIGNED_INT32                                                          
TrunBoxSampleFlags = SampleFlags                                                          
SampleCompositionTimeOffset = UNSIGNED_INT32                                                          
TrunBoxChildren = *( VendorExtensionUUIDBox )
 
Show:
© 2015 Microsoft