2.2.4.7 TrunBox

The TrunBox field 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 that is defined in [ISO/IEC-14496-12].

TrunBox (variable): The container for per-sample metadata.

TrunBoxLength (4 bytes): The length of the TrunBox field, in bytes, including the 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, the default value that is 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, the default value that is 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, the default value that is 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 field 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 that are defined by the TimeScale for the track. This field MUST be present if and only if the SampleDurationPresent field 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 that are 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: