This section describes the Playlist files used by HTTP Live
Streaming. In this section, "MUST" and "MUST NOT" specify the rules
for the syntax and structure of legal Playlist files. Playlists that
violate these rules are invalid; clients MUST fail to parse them.
See Section 6.3.2.
The format of the Playlist files is derived from the M3U [M3U]
playlist file format and inherits two tags from that earlier file
format: EXTM3U (Section 220.127.116.11) and EXTINF (Section 18.104.22.168).
In the specification of tag syntax, a string enclosed by <>
identifies a tag parameter; its specific format is described in its
tag definition. If a parameter is further surrounded by , it is
optional; otherwise, it is required.
Each Playlist file MUST be identifiable either by the path component
of its URI or by HTTP Content-Type. In the first case, the path MUST
end with either .m3u8 or .m3u. In the second, the HTTP Content-Type
MUST be "application/vnd.apple.mpegurl" or "audio/mpegurl". Clients
SHOULD refuse to parse Playlists that are not so identified.
4.1. Definition of a Playlist
Playlist files MUST be encoded in UTF-8 [RFC3629]. They MUST NOT
contain any Byte Order Mark (BOM); clients SHOULD fail to parse
Playlists that contain a BOM or do not parse as UTF-8. Playlist
files MUST NOT contain UTF-8 control characters (U+0000 to U+001F and
U+007F to U+009F), with the exceptions of CR (U+000D) and LF
(U+000A). All character sequences MUST be normalized according to
Unicode normalization form "NFC" [UNICODE]. Note that US-ASCII
[US_ASCII] conforms to these rules.
Lines in a Playlist file are terminated by either a single line feed
character or a carriage return character followed by a line feed
character. Each line is a URI, is blank, or starts with the
character '#'. Blank lines are ignored. Whitespace MUST NOT be
present, except for elements in which it is explicitly specified.
Lines that start with the character '#' are either comments or tags.
Tags begin with #EXT. They are case sensitive. All other lines that
begin with '#' are comments and SHOULD be ignored.
A URI line identifies a Media Segment or a Playlist file (see
Section 22.214.171.124). Each Media Segment is specified by a URI and the
tags that apply to it.
A Playlist is a Media Playlist if all URI lines in the Playlist
identify Media Segments. A Playlist is a Master Playlist if all URI
lines in the Playlist identify Media Playlists. A Playlist MUST be
either a Media Playlist or a Master Playlist; all other Playlists are
A URI in a Playlist, whether it is a URI line or part of a tag, MAY
be relative. Any relative URI is considered to be relative to the
URI of the Playlist that contains it.
The duration of a Media Playlist is the sum of the durations of the
Media Segments within it.
The segment bit rate of a Media Segment is the size of the Media
Segment divided by its EXTINF duration (Section 126.96.36.199). Note that
this includes container overhead but does not include overhead
imposed by the delivery system, such as HTTP, TCP, or IP headers.
The peak segment bit rate of a Media Playlist is the largest bit rate
of any contiguous set of segments whose total duration is between 0.5
and 1.5 times the target duration. The bit rate of a set is
calculated by dividing the sum of the segment sizes by the sum of the
The average segment bit rate of a Media Playlist is the sum of the
sizes (in bits) of every Media Segment in the Media Playlist, divided
by the Media Playlist duration. Note that this includes container
overhead, but not HTTP or other overhead imposed by the delivery
4.2. Attribute Lists
Certain tags have values that are attribute-lists. An attribute-list
is a comma-separated list of attribute/value pairs with no
An attribute/value pair has the following syntax:
An AttributeName is an unquoted string containing characters from the
set [A..Z], [0..9] and '-'. Therefore, AttributeNames contain only
uppercase letters, not lowercase. There MUST NOT be any whitespace
between the AttributeName and the '=' character, nor between the '='
character and the AttributeValue.
An AttributeValue is one of the following:
o decimal-integer: an unquoted string of characters from the set
[0..9] expressing an integer in base-10 arithmetic in the range
from 0 to 2^64-1 (18446744073709551615). A decimal-integer may be
from 1 to 20 characters long.
o hexadecimal-sequence: an unquoted string of characters from the
set [0..9] and [A..F] that is prefixed with 0x or 0X. The maximum
length of a hexadecimal-sequence depends on its AttributeNames.
o decimal-floating-point: an unquoted string of characters from the
set [0..9] and '.' that expresses a non-negative floating-point
number in decimal positional notation.
o signed-decimal-floating-point: an unquoted string of characters
from the set [0..9], '-', and '.' that expresses a signed
floating-point number in decimal positional notation.
o quoted-string: a string of characters within a pair of double
quotes (0x22). The following characters MUST NOT appear in a
quoted-string: line feed (0xA), carriage return (0xD), or double
quote (0x22). Quoted-string AttributeValues SHOULD be constructed
so that byte-wise comparison is sufficient to test two quoted-
string AttributeValues for equality. Note that this implies case-
o enumerated-string: an unquoted character string from a set that is
explicitly defined by the AttributeName. An enumerated-string
will never contain double quotes ("), commas (,), or whitespace.
o decimal-resolution: two decimal-integers separated by the "x"
character. The first integer is a horizontal pixel dimension
(width); the second is a vertical pixel dimension (height).
The type of the AttributeValue for a given AttributeName is specified
by the attribute definition.
A given AttributeName MUST NOT appear more than once in a given
attribute-list. Clients SHOULD refuse to parse such Playlists.
4.3. Playlist Tags
Playlist tags specify either global parameters of the Playlist or
information about the Media Segments or Media Playlists that appear
4.3.1. Basic Tags
These tags are allowed in both Media Playlists and Master Playlists.
The EXTM3U tag indicates that the file is an Extended M3U [M3U]
Playlist file. It MUST be the first line of every Media Playlist and
every Master Playlist. Its format is:
The EXT-X-VERSION tag indicates the compatibility version of the
Playlist file, its associated media, and its server.
The EXT-X-VERSION tag applies to the entire Playlist file. Its
where n is an integer indicating the protocol compatibility version
It MUST appear in all Playlists containing tags or attributes that
are not compatible with protocol version 1 to support
interoperability with older clients. Section 7 specifies the minimum
value of the compatibility version number for any given Playlist
A Playlist file MUST NOT contain more than one EXT-X-VERSION tag. If
a client encounters a Playlist with multiple EXT-X-VERSION tags, it
MUST fail to parse it.
4.3.2. Media Segment Tags
Each Media Segment is specified by a series of Media Segment tags
followed by a URI. Some Media Segment tags apply to just the next
segment; others apply to all subsequent segments until another
instance of the same tag.
A Media Segment tag MUST NOT appear in a Master Playlist. Clients
MUST fail to parse Playlists that contain both Media Segment tags and
Master Playlist tags (Section 4.3.4).
The EXTINF tag specifies the duration of a Media Segment. It applies
only to the next Media Segment. This tag is REQUIRED for each Media
Segment. Its format is:
where duration is a decimal-floating-point or decimal-integer number
(as described in Section 4.2) that specifies the duration of the
Media Segment in seconds. Durations SHOULD be decimal-floating-
point, with enough accuracy to avoid perceptible error when segment
durations are accumulated. However, if the compatibility version
number is less than 3, durations MUST be integers. Durations that
are reported as integers SHOULD be rounded to the nearest integer.
The remainder of the line following the comma is an optional human-
readable informative title of the Media Segment expressed as UTF-8
The EXT-X-BYTERANGE tag indicates that a Media Segment is a sub-range
of the resource identified by its URI. It applies only to the next
URI line that follows it in the Playlist. Its format is:
where n is a decimal-integer indicating the length of the sub-range
in bytes. If present, o is a decimal-integer indicating the start of
the sub-range, as a byte offset from the beginning of the resource.
If o is not present, the sub-range begins at the next byte following
the sub-range of the previous Media Segment.
If o is not present, a previous Media Segment MUST appear in the
Playlist file and MUST be a sub-range of the same media resource, or
the Media Segment is undefined and the client MUST fail to parse the
A Media Segment without an EXT-X-BYTERANGE tag consists of the entire
resource identified by its URI.
Use of the EXT-X-BYTERANGE tag REQUIRES a compatibility version
number of 4 or greater.
The EXT-X-DISCONTINUITY tag indicates a discontinuity between the
Media Segment that follows it and the one that preceded it.
Its format is:
The EXT-X-DISCONTINUITY tag MUST be present if there is a change in
any of the following characteristics:
o file format
o number, type, and identifiers of tracks
o timestamp sequence
The EXT-X-DISCONTINUITY tag SHOULD be present if there is a change in
any of the following characteristics:
o encoding parameters
o encoding sequence
See Sections 3, 6.2.1, and 6.3.3 for more information about the EXT-
Media Segments MAY be encrypted. The EXT-X-KEY tag specifies how to
decrypt them. It applies to every Media Segment and to every Media
Initialization Section declared by an EXT-X-MAP tag that appears
between it and the next EXT-X-KEY tag in the Playlist file with the
same KEYFORMAT attribute (or the end of the Playlist file). Two or
more EXT-X-KEY tags with different KEYFORMAT attributes MAY apply to
the same Media Segment if they ultimately produce the same decryption
key. The format is:
The following attributes are defined:
The value is an enumerated-string that specifies the encryption
method. This attribute is REQUIRED.
The methods defined are: NONE, AES-128, and SAMPLE-AES.
An encryption method of NONE means that Media Segments are not
encrypted. If the encryption method is NONE, other attributes
MUST NOT be present.
An encryption method of AES-128 signals that Media Segments are
completely encrypted using the Advanced Encryption Standard (AES)
[AES_128] with a 128-bit key, Cipher Block Chaining (CBC), and
Public-Key Cryptography Standards #7 (PKCS7) padding [RFC5652].
CBC is restarted on each segment boundary, using either the
Initialization Vector (IV) attribute value or the Media Sequence
Number as the IV; see Section 5.2.
An encryption method of SAMPLE-AES means that the Media Segments
contain media samples, such as audio or video, that are encrypted
using the Advanced Encryption Standard [AES_128]. How these media
streams are encrypted and encapsulated in a segment depends on the
media encoding and the media format of the segment. fMP4 Media
Segments are encrypted using the 'cbcs' scheme of Common
Encryption [COMMON_ENC]. Encryption of other Media Segment
formats containing H.264 [H_264], AAC [ISO_14496], AC-3 [AC_3],
and Enhanced AC-3 [AC_3] media streams is described in the HTTP
Live Streaming (HLS) Sample Encryption specification [SampleEnc].
The IV attribute MAY be present; see Section 5.2.
The value is a quoted-string containing a URI that specifies how
to obtain the key. This attribute is REQUIRED unless the METHOD
The value is a hexadecimal-sequence that specifies a 128-bit
unsigned integer Initialization Vector to be used with the key.
Use of the IV attribute REQUIRES a compatibility version number of
2 or greater. See Section 5.2 for when the IV attribute is used.
The value is a quoted-string that specifies how the key is
represented in the resource identified by the URI; see Section 5
for more detail. This attribute is OPTIONAL; its absence
indicates an implicit value of "identity". Use of the KEYFORMAT
attribute REQUIRES a compatibility version number of 5 or greater.
The value is a quoted-string containing one or more positive
integers separated by the "/" character (for example, "1", "1/2",
or "1/2/5"). If more than one version of a particular KEYFORMAT
is defined, this attribute can be used to indicate which
version(s) this instance complies with. This attribute is
OPTIONAL; if it is not present, its value is considered to be "1".
Use of the KEYFORMATVERSIONS attribute REQUIRES a compatibility
version number of 5 or greater.
If the Media Playlist file does not contain an EXT-X-KEY tag, then
Media Segments are not encrypted.
See Section 5 for the format of the Key file and Sections 5.2, 6.2.3,
and 6.3.6 for additional information on Media Segment encryption.
The EXT-X-MAP tag specifies how to obtain the Media Initialization
Section (Section 3) required to parse the applicable Media Segments.
It applies to every Media Segment that appears after it in the
Playlist until the next EXT-X-MAP tag or until the end of the
Its format is:
The following attributes are defined:
The value is a quoted-string containing a URI that identifies a
resource that contains the Media Initialization Section. This
attribute is REQUIRED.
The value is a quoted-string specifying a byte range into the
resource identified by the URI attribute. This range SHOULD
contain only the Media Initialization Section. The format of the
byte range is described in Section 188.8.131.52. This attribute is
OPTIONAL; if it is not present, the byte range is the entire
resource indicated by the URI.
An EXT-X-MAP tag SHOULD be supplied for Media Segments in Playlists
with the EXT-X-I-FRAMES-ONLY tag when the first Media Segment (i.e.,
I-frame) in the Playlist (or the first segment following an EXT-
X-DISCONTINUITY tag) does not immediately follow the Media
Initialization Section at the beginning of its resource.
Use of the EXT-X-MAP tag in a Media Playlist that contains the EXT-
X-I-FRAMES-ONLY tag REQUIRES a compatibility version number of 5 or
greater. Use of the EXT-X-MAP tag in a Media Playlist that DOES NOT
contain the EXT-X-I-FRAMES-ONLY tag REQUIRES a compatibility version
number of 6 or greater.
If the Media Initialization Section declared by an EXT-X-MAP tag is
encrypted with a METHOD of AES-128, the IV attribute of the EXT-X-KEY
tag that applies to the EXT-X-MAP is REQUIRED.
The EXT-X-PROGRAM-DATE-TIME tag associates the first sample of a
Media Segment with an absolute date and/or time. It applies only to
the next Media Segment. Its format is:
where date-time-msec is an ISO/IEC 8601:2004 [ISO_8601] date/time
representation, such as YYYY-MM-DDThh:mm:ss.SSSZ. It SHOULD indicate
a time zone and fractional parts of seconds, to millisecond accuracy.
See Sections 6.2.1 and 6.3.3 for more information on the EXT-X-
The EXT-X-DATERANGE tag associates a Date Range (i.e., a range of
time defined by a starting and ending date) with a set of attribute/
value pairs. Its format is:
where the defined attributes are:
A quoted-string that uniquely identifies a Date Range in the
Playlist. This attribute is REQUIRED.
A client-defined quoted-string that specifies some set of
attributes and their associated value semantics. All Date Ranges
with the same CLASS attribute value MUST adhere to these
semantics. This attribute is OPTIONAL.
A quoted-string containing the ISO-8601 date at which the Date
Range begins. This attribute is REQUIRED.
A quoted-string containing the ISO-8601 date at which the Date
Range ends. It MUST be equal to or later than the value of the
START-DATE attribute. This attribute is OPTIONAL.
The duration of the Date Range expressed as a decimal-floating-
point number of seconds. It MUST NOT be negative. A single
instant in time (e.g., crossing a finish line) SHOULD be
represented with a duration of 0. This attribute is OPTIONAL.
The expected duration of the Date Range expressed as a decimal-
floating-point number of seconds. It MUST NOT be negative. This
attribute SHOULD be used to indicate the expected duration of a
Date Range whose actual duration is not yet known. It is
The "X-" prefix defines a namespace reserved for client-defined
attributes. The client-attribute MUST be a legal AttributeName.
Clients SHOULD use a reverse-DNS syntax when defining their own
attribute names to avoid collisions. The attribute value MUST be
a quoted-string, a hexadecimal-sequence, or a decimal-floating-
point. An example of a client-defined attribute is X-COM-EXAMPLE-
AD-ID="XYZ123". These attributes are OPTIONAL.
SCTE35-CMD, SCTE35-OUT, SCTE35-IN
Used to carry SCTE-35 data; see Section 184.108.40.206.1 for more
information. These attributes are OPTIONAL.
An enumerated-string whose value MUST be YES. This attribute
indicates that the end of the range containing it is equal to the
START-DATE of its Following Range. The Following Range is the
Date Range of the same CLASS that has the earliest START-DATE
after the START-DATE of the range in question. This attribute is
An EXT-X-DATERANGE tag with an END-ON-NEXT=YES attribute MUST have a
CLASS attribute. Other EXT-X-DATERANGE tags with the same CLASS
attribute MUST NOT specify Date Ranges that overlap.
An EXT-X-DATERANGE tag with an END-ON-NEXT=YES attribute MUST NOT
contain DURATION or END-DATE attributes.
A Date Range with neither a DURATION, an END-DATE, nor an END-ON-
NEXT=YES attribute has an unknown duration, even if it has a PLANNED-
If a Playlist contains an EXT-X-DATERANGE tag, it MUST also contain
at least one EXT-X-PROGRAM-DATE-TIME tag.
If a Playlist contains two EXT-X-DATERANGE tags with the same ID
attribute value, then any AttributeName that appears in both tags
MUST have the same AttributeValue.
If a Date Range contains both a DURATION attribute and an END-DATE
attribute, the value of the END-DATE attribute MUST be equal to the
value of the START-DATE attribute plus the value of the DURATION
Clients SHOULD ignore EXT-X-DATERANGE tags with illegal syntax.
220.127.116.11.1. Mapping SCTE-35 into EXT-X-DATERANGE
Splice information carried in source media according to the SCTE-35
specification [SCTE35] MAY be represented in a Media Playlist using
Each SCTE-35 splice_info_section() containing a splice_null(),
splice_schedule(), bandwidth_reservation(), or private_cmd() SHOULD
be represented by an EXT-X-DATERANGE tag with an SCTE35-CMD attribute
whose value is the big-endian binary representation of the
splice_info_section(), expressed as a hexadecimal-sequence.
An SCTE-35 splice out/in pair signaled by a pair of splice_insert()
commands SHOULD be represented by one or more EXT-X-DATERANGE tags
carrying the same ID attribute, which MUST be unique to that splice
out/in pair. The "out" splice_info_section() (with
out_of_network_indicator set to 1) MUST be placed in an SCTE35-OUT
attribute, with the same formatting as SCTE35-CMD. The "in"
splice_info_section() (with out_of_network_indicator set to 0) MUST
be placed in an SCTE35-IN attribute, with the same formatting as
An SCTE-35 splice out/in pair signaled by a pair of time_signal()
commands, each carrying a single segmentation_descriptor(), SHOULD be
represented by one or more EXT-X-DATERANGE tags carrying the same ID
attribute, which MUST be unique to that splice out/in pair. The
"out" splice_info_section() MUST be placed in an SCTE35-OUT
attribute; the "in" splice_info_section() MUST be placed in an
Different types of segmentation, as indicated by the
segmentation_type_id in the segmentation_descriptor(), SHOULD be
represented by separate EXT-X-DATERANGE tags, even if two or more
segmentation_descriptor()s arrive in the same splice_info_section().
In that case, each EXT-X-DATERANGE tag will have an SCTE35-OUT,
SCTE35-IN, or SCTE35-CMD attribute whose value is the entire
An SCTE-35 time_signal() command that does not signal a splice out or
in point SHOULD be represented by an EXT-X-DATERANGE tag with an
The START-DATE of an EXT-X-DATERANGE tag containing an SCTE35-OUT
attribute MUST be the date and time that corresponds to the program
time of that splice.
The START-DATE of an EXT-X-DATERANGE tag containing an SCTE35-CMD
MUST be the date and time specified by the splice_time() in the
command or the program time at which the command appeared in the
source stream if the command does not specify a splice_time().
An EXT-X-DATERANGE tag containing an SCTE35-OUT attribute MAY contain
a PLANNED-DURATION attribute. Its value MUST be the planned duration
of the splice.
The DURATION of an EXT-X-DATERANGE tag containing an SCTE35-IN
attribute MUST be the actual (not planned) program duration between
the corresponding out-point and that in-point.
The END-DATE of an EXT-X-DATERANGE tag containing an SCTE35-IN
attribute MUST be the actual (not planned) program date and time of
If the actual end date and time is not known when an SCTE35-OUT
attribute is added to the Playlist, the DURATION attribute and the
END-TIME attribute MUST NOT be present; the actual end date of the
splice SHOULD be signaled by another EXT-X-DATERANGE tag once it has
A canceled splice SHOULD NOT appear in the Playlist as an EXT-
An EXT-X-DATERANGE tag announcing a splice SHOULD be added to a
Playlist at the same time as the last pre-splice Media Segment, or
earlier if possible.
The ID attribute of an EXT-X-DATERANGE tag MAY contain a
splice_event_id and/or a segmentation_event_id, but it MUST be unique
in the Playlist. If there is a possibility that an SCTE-35 id will
be reused, the ID attribute value MUST include disambiguation, such
as a date or sequence number.
4.3.3. Media Playlist Tags
Media Playlist tags describe global parameters of the Media Playlist.
There MUST NOT be more than one Media Playlist tag of each type in
any Media Playlist.
A Media Playlist tag MUST NOT appear in a Master Playlist.
The EXT-X-TARGETDURATION tag specifies the maximum Media Segment
duration. The EXTINF duration of each Media Segment in the Playlist
file, when rounded to the nearest integer, MUST be less than or equal
to the target duration; longer segments can trigger playback stalls
or other errors. It applies to the entire Playlist file. Its format
where s is a decimal-integer indicating the target duration in
seconds. The EXT-X-TARGETDURATION tag is REQUIRED.
The EXT-X-MEDIA-SEQUENCE tag indicates the Media Sequence Number of
the first Media Segment that appears in a Playlist file. Its format
where number is a decimal-integer.
If the Media Playlist file does not contain an EXT-X-MEDIA-SEQUENCE
tag, then the Media Sequence Number of the first Media Segment in the
Media Playlist SHALL be considered to be 0. A client MUST NOT assume
that segments with the same Media Sequence Number in different Media
Playlists contain matching content (see Section 6.3.2).
A URI for a Media Segment is not required to contain its Media
See Sections 6.2.1 and 6.3.5 for more information on setting the EXT-
The EXT-X-MEDIA-SEQUENCE tag MUST appear before the first Media
Segment in the Playlist.
The EXT-X-DISCONTINUITY-SEQUENCE tag allows synchronization between
different Renditions of the same Variant Stream or different Variant
Streams that have EXT-X-DISCONTINUITY tags in their Media Playlists.
Its format is:
where number is a decimal-integer.
If the Media Playlist does not contain an EXT-X-DISCONTINUITY-
SEQUENCE tag, then the Discontinuity Sequence Number of the first
Media Segment in the Playlist SHALL be considered to be 0.
The EXT-X-DISCONTINUITY-SEQUENCE tag MUST appear before the first
Media Segment in the Playlist.
The EXT-X-DISCONTINUITY-SEQUENCE tag MUST appear before any EXT-
See Sections 6.2.1 and 6.2.2 for more information about setting the
value of the EXT-X-DISCONTINUITY-SEQUENCE tag.
The EXT-X-ENDLIST tag indicates that no more Media Segments will be
added to the Media Playlist file. It MAY occur anywhere in the Media
Playlist file. Its format is:
The EXT-X-PLAYLIST-TYPE tag provides mutability information about the
Media Playlist file. It applies to the entire Media Playlist file.
It is OPTIONAL. Its format is:
where type-enum is either EVENT or VOD.
Section 6.2.1 defines the implications of the EXT-X-PLAYLIST-TYPE
If the EXT-X-PLAYLIST-TYPE value is EVENT, Media Segments can only be
added to the end of the Media Playlist. If the EXT-X-PLAYLIST-TYPE
value is Video On Demand (VOD), the Media Playlist cannot change.
If the EXT-X-PLAYLIST-TYPE tag is omitted from a Media Playlist, the
Playlist can be updated according to the rules in Section 6.2.1 with
no additional restrictions. For example, a live Playlist
(Section 6.2.2) MAY be updated to remove Media Segments in the order
that they appeared.
The EXT-X-I-FRAMES-ONLY tag indicates that each Media Segment in the
Playlist describes a single I-frame. I-frames are encoded video
frames whose encoding does not depend on any other frame. I-frame
Playlists can be used for trick play, such as fast forward, rapid
reverse, and scrubbing.
The EXT-X-I-FRAMES-ONLY tag applies to the entire Playlist. Its
In a Playlist with the EXT-X-I-FRAMES-ONLY tag, the Media Segment
duration (EXTINF tag value) is the time between the presentation time
of the I-frame in the Media Segment and the presentation time of the
next I-frame in the Playlist, or the end of the presentation if it is
the last I-frame in the Playlist.
Media resources containing I-frame segments MUST begin with either a
Media Initialization Section (Section 3) or be accompanied by an EXT-
X-MAP tag indicating the Media Initialization Section so that clients
can load and decode I-frame segments in any order. The byte range of
an I-frame segment with an EXT-X-BYTERANGE tag applied to it
(Section 18.104.22.168) MUST NOT include its Media Initialization Section;
clients can assume that the Media Initialization Section is defined
by the EXT-X-MAP tag or is located from the start of the resource to
the offset of the first I-frame segment in that resource.
Use of the EXT-X-I-FRAMES-ONLY REQUIRES a compatibility version
number of 4 or greater.