An ISO BMFF media segment is defined in this specification as one optional Segment Type Box (styp) followed by a single Movie Fragment Box (moof) followed by one or more Media Data Boxes (mdat). If the Segment Type Box is not present, the segment must conform to the brands listed in the File Type Box (ftyp) in the initialization segment.
Valid top-level boxes defined in ISO/IEC 14496-12 other than ftyp, moov, styp, moof, and mdat are allowed to appear between the end of an initialization segment or media segment and before the beginning of a new media segment. These boxes must be accepted and ignored by the user agent and are not considered part of the media segment in this specification.
The user agent must run the append error algorithm if any of the following conditions are met:
A box or field in the Movie Fragment Box is encountered that violates the requirements mandated by the major_brand or one of the compatible_brands in the Segment Type Box in this media segment or the File Type Box in the initialization segment if a Segment Type Box is not present.
This media segment contains a Segment Type Box that is not compatible with the File Type Box in the initialization segment.
The Movie Fragment Box does not contain at least one Track Fragment Box (traf).
The Movie Fragment Box does not use movie-fragment relative addressing.
External data references are being used.
At least one Track Fragment Box does not contain a Track Fragment Decode Time Box (tfdt)
The Media Data Boxes do not contain all the samples referenced by the Track Fragment Run Boxes (trun) of the Movie Fragment Box.
Inband parameter sets are not present in the appropriate samples and parameter sets are not present in the last initialization segment appended.
A Movie Fragment Box uses movie-fragment relative addressing when the first Track Fragment Run(trun) box in each Track Fragment Box has the data-offset-present flag set and either of the following conditions are met:
Every Track Fragment Box in a Movie Fragment Box has the default-base-is-moof flag set.
NOTE: This implies that the base-data-offset-present flag is not set.
The Movie Fragment Box contains a single Track Fragment Box and that box does not have the base-data-offset-present flag set.
https://www.w3.org/TR/mse-byte-stream-format-isobmff/#h-iso-media-segments