Content 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. 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. The initial version defines nine new tags: An Extended M3U file is distinguished from a basic M3U file by its first line which MUST be #EXTM3U. An Extended Info Marker describing the media file that follows it: Approximate duration of the 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, a client shall not assume that segments with the same media sequence number in different masters, variants or renditions contain matching content. Optional tag. The encryption algorithm is AES-128 CBC with PKCS7 padding: Associates the beginning of the next media file with an absolute time: Starting at revision 20 (version 7) it should provides milliseconds: Specifies whether the client may cache downloaded 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 file has different characteristics than the previous one: The RESOLUTION=<N>x<M> attribute is added. Indicates the compatibility version of the Playlist file: Added the optional IV attribute. The duration can be expressed with a floating point argument. Optional: If the tag is present and has a value VOD, the playlist shall not change. If the tag is present and has a value of EVENT, the server may only append lines to the playlist. A set of EXT-X-MEDIA tags with the same GROUP-ID value forms a group of renditions. New AUDIO and VIDEO attributes. Indicates that a media file is a sub-range of the resource identified by its media URI: With: Indicates that playlists contain alternate renditions of the same content. For example two audio languages, or two video camera angles: Identifies a playlist containing 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 as EXT-X-STREAM-INF, minus the AUDIO attributes, plus a URI attribute to identify the I-frame playlist file. Indicates that each media segment in the Playlist describes a single I-frame: They must use WebVTT. Each WebVTT segment MUST have an X-TIMESTAMP-MAP metadata header. 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 possible attributes are URI, IV, KEYFORMAT, KEYFORMATVERSIONS. The TYPE attribute can have the value SUBTITLES. New attributes [FORCED={YES,NO}], [CHARACTERISTICS=UTI]. The EXT-X-MAP tag specifies how to obtain the Transport Stream PAT/ PMT for the applicable media segment. It applies until the next EXT-X-DISCONTINUITY tag With the attributes URI and BYTERANGE. Added the TYPE attribute value CLOSED-CAPTIONS. The media segments for the video renditions can include closed captions. The attributes URI, ASSOC-LANGUAGE, CHARACTERISTICS and INSTREAM-ID={CC1,CC2,CC3,CC4} are added. The CLOSED-CAPTIONS attribute is added. The PROGRAM-ID attribute is removed. The PROGRAM-ID attribute is removed. Allows synchronization between different renditions of the entire playlist, same variant stream or different variant streams that have EXT-X-DISCONTINUITY tags in their playlists: For revision 13 specifically, a playlist that contains an EXT-X-PLAYLIST-TYPE tag with a value of EVENT or VOD must not contain an EXT-X-DISCONTINUITY-SEQUENCE tag. Indicates a preferred point at which to start playing a playlist: Added at revision 13. Indicates that all media samples in a segment can be decoded without information from other segments: The specification was re-written in a more readable way. 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 be carried in a Master Playlist: The attributes DATA-ID, VALUE, LANGUAGE and URI are defined. The AVERAGE-BANDWIDTH attribute was added. The FRAME-RATE attribute was added in revision 15. The HDCP-LEVEL attribute was added in revision 20. The tag was removed. INSTREAM-ID value SERVICE indicated a CEA-708 Digital Television Closed Captioning. (Revision 20): the attribute CHANNELS is added. associates a time/date range (oddly named "Date Range") with an attribute/value pair: The attributes ID, CLASS, START-DATE, END-DATE, DURATION, PLANNED-DURATION, X-<client-attribute> (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).
Apple HLS: technical in-depth
Master, Variants and Renditions
Version 1
EXTM3U
EXTINF
#EXTINF:<duration>,<title>
EXT-X-TARGETDURATION
#EXT-X-TARGETDURATION:<seconds>
EXT-X-MEDIA-SEQUENCE
#EXT-X-MEDIA-SEQUENCE:<number>
EXT-X-KEY
#EXT-X-KEY:METHOD=<method>[,URI="<URI>"]
EXT-X-PROGRAM-DATE-TIME
#EXT-X-PROGRAM-DATE-TIME:<YYYY-MM-DDThh:mm:ssZ>
#EXT-X-PROGRAM-DATE-TIME:<YYYY-MM-DDThh:mm:ss.SSSZ>
EXT-X-ALLOW-CACHE
#EXT-X-ALLOW-CACHE:<YES|NO>
EXT-X-STREAM-INF
#EXT-X-STREAM-INF:[BANDWIDTH=<n>],[PROGRAM-ID=<i>],[CODECS="[format][,format]*"] <URI>
EXT-X-ENDLIST
#EXT-X-ENDLIST
EXT-X-DISCONTINUITY
#EXT-X-DISCONTINUITY
Version 2
EXT-X-STREAM-INF (additions)
EXT-X-VERSION
#EXT-X-VERSION:<n>
EXT-X-KEY (additions)
Version 3
EXTINF (additions)
EXT-X-PLAYLIST-TYPE
#EXT-X-PLAYLIST-TYPE:<EVENT|VOD>
Version 4
Rendition groups
EXT-X-STREAM-INF (additions)
AUDIO (resp. VIDEO)
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.
EXT-X-BYTERANGE
#EXT-X-BYTERANGE:<n>[@o]
EXT-X-MEDIA
#EXT-X-MEDIA:[TYPE={AUDIO,VIDEO}],[URI],[GROUP-ID],[LANGUAGE],[NAME],[DEFAULT={YES,NO}],[AUTOSELECT={YES,NO}]
EXT-X-I-FRAME-STREAM-INF
#EXT-X-I-FRAME-STREAM-INF:<attribute-list>
EXT-X-I-FRAMES-ONLY
#EXT-X-I-FRAMES-ONLY
Version 5
Subtitle segments
EXT-X-KEY (additions)
EXT-X-MEDIA (additions)
EXT-X-MAP
#EXT-X-MAP:<attribute-list>
Version 6
EXT-X-MEDIA (additions)
EXT-X-STREAM-INF (additions and removals)
EXT-X-I-FRAME-STREAM-INF (removals)
EXT-X-DISCONTINUITY-SEQUENCE
#EXT-X-DISCONTINUITY-SEQUENCE:<number>
EXT-X-START
#EXT-X-START:[TIMEOFFSET],[PRECISE={YES,NO}]
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
"com.apple.streaming.transportStreamTimestamp". 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.
EXT-X-INDEPENDENT-SEGMENTS
#EXT-X-INDEPENDENT-SEGMENTS
Version 7
Alternative Renditions
EXT-X-SESSION-DATA
#EXT-X-SESSION-DATA:<attribute list>
EXT-X-STREAM-INF (additions)
EXT-X-ALLOW-CACHE (removal)
EXT-X-MEDIA (additions)
EXT-X-DATERANGE (revision 19)
#EXT-X-DATERANGE:<attribute list>
EXT-X-KEY
#EXT-X-PROGRAM-DATE-TIME:<YYYY-MM-DDThh:mm:ss.SSSZ>
EXT-X-MAP
December 08, 2014 by Romain Bouqueau
-
[…] Apple HLS: technical in-depth Content Master, Variants and Renditions Version 1 Version 2 Version 3 Version 4 Version 5 Version 6 Version 7 An introduction to Apple HLS is available as: Apple HLS: introduction. A summary table of the versions … Continue reading → […]
-
Your page says "A playlist that contains an EXT-X-PLAYLIST-TYPE tag with a value of EVENT or VOD must not contain an EXT-X-DISCONTINUITY-SEQUENCE tag." I cannot find that limitation within the most recent spec version: https://tools.ietf.org/html/draft-pantos-http-live-streaming-16#section-6.2.2 Where did the requirement that #EXT-X-DISCONTINUITY-SEQUENCE only be used with LIVE playlist types come from ?
-
You are right. This remark was only valid for revision 13 (3.4.12, https://tools.ietf.org/html/draft-pantos-http-live-streaming-13) and removed at revision 14 (https://tools.ietf.org/html/draft-pantos-http-live-streaming-14). Text was amended, thank you. Don't hesitate if you have any other feedback! We need to update this document regularly. Any contribution is warmly welcome :)
-
[…] 1 […]
-
Thanks for sharing this amazing post, it'd be pretty nice to have a doc like that for MPEG dash as well :D
-
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.
- - Comments are closed -