An HLS player reads the playlist. When a quality level is started, it downloads additional files. If videos are delivered as fragmented MP4, that quality level requires initialization data matching its stream. The address for this data is found in the media playlist.
Read the entry corresponding to the selected level
First, open the media playlist for the affected level. The parent playlist may lead to different video or audio variants. In the media playlist, EXT-X-MAP specifies the initialization for the following segments until a new entry appears or the list ends. The URI may point to a separate file. If a byte range is specified, the initialization is located within that portion of the referenced resource.
RFC 8216 · Validity Scope and Fields of EXT-X-MAP
In our own example: assigning initialization and fragments
In a local test, the playlist includes the entry EXT-X-MAP:URI="init.mp4". Following this, three files—teil-00.m4s, teil-01.m4s, and teil-02.m4s—are listed, each representing two seconds of content. The init.mp4 file contains container segments ftyp and moov, providing information about the format and track structure. The next three files include moof and mdat segments with fragment metadata and media data.
ffprobe read all 72 frames of the six-second test video from the complete playlist. It found no video frames when we supplied the first fragment on its own. The initialization section provides the track information needed to read the fragments.
RFC 8216 · Initialization and fMP4 Fragment Construction
Apple · Example of a media playlist with a separate initialization segment
When an error occurs, verify the actually loaded path.
- Read the EXT-X-MAP entry that applies to the affected fragments. Resolve relative addresses starting from the URL of this media playlist.
- When performing a custom integration within the network protocol, verify that the player receives the specified file or the designated segment. Ensure that the response actually corresponds to the currently used fragments.
- Compare the media playlist version with the initialization and fragments from the same package after a recent update of the video package. Then test the startup of the affected quality level.
Understanding the role of variants, media playlists, and segments
Verify whether the HLS recording extends until the expected end time