Offer multiple playlist files to provide different encodings of the same content.
The master playlist describes all of the available variants for your content. Each variant is a version of the stream at a particular bit rate and is contained in a separate playlist. The client switches to the most appropriate variant based on the measured network bit rate. The client’s player is tuned to minimize stalling of playback, to give the user the best possible streaming experience.
A master playlist isn't re-read. Once the client has read the master playlist, it assumes the set of variations isn't changing. The stream ends as soon as the client sees the
EXT-X-ENDLIST tag on one of the individual variant playlists.
The following example shows a master playlist that defines five different variants:
These are the tags used in the master playlist example:
EXTM3U: Indicates that the playlist is an extended M3U file. This type of file is distinguished from a basic M3U file by changing the tag on the first line to EXTM3U. All HLS playlists must start with this tag.
EXT-X-STREAM-INF: Indicates that the next URL in the playlist file identifies another playlist file. The
EXT-X-STREAM-INF tag has the following parameters:
AVERAGE-BANDWIDTH: (Optional, but recommended) An integer that represents the average bit rate for the variant stream.
BANDWIDTH: (Required) An integer that is the upper bound of the overall bitrate for each media file, in bits per second. The upper bound value is calculated to include any container overhead that appears or will appear in the playlist.
FRAME-RATE: (Optional, but recommended) A floating-point value that describes the maximum frame rate in a variant stream.
HDCP-LEVEL: (Optional) Indicates the type of encryption used. Valid values are
TYPE-0if the stream may not play unless the output is protected by HDCP.
RESOLUTION: (Optional, but recommended) The optional display size size, in pixels, at which to display all of the video in the playlist. This parameter should be included for any stream that includes video.
VIDEO-RANGE: (Required depending on encoding) A string with valid values of
PQ. If transfer characteristic codes 1, 16, or 18 aren't specified, then this parameter must be omitted.
CODECS: (Optional, but recommended) A quoted string containing a comma-separated list of formats, where each format specifies a media sample type that's present in a media segment in the playlist file. Valid format identifiers are those in the ISO file format name space defined by RFC 6381 [RFC6381].