Apple HLS: technical in-depth

Last updated on May 5, 2020.


An introduction to Apple HLS is available as: Apple HLS: introduction.

A summary table of the versions and revisions is available as: Apple HLS: comparing versions.

Master, Variants and Renditions

A complex presentation can be described by a Master Playlist.

The Master Playlist provides a set of Variant Streams, each of which describes a different version of the same content.

A Variant Stream can also specify a set of Renditions. Renditions are alternate versions of the content, such as audio produced in different languages or video recorded from different camera angles.

Version 1

The initial version defines nine new tags:


AnExtended M3U file is distinguished from a basic M3U file by its firstline which MUST be #EXTM3U.


An Extended Info Marker describing the media file that follows it:



Approximate duration ofthe next media file (the real duration must be less or equal). The EXTINF duration segment file must be less than or equal than EXT-X-TARGETDURATION:



Sequence number:


Starting at version 5, aclient shall notassume that segments with the same media sequence number indifferent masters, variants or renditions contain matching content.


Optional tag. The encryption algorithm is AES-128 CBC with PKCS7 padding:



Associates the beginning of the nextmedia file with an absolute time:


Starting at revision 20 (version 7) it should provides milliseconds:



Specifies whether the client may cachedownloaded media files for later replay:



The next URI in the Playlist is another Playlist file:



We reached the end of the playlist:



Added in revision 2.

Indicates that the next media filehas different characteristics than the previous one:


Version 2

EXT-X-STREAM-INF (additions)

TheRESOLUTION=<N>x<M> attribute is added.


Indicates the compatibility version of thePlaylist file:



Added the optional IV attribute.

Version 3


The duration can be expressed with a floating point argument.




If the tag is present and has avalue VOD, the playlist shall not change. If the tag is present and has avalue of EVENT, the server may only append lines tothe playlist.

Version 4

Rendition groups

A set of EXT-X-MEDIA tags with the same GROUP-ID value forms a groupof renditions.

EXT-X-STREAM-INF (additions)

New AUDIO and VIDEO attributes.

The value is a quoted-string. It MUST match the value of the
 GROUP-ID attribute of an EXT-X-MEDIA tag elsewhere in the Playlist
 whose TYPE attribute is AUDIO (resp. VIDEO). It indicates the set of audio
 renditions that MAY be used when playing the presentation.


Indicates that a media file is a sub-range of the resource identified by its media URI:



  • n: length of the sub-range
  • o (optional): offset, may be inferred from the previous media segment length and computed offset.


Indicates that playlists contain alternaterenditions of thesame content. For example two audio languages, or two video camera angles:



Identifies a playlistcontaining the I-frames of a multimedia presentation. It stands alone, in that it does not apply to a particular URI in the playlist:


Same attributes asEXT-X-STREAM-INF, minus the AUDIO attributes, plus a URI attribute to identify the I-frame playlist file.


Indicates that each media segment in thePlaylist describes a single I-frame:


Version 5

Subtitle segments

They must use WebVTT.

Each WebVTT segment MUST have an X-TIMESTAMP-MAP metadata header.

EXT-X-KEY (additions)

New encryption method SAMPLE-AES.SAMPLE-AES only encrypts the audio and video payloads. This is how DVB encryption works also.

The legacy encryption in HLS was called AES-128. AES-128 encrypts the full TS packets including headers.



The TYPE attribute can have the value SUBTITLES.



The EXT-X-MAP tag specifies how to obtain the Transport Stream PAT/

PMT for the applicable media segment.

It applies until the nextEXT-X-DISCONTINUITY tag


With the attributes URI and BYTERANGE.

Version 6

EXT-X-MEDIA (additions)

Added the TYPE attribute value CLOSED-CAPTIONS. The media segments for the video renditions caninclude closed captions.


EXT-X-STREAM-INF (additions and removals)

TheCLOSED-CAPTIONS attribute is added.

The PROGRAM-ID attribute is removed.


The PROGRAM-ID attribute is removed.


Allows synchronization betweendifferent renditions of the entire playlist, same variant stream or different variantstreams that have EXT-X-DISCONTINUITY tags in their playlists:


For revision 13 specifically, a playlist that contains an EXT-X-PLAYLIST-TYPE tag with avalue of EVENT or VOD must notcontain an EXT-X-DISCONTINUITY-SEQUENCE tag.


Indicates a preferred point at which to startplaying a playlist:


Media Segments (audio only)

Each Elementary Audio Stream segment MUST signal the timestamp of its
 first sample with an ID3 PRIV tag [ID3] at the beginning of the
 segment. The ID3 PRIV owner identifier MUST be
 "". The ID3 payload MUST
 be a 33-bit MPEG-2 Program Elementary Stream timestamp expressed as a
 big-endian eight-octet number, with the upper 31 bits set to zero.


Added at revision 13.

Indicates that all media samplesin a segment can be decoded without information from other segments:


Version 7

The specification was re-written in a more readable way.

Alternative Renditions

EXT-X-STREAM-INF tag containing an AUDIO, VIDEO, SUBTITLES, or CLOSED-CAPTIONS attribute indicates that alternative Renditions are available for playback of that Variant Stream.


Allows arbitrary session data to becarried in a Master Playlist:

#EXT-X-SESSION-DATA:<attribute list>

The attributesDATA-ID, VALUE, LANGUAGE and URI are defined.

EXT-X-STREAM-INF (additions)

TheAVERAGE-BANDWIDTH attribute was added.

TheFRAME-RATE attribute was added in revision 15.

TheHDCP-LEVEL attribute was added in revision 20.


The tag was removed.

EXT-X-MEDIA (additions)

INSTREAM-ID value SERVICE indicated a CEA-708DigitalTelevision Closed Captioning.

(Revision 20): the attribute CHANNELS is added.

EXT-X-DATERANGE (revision 19)

associates a time/date range (oddly named “Date Range”) with an attribute/value pair:

#EXT-X-DATERANGE:<attribute list>

The attributesID, CLASS, START-DATE, END-DATE, DURATION, PLANNED-DURATION, X- (client defined), SCTE35-CMD, SCTE35-OUT, SCTE35-IN and END-ON-NEXT are defined.


Starting at revision 20 (version 7) it should provides milliseconds:



Made mandatory for MPEG-4 Fragmented (starting at revision 20).

Version 8

Note that version 9 is mentioned in the following versions but doesn’t exist per se. See Ben Mesander’s comment for more details.

IMSC subtitles

IMSC1. In MP4 only. Codec attribute is “stpp.ttml.im1t”.

Variable subtitution

Variable names are defined by the EXT-X-DEFINE tag and defined as {$VAR_NAME}.


The segment URL should not be loaded by clients because it applies to the next media segment.


The VIDEO RANGE attribute supports SDR and PQ transfer characteristics.


Optional tag to declare variable name, value, or derivation from the master playlist.

Version 10

Note that there is no version 9.


Information about partial segment. Only the “PART-TARGET” attribute is defined.


Allows the Server to indicate support for “delivery directives” defined as optional attributes: CAN-SKIP-UNTIL, CAN-SKIP-DATERANGES, HOLD-BACK, PART-HOLD-BACK, CAN-BLOCK-RELOAD.


Identifies a partial segment using attributes: URI, DURATION, INDEPENDENT, BYTERANGE, GAP.

EXT-X-SKIP: attribute-list

The server has replaced some tags to inform the client it is not relevant. This is completed by attributes: SKIPPED-SEGMENTS (count), RECENTLY-REMOVED-DATERANGES.


Indicates resources that can be preloaded before being effectively available (in pratice the connection will be blocked until data is available). The hint on a partial segment may be signalled by the following attributes: TYPE, URI, BYTERANGE-START, BYTERANGE-LENGTH


A report containing the URI, Media Sequence Number, and Part Index of the last Partial Segment, all expressed as attributes.

8 comments on “Apple HLS: technical in-depth”

  1. Pingback: Apple HLS: technical in-depth - GPAC Licensing ...

  2. Pingback: Streaming: The HLS Version 4 hype, and the whole truth about it #9 - Francesco Altomare – Cloud Architect

    • Romain Bouqueau Reply

      Thank you Leandro! At the moment we still sell trainings on MPEG-DASH to finance the GPAC open-source development. Let us know if we can help.

  3. Benard Mesander Reply


    A clarification – there is a protocol version 9. In particular, it was an earlier version of the low-latency additions to HLS. You can see it referenced in section 7 of the latest spec version:

    In particular, protocol versions 9 and 10 differ in handling of metadata and the #EXT-X-SKIP tag:

    A Playlist MUST indicate an EXT-X-VERSION of 9 or higher if it

    o The EXT-X-SKIP tag.

    A Playlist MUST indicate an EXT-X-VERSION of 10 or higher if it

    o An EXT-X-SKIP tag that replaces EXT-X-DATERANGE tags in a Playlist
    Delta Update.

    Section of the spec defines how to use the _HLS_skip directive to invoke either protocol version 9 or version 10 behavior.

    • Romain Bouqueau Reply

      Excellent, thank you for the information. I’ve tried to clarify the text as a consequence!

Leave a Reply

Your email address will not be published. Required fields are marked *