Draft Pantos HTTP Live Streaming 08
Draft Pantos HTTP Live Streaming 08
Internet-Draft W. May
Intended status: Informational Apple Inc.
Expires: September 24, 2012 March 23, 2012
Abstract
Copyright Notice
Copyright (c) 2012 IETF Trust and the persons identified as the
document authors. All rights reserved.
Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4
2. Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
3. The Playlist file . . . . . . . . . . . . . . . . . . . . . . 4
3.1. Introduction . . . . . . . . . . . . . . . . . . . . . . . 4
3.2. Attribute Lists . . . . . . . . . . . . . . . . . . . . . 5
3.3. Standard Tags . . . . . . . . . . . . . . . . . . . . . . 6
3.3.1. EXTM3U . . . . . . . . . . . . . . . . . . . . . . . . 6
3.3.2. EXTINF . . . . . . . . . . . . . . . . . . . . . . . . 6
3.4. New Tags . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.4.1. EXT-X-BYTERANGE . . . . . . . . . . . . . . . . . . . 7
3.4.2. EXT-X-TARGETDURATION . . . . . . . . . . . . . . . . . 7
3.4.3. EXT-X-MEDIA-SEQUENCE . . . . . . . . . . . . . . . . . 8
3.4.4. EXT-X-KEY . . . . . . . . . . . . . . . . . . . . . . 8
3.4.5. EXT-X-PROGRAM-DATE-TIME . . . . . . . . . . . . . . . 9
3.4.6. EXT-X-ALLOW-CACHE . . . . . . . . . . . . . . . . . . 9
3.4.7. EXT-X-PLAYLIST-TYPE . . . . . . . . . . . . . . . . . 10
3.4.8. EXT-X-ENDLIST . . . . . . . . . . . . . . . . . . . . 10
3.4.9. EXT-X-MEDIA . . . . . . . . . . . . . . . . . . . . . 10
3.4.9.1. Rendition Groups . . . . . . . . . . . . . . . . . 11
3.4.10. EXT-X-STREAM-INF . . . . . . . . . . . . . . . . . . . 12
3.4.10.1. Alternative Renditions . . . . . . . . . . . . . . 13
3.4.11. EXT-X-DISCONTINUITY . . . . . . . . . . . . . . . . . 14
3.4.12. EXT-X-I-FRAMES-ONLY . . . . . . . . . . . . . . . . . 14
3.4.13. EXT-X-I-FRAME-STREAM-INF . . . . . . . . . . . . . . . 15
3.4.14. EXT-X-VERSION . . . . . . . . . . . . . . . . . . . . 16
4. Media segments . . . . . . . . . . . . . . . . . . . . . . . . 16
5. Key files . . . . . . . . . . . . . . . . . . . . . . . . . . 17
5.1. Introduction . . . . . . . . . . . . . . . . . . . . . . . 17
5.2. IV for AES-128 . . . . . . . . . . . . . . . . . . . . . . 17
6. Client/Server Actions . . . . . . . . . . . . . . . . . . . . 17
6.1. Introduction . . . . . . . . . . . . . . . . . . . . . . . 17
6.2. Server Process . . . . . . . . . . . . . . . . . . . . . . 18
6.2.1. Introduction . . . . . . . . . . . . . . . . . . . . . 18
6.2.2. Sliding Window Playlists . . . . . . . . . . . . . . . 20
6.2.3. Encrypting media segments . . . . . . . . . . . . . . 20
6.2.4. Providing variant streams . . . . . . . . . . . . . . 21
6.3. Client Process . . . . . . . . . . . . . . . . . . . . . . 22
6.3.1. Introduction . . . . . . . . . . . . . . . . . . . . . 22
6.3.2. Loading the Playlist file . . . . . . . . . . . . . . 22
6.3.3. Playing the Playlist file . . . . . . . . . . . . . . 22
1. Introduction
2. Summary
To play the stream, the client first obtains the Playlist file and
then obtains and plays each media segment in the Playlist. It
reloads the Playlist file as described in this document to discover
additional segments.
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in RFC 2119 [RFC2119].
3.1. Introduction
Lines that start with the character ’#’ are either comments or tags.
Tags begin with #EXT. All other lines that begin with ’#’ are
comments and SHOULD be ignored.
Playlist files whose names end in .m3u8 and/or have the HTTP Content-
Type "application/vnd.apple.mpegurl" are encoded in UTF-8 [RFC3629].
Files whose names end with .m3u and/or have the HTTP Content-Type
[RFC2616] "audio/mpegurl" are encoded in US-ASCII [US_ASCII].
Playlist files MUST have names that end in .m3u8 and/or have the
Content-Type "application/vnd.apple.mpegurl" (if transferred over
HTTP), or have names that end in .m3u and/or have the HTTP Content-
Type type "audio/mpegurl" (for compatibility).
Certain extended M3U tags have values which are Attribute Lists. An
Attribute List is a comma-separated list of attribute/value pairs
with no whitespace.
AttributeName=AttributeValue
3.3.1. EXTM3U
3.3.2. EXTINF
#EXTINF:<duration>,<title>
3.4.1. EXT-X-BYTERANGE
#EXT-X-BYTERANGE:<n>[@o]
3.4.2. EXT-X-TARGETDURATION
#EXT-X-TARGETDURATION:<s>
3.4.3. EXT-X-MEDIA-SEQUENCE
#EXT-X-MEDIA-SEQUENCE:<number>
See Section 6.3.2 and Section 6.3.5 for information on handling the
EXT-X-MEDIA-SEQUENCE tag.
3.4.4. EXT-X-KEY
#EXT-X-KEY:<attribute-list>
The URI attribute specifies how to obtain the key. Its value is a
If the 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 Section 5.2,
Section 6.2.3 and Section 6.3.6 for additional information on media
segment encryption.
3.4.5. EXT-X-PROGRAM-DATE-TIME
#EXT-X-PROGRAM-DATE-TIME:<YYYY-MM-DDThh:mm:ssZ>
For example:
#EXT-X-PROGRAM-DATE-TIME:2010-02-19T14:54:23.031+08:00
See Section 6.2.1 and Section 6.3.3 for more information on the EXT-
X-PROGRAM-DATE-TIME tag.
3.4.6. EXT-X-ALLOW-CACHE
#EXT-X-ALLOW-CACHE:<YES|NO>
3.4.7. EXT-X-PLAYLIST-TYPE
#EXT-X-PLAYLIST-TYPE:<EVENT|VOD>
3.4.8. EXT-X-ENDLIST
#EXT-X-ENDLIST
3.4.9. EXT-X-MEDIA
#EXT-X-MEDIA:<attribute-list>
URI
TYPE
GROUP-ID
LANGUAGE
NAME
DEFAULT
The value is enumerated-string; valid strings are YES and NO. If the
value is YES, then the client SHOULD play this rendition of the
content in the absence of information from the user indicating a
different choice. This attribute is optional. Its absence indicates
an implicit value of NO.
AUTOSELECT
The value is enumerated-string; valid strings are YES and NO. This
attribute is optional. Its absence indicates an implicit value of
NO. If the value is YES, then the client MAY choose to play this
rendition in the absence of explicit user preference because it
matches the current playback environment, such as chosen system
language.
A set of EXT-X-MEDIA tags with the same GROUP-ID value forms a group
of renditions. Each member of the group MUST represent an
alternative rendition of the same content.
o All EXT-X-MEDIA tags in the same group MUST have the same TYPE
attribute.
o All EXT-X-MEDIA tags in the same group MUST have different NAME
attributes.
o A group MUST NOT have more than one member with a DEFAULT
attribute of YES.
o All members of a group with TYPE=AUDIO MUST use the same audio
sample format.
o All members of a group with TYPE=VIDEO MUST use the same video
sample format.
3.4.10. EXT-X-STREAM-INF
#EXT-X-STREAM-INF:<attribute-list>
<URI>
BANDWIDTH
PROGRAM-ID
CODECS
RESOLUTION
AUDIO
VIDEO
3.4.11. EXT-X-DISCONTINUITY
o file format
o encoding parameters
o encoding sequence
o timestamp sequence
#EXT-X-DISCONTINUITY
See Section 4, Section 6.2.1, and Section 6.3.3 for more information
about the EXT-X-DISCONTINUITY tag.
3.4.12. EXT-X-I-FRAMES-ONLY
#EXT-X-I-FRAMES-ONLY
3.4.13. EXT-X-I-FRAME-STREAM-INF
#EXT-X-I-FRAME-STREAM-INF:<attribute-list>
URI
3.4.14. EXT-X-VERSION
#EXT-X-VERSION:<n>
A Playlist file MUST NOT contain more than one EXT-X-VERSION tag. A
Playlist file that does not contain an EXT-X-VERSION tag MUST comply
with version 1 of this protocol.
4. Media segments
5. Key files
5.1. Introduction
The AES-128 encryption method uses 16-octet keys. The format of the
Key file is a single packed array of 16 octets in binary format.
6. Client/Server Actions
6.1. Introduction
This section describes how the server generates the Playlist and
media segments and how the client should download and play them.
6.2.1. Introduction
The server MUST divide the stream into individual media segments
whose duration is less than or equal to a constant target duration.
The server SHOULD attempt to divide the stream at points that support
effective decode of individual media segments, e.g. on packet and key
frame boundaries.
The server MUST create a URI for every media segment that enables its
clients to obtain the segment data. If a server supports partial
loading of resources (e.g. via HTTP Range requests), it MAY specify
segments as sub-ranges of larger resources using the EXT-X-BYTERANGE
tag.
The server MUST create a Playlist file. The Playlist file MUST
conform to the format described in Section 3. A URI for each media
segment that the server wishes to make available MUST appear in the
Playlist in the order in which it is to be played. The entire media
segment MUST be available to clients if its URI is in the Playlist
file.
The server MUST create a URI for the Playlist file that will allow
its clients to obtain the file.
Changes to the Playlist file MUST be made atomically from the point
of view of the clients.
The server MUST NOT change the Playlist file, except to:
Remove media URIs from the Playlist in the order that they appear,
along with any tags that apply only to those media URIs
(Section 6.2.2).
The server MAY associate an absolute date and time with a media
segment by applying an EXT-X-PROGRAM-DATE-TIME tag to its URI. The
date and time value provides an informative mapping of the timeline
of the media to an appropriate wall-clock time, which may be used as
a basis for seeking, for display, or for other purposes. If a server
provides this mapping, it SHOULD apply an EXT-X-PROGRAM-DATE-TIME tag
to every segment that has an EXT-X-DISCONTINUITY tag applied to it.
If the Playlist does not contain the EXT-X-ENDLIST tag, the server
MUST make a new version of the Playlist file available that contains
at least one new media segment. It MUST be made available relative
to the time that the previous version of the Playlist file was made
available: no earlier than one-half the target duration after that
time, and no later than 1.5 times the target duration after that
time.
Media URIs MUST be removed from the Playlist file in the order that
they appear in the Playlist.
The server MUST NOT remove a media URI specifying a segment from the
Playlist file if the duration of the Playlist file minus the duration
of the segment is less than three times the target duration.
When the server removes a media URI from the Playlist, the
corresponding media segment SHOULD remain available to clients for a
period of time equal to the duration of the segment plus the duration
of the longest Playlist file distributed by the server containing
that segment.
The server MAY set the HTTP Expires header in the key response to
indicate that the key may be cached.
If the encryption METHOD is AES-128 and the Playlist does not contain
the EXT-X-I-FRAMES-ONLY tag, AES-128 CBC encryption with PKCS7
padding [RFC5652] SHALL be applied to individual media segments. The
entire segment MUST be encrypted. Cipher Block Chaining MUST NOT be
applied across media segments. The IV used for encryption MUST be
either the sequence number of the media segment or the value of the
IV attribute of the EXT-X-KEY tag, as described in Section 5.2.
The server MUST NOT remove an EXT-X-KEY tag from the Playlist file if
it applies to any media URI in the Playlist file.
The server MUST meet the following constraints when producing variant
streams:
Each variant Playlist file MUST have the same target duration.
6.3.1. Introduction
How the client obtains the URI to the Playlist file is outside the
scope of this document; it is presumed to have done so.
The client MUST obtain the Playlist file from the URI. If the
Playlist file so obtained is a variant Playlist, the client MUST
obtain the Playlist file from the variant Playlist.
The client MUST ensure that the Playlist file begins with the
EXTM3U tag and that the EXT-X-VERSION tag, if present, specifies a
protocol version supported by the client; if not, the client MUST
NOT attempt to use the Playlist.
The client SHOULD ignore any tags and attributes it does not
recognize.
The client SHALL choose which media segment to play first from the
Playlist when playback starts. If the EXT-X-ENDLIST tag is not
present and the client intends to play the media regularly (i.e. in
playlist order at the nominal playback rate), the client SHOULD NOT
choose a segment which starts less than three target durations from
the end of the Playlist file. Doing so can trigger playback stalls.
If the Playlist file contains the EXT-X-ALLOW-CACHE tag and its value
is NO, the client MUST NOT cache downloaded media segments after they
have been played. Otherwise the client MAY cache downloaded media
segments indefinitely for later replay.
The client MUST NOT depend upon the correctness or the consistency of
the value of the EXT-X-PROGRAM-DATE-TIME tag.
However the client MUST NOT attempt to reload the Playlist file more
frequently than specified by this section.
When a client loads a Playlist file for the first time or reloads a
Playlist file and finds that it has changed since the last time it
was loaded, the client MUST wait for a period of time before
attempting to reload the Playlist file again. This period is called
the initial minimum reload delay. It is measured from the time that
the client began loading the Playlist file.
The initial minimum reload delay is the duration of the last media
If the client reloads a Playlist file and finds that it has not
changed then it MUST wait for a period of one-half the target
duration before retrying.
In order to reduce server load, the client SHOULD NOT reload the
Playlist files of variant streams that are not currently being
played. If it decides to switch playback to a different variant, it
SHOULD stop reloading the Playlist of the old variant and begin
loading the Playlist of the new variant. It can use the EXTINF
durations and the constraints in Section 6.2.4 to determine the
approximate location of corresponding media. Once media from the new
variant has been loaded, the timestamps in the media segments can be
used to synchronize the old and new timelines precisely.
The client MUST examine the Playlist file every time it is loaded or
reloaded to determine the next media segment to load.
The first segment to load MUST be the segment that the client has
chosen to play first, as described in Section 6.3.3.
If the first segment to be played has been loaded and the Playlist
file does not contain the EXT-X-MEDIA-SEQUENCE tag then the client
MUST verify that the current Playlist file contains the URI of the
last loaded media segment at the offset it was originally found at,
halting playback if it does not. The next media segment to load MUST
be the first media URI following the last-loaded URI in the Playlist.
If the first segment to be played has been loaded and the Playlist
file contains the EXT-X-MEDIA-SEQUENCE tag then the next media
segment to load SHALL be the one with the lowest sequence number that
is greater than the sequence number of the last media segment loaded.
8. Examples
8.1. Introduction
#EXTM3U
#EXT-X-TARGETDURATION:5220
#EXTINF:5220,
http://media.example.com/entire.ts
#EXT-X-ENDLIST
#EXTM3U
#EXT-X-TARGETDURATION:8
#EXT-X-MEDIA-SEQUENCE:2680
#EXTINF:8,
https://priv.example.com/fileSequence2680.ts
#EXTINF:8,
https://priv.example.com/fileSequence2681.ts
#EXTINF:8,
https://priv.example.com/fileSequence2682.ts
#EXTM3U
#EXT-X-MEDIA-SEQUENCE:7794
#EXT-X-TARGETDURATION:15
#EXT-X-KEY:METHOD=AES-128,URI="https://priv.example.com/key.php?r=52"
#EXTINF:15,
http://media.example.com/fileSequence52-1.ts
#EXTINF:15,
http://media.example.com/fileSequence52-2.ts
#EXTINF:15,
http://media.example.com/fileSequence52-3.ts
#EXT-X-KEY:METHOD=AES-128,URI="https://priv.example.com/key.php?r=53"
#EXTINF:15,
http://media.example.com/fileSequence53-1.ts
#EXTM3U
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1280000
http://example.com/low.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=2560000
http://example.com/mid.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=7680000
http://example.com/hi.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=65000,CODECS="mp4a.40.5"
http://example.com/audio-only.m3u8
#EXTM3U
#EXT-X-STREAM-INF:BANDWIDTH=1280000
low/audio-video.m3u8
#EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=86000,URI="low/iframe.m3u8"
#EXT-X-STREAM-INF:BANDWIDTH=2560000
mid/audio-video.m3u8
#EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=150000,URI="mid/iframe.m3u8"
#EXT-X-STREAM-INF:BANDWIDTH=7680000
hi/audio-video.m3u8
#EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=550000,URI="hi/iframe.m3u8"
#EXT-X-STREAM-INF:BANDWIDTH=65000,CODECS="mp4a.40.5"
audio-only.m3u8
In this example, the PROGRAM-ID attributes have been left out. The
CODECS attributes have been condensed for space. A ’\’ is used to
indicate that the tag continues on the following line with whitespace
removed:
#EXTM3U
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="aac",NAME="English", \
DEFAULT=YES,AUTOSELECT=YES,LANGUAGE="en", \
URI="main/english-audio.m3u8"
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="aac",NAME="Deutsche", \
DEFAULT=NO,AUTOSELECT=YES,LANGUAGE="de", \
URI="main/german-audio.m3u8"
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="aac",NAME="Commentary", \
DEFAULT=NO,AUTOSELECT=NO,URI="commentary/audio-only.m3u8"
#EXT-X-STREAM-INF:BANDWIDTH=1280000,CODECS="...",AUDIO="aac"
low/video-only.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=2560000,CODECS="...",AUDIO="aac"
mid/video-only.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=7680000,CODECS="...",AUDIO="aac"
hi/video-only.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=65000,CODECS="mp4a.40.5",AUDIO="aac"
main/english-audio.m3u8
In this example, the PROGRAM-ID attributes have been left out. The
CODECS attributes have been condensed for space. A ’\’ is used to
indicate that the tag continues on the following line with whitespace
removed:
#EXTM3U
#EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="low",NAME="Main", \
DEFAULT=YES,URI="low/main/audio-video.m3u8"
#EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="low",NAME="Centerfield", \
DEFAULT=NO,URI="low/centerfield/audio-video.m3u8"
#EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="low",NAME="Dugout", \
DEFAULT=NO,URI="low/dugout/audio-video.m3u8"
#EXT-X-STREAM-INF:BANDWIDTH=1280000,CODECS="...",VIDEO="low"
low/main/audio-video.m3u8
#EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="mid",NAME="Main", \
DEFAULT=YES,URI="mid/main/audio-video.m3u8"
#EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="mid",NAME="Centerfield", \
DEFAULT=NO,URI="mid/centerfield/audio-video.m3u8"
#EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="mid",NAME="Dugout", \
DEFAULT=NO,URI="mid/dugout/audio-video.m3u8"
#EXT-X-STREAM-INF:BANDWIDTH=2560000,CODECS="...",VIDEO="mid"
mid/main/audio-video.m3u8
#EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="hi",NAME="Main", \
DEFAULT=YES,URI="hi/main/audio-video.m3u8"
#EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="hi",NAME="Centerfield", \
DEFAULT=NO,URI="hi/centerfield/audio-video.m3u8"
#EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="hi",NAME="Dugout", \
DEFAULT=NO,URI="hi/dugout/audio-video.m3u8"
#EXT-X-STREAM-INF:BANDWIDTH=7680000,CODECS="...",VIDEO="hi"
hi/main/audio-video.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=65000,CODECS="mp4a.40.5"
main/audio-only.m3u8
9. Contributors
Since the protocol generally uses HTTP to transfer data, most of the
same security considerations apply. See section 15 of RFC 2616
[RFC2616].
Playlist files contain URIs, which clients will use to make network
requests of arbitrary entities. Clients SHOULD range-check responses
to prevent buffer overflows. See also the Security Considerations
section of RFC 3986 [RFC3986].
12. References
[ISO_13818]
International Organization for Standardization, "ISO/IEC
International Standard 13818; Generic coding of moving
pictures and associated audio information", October 2007,
<http://www.iso.org/iso/catalogue_detail?csnumber=44169>.
[ISO_8601]
International Organization for Standardization, "ISO/IEC
International Standard 8601:2004; Data elements and
interchange formats -- Information interchange --
Representation of dates and times", December 2004,
<http://www.iso.org/iso/catalogue_detail?csnumber=40874>.
[RFC6381] Gellens, R., Singer, D., and P. Frojdh, "The ’Codecs’ and
’Profiles’ Parameters for "Bucket" Media Types", RFC 6381,
August 2011.
[US_ASCII]
American National Standards Institute, "ANSI X3.4-1986,
Information Systems -- Coded Character Sets 7-Bit American
National Standard Code for Information Interchange (7-Bit
ASCII)", December 1986.
Authors’ Addresses
Email: [email protected]
Email: [email protected]