idnits 2.17.1 draft-pantos-hls-rfc8216bis-05.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- -- The document has an IETF Trust Provisions (28 Dec 2009) Section 6.c(i) Publication Limitation clause. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- == There are 2 instances of lines with non-RFC2606-compliant FQDNs in the document. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (September 23, 2019) is 1676 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. Checking references for intended status: Informational ---------------------------------------------------------------------------- ** Obsolete normative reference: RFC 2818 (Obsoleted by RFC 9110) ** Obsolete normative reference: RFC 7230 (Obsoleted by RFC 9110, RFC 9112) Summary: 2 errors (**), 0 flaws (~~), 2 warnings (==), 3 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Informational R. Pantos, Ed. 3 Internet-Draft Apple Inc. 4 Obsoletes: 8216 (if approved) September 23, 2019 5 Intended status: Informational 6 Expires: March 26, 2020 8 HTTP Live Streaming 2nd Edition 9 draft-pantos-hls-rfc8216bis-05 11 Abstract 13 This document obsoletes RFC 8216. It describes a protocol for 14 transferring unbounded streams of multimedia data. It specifies the 15 data format of the files and the actions to be taken by the server 16 (sender) and the clients (receivers) of the streams. It describes 17 version 8 of this protocol. 19 Status of This Memo 21 This Internet-Draft is submitted in full conformance with the 22 provisions of BCP 78 and BCP 79. 24 Internet-Drafts are working documents of the Internet Engineering 25 Task Force (IETF). Note that other groups may also distribute 26 working documents as Internet-Drafts. The list of current Internet- 27 Drafts is at https://datatracker.ietf.org/drafts/current/. 29 Internet-Drafts are draft documents valid for a maximum of six months 30 and may be updated, replaced, or obsoleted by other documents at any 31 time. It is inappropriate to use Internet-Drafts as reference 32 material or to cite them other than as "work in progress." 34 This Internet-Draft will expire on March 26, 2020. 36 Copyright Notice 38 Copyright (c) 2019 IETF Trust and the persons identified as the 39 document authors. All rights reserved. 41 This document is subject to BCP 78 and the IETF Trust's Legal 42 Provisions Relating to IETF Documents 43 (https://trustee.ietf.org/license-info) in effect on the date of 44 publication of this document. Please review these documents 45 carefully, as they describe your rights and restrictions with respect 46 to this document. 48 This document may not be modified, and derivative works of it may not 49 be created, except to format it for publication as an RFC or to 50 translate it into languages other than English. 52 This Informational Internet Draft is submitted as an RFC Editor 53 Contribution and/or non-IETF Document (not as a Contribution, IETF 54 Contribution, nor IETF Document) in accordance with BCP 78 and BCP 55 79. 57 Table of Contents 59 1. Introduction to HTTP Live Streaming . . . . . . . . . . . . . 5 60 2. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . 5 61 3. Media Segments . . . . . . . . . . . . . . . . . . . . . . . 7 62 3.1. Supported Media Segment Formats . . . . . . . . . . . . . 7 63 3.2. MPEG-2 Transport Streams . . . . . . . . . . . . . . . . 8 64 3.3. Fragmented MPEG-4 . . . . . . . . . . . . . . . . . . . . 8 65 3.4. Packed Audio . . . . . . . . . . . . . . . . . . . . . . 9 66 3.5. WebVTT . . . . . . . . . . . . . . . . . . . . . . . . . 9 67 3.6. IMSC Subtitles . . . . . . . . . . . . . . . . . . . . . 10 68 4. Playlists . . . . . . . . . . . . . . . . . . . . . . . . . . 11 69 4.1. Definition of a Playlist . . . . . . . . . . . . . . . . 11 70 4.2. Attribute Lists . . . . . . . . . . . . . . . . . . . . . 12 71 4.3. Variable Substitution . . . . . . . . . . . . . . . . . . 13 72 4.4. Playlist Tags . . . . . . . . . . . . . . . . . . . . . . 14 73 4.4.1. Basic Tags . . . . . . . . . . . . . . . . . . . . . 14 74 4.4.1.1. EXTM3U . . . . . . . . . . . . . . . . . . . . . 14 75 4.4.1.2. EXT-X-VERSION . . . . . . . . . . . . . . . . . . 14 76 4.4.2. Media Segment Tags . . . . . . . . . . . . . . . . . 15 77 4.4.2.1. EXTINF . . . . . . . . . . . . . . . . . . . . . 15 78 4.4.2.2. EXT-X-BYTERANGE . . . . . . . . . . . . . . . . . 15 79 4.4.2.3. EXT-X-DISCONTINUITY . . . . . . . . . . . . . . . 16 80 4.4.2.4. EXT-X-KEY . . . . . . . . . . . . . . . . . . . . 16 81 4.4.2.5. EXT-X-MAP . . . . . . . . . . . . . . . . . . . . 18 82 4.4.2.6. EXT-X-PROGRAM-DATE-TIME . . . . . . . . . . . . . 19 83 4.4.2.7. EXT-X-GAP . . . . . . . . . . . . . . . . . . . . 20 84 4.4.2.8. EXT-X-BITRATE . . . . . . . . . . . . . . . . . . 20 85 4.4.3. Media Metadata Tags . . . . . . . . . . . . . . . . . 20 86 4.4.3.1. EXT-X-DATERANGE . . . . . . . . . . . . . . . . . 20 87 4.4.3.1.1. Mapping SCTE-35 into EXT-X-DATERANGE . . . . 22 88 4.4.4. Media Playlist Tags . . . . . . . . . . . . . . . . . 24 89 4.4.4.1. EXT-X-TARGETDURATION . . . . . . . . . . . . . . 24 90 4.4.4.2. EXT-X-MEDIA-SEQUENCE . . . . . . . . . . . . . . 25 91 4.4.4.3. EXT-X-DISCONTINUITY-SEQUENCE . . . . . . . . . . 25 92 4.4.4.4. EXT-X-ENDLIST . . . . . . . . . . . . . . . . . . 26 93 4.4.4.5. EXT-X-PLAYLIST-TYPE . . . . . . . . . . . . . . . 26 94 4.4.4.6. EXT-X-I-FRAMES-ONLY . . . . . . . . . . . . . . . 26 95 4.4.5. Master Playlist Tags . . . . . . . . . . . . . . . . 27 96 4.4.5.1. EXT-X-MEDIA . . . . . . . . . . . . . . . . . . . 27 97 4.4.5.1.1. Rendition Groups . . . . . . . . . . . . . . 30 98 4.4.5.2. EXT-X-STREAM-INF . . . . . . . . . . . . . . . . 31 99 4.4.5.2.1. Alternative Renditions . . . . . . . . . . . 36 100 4.4.5.3. EXT-X-I-FRAME-STREAM-INF . . . . . . . . . . . . 36 101 4.4.5.4. EXT-X-SESSION-DATA . . . . . . . . . . . . . . . 37 102 4.4.5.5. EXT-X-SESSION-KEY . . . . . . . . . . . . . . . . 38 103 4.4.6. Media or Master Playlist Tags . . . . . . . . . . . . 39 104 4.4.6.1. EXT-X-INDEPENDENT-SEGMENTS . . . . . . . . . . . 39 105 4.4.6.2. EXT-X-START . . . . . . . . . . . . . . . . . . . 39 106 4.4.6.3. EXT-X-DEFINE . . . . . . . . . . . . . . . . . . 40 107 5. Key Files . . . . . . . . . . . . . . . . . . . . . . . . . . 41 108 5.1. Structure of Key Files . . . . . . . . . . . . . . . . . 41 109 5.2. IV for AES-128 . . . . . . . . . . . . . . . . . . . . . 41 110 6. Client/Server Responsibilities . . . . . . . . . . . . . . . 42 111 6.1. Introduction . . . . . . . . . . . . . . . . . . . . . . 42 112 6.2. Server Responsibilities . . . . . . . . . . . . . . . . . 42 113 6.2.1. General Server Responsibilities . . . . . . . . . . . 42 114 6.2.2. Live Playlists . . . . . . . . . . . . . . . . . . . 45 115 6.2.3. Encrypting Media Segments . . . . . . . . . . . . . . 46 116 6.2.4. Providing Variant Streams . . . . . . . . . . . . . . 47 117 6.3. Client Responsibilities . . . . . . . . . . . . . . . . . 48 118 6.3.1. General Client Responsibilities . . . . . . . . . . . 48 119 6.3.2. Loading the Media Playlist File . . . . . . . . . . . 49 120 6.3.3. Playing the Media Playlist File . . . . . . . . . . . 50 121 6.3.4. Reloading the Media Playlist File . . . . . . . . . . 51 122 6.3.5. Determining the Next Segment to Load . . . . . . . . 52 123 6.3.6. Decrypting Encrypted Media Segments . . . . . . . . . 52 124 7. Protocol Version Compatibility . . . . . . . . . . . . . . . 53 125 8. Playlist Examples . . . . . . . . . . . . . . . . . . . . . . 55 126 8.1. Simple Media Playlist . . . . . . . . . . . . . . . . . . 55 127 8.2. Live Media Playlist Using HTTPS . . . . . . . . . . . . . 55 128 8.3. Playlist with Encrypted Media Segments . . . . . . . . . 55 129 8.4. Master Playlist . . . . . . . . . . . . . . . . . . . . . 56 130 8.5. Master Playlist with I-Frames . . . . . . . . . . . . . . 56 131 8.6. Master Playlist with Alternative Audio . . . . . . . . . 57 132 8.7. Master Playlist with Alternative Video . . . . . . . . . 57 133 8.8. Session Data in a Master Playlist . . . . . . . . . . . . 58 134 8.9. CHARACTERISTICS Attribute Containing Multiple 135 Characteristics . . . . . . . . . . . . . . . . . . . . . 58 136 8.10. EXT-X-DATERANGE Carrying SCTE-35 Tags . . . . . . . . . . 59 137 9. Contributors . . . . . . . . . . . . . . . . . . . . . . . . 59 138 10. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 59 139 11. Security Considerations . . . . . . . . . . . . . . . . . . . 60 140 12. References . . . . . . . . . . . . . . . . . . . . . . . . . 61 141 12.1. Normative References . . . . . . . . . . . . . . . . . . 61 142 12.2. Informative References . . . . . . . . . . . . . . . . . 65 143 Appendix A. Changes from RFC 8216 . . . . . . . . . . . . . . . 66 144 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 66 146 1. Introduction to HTTP Live Streaming 148 HTTP Live Streaming provides a reliable, cost-effective means of 149 delivering continuous and long-form video over the Internet. It 150 allows a receiver to adapt the bit rate of the media to the current 151 network conditions in order to maintain uninterrupted playback at the 152 best possible quality. It supports interstitial content boundaries. 153 It provides a flexible framework for media encryption. It can 154 efficiently offer multiple renditions of the same content, such as 155 audio translations. It offers compatibility with large-scale HTTP 156 caching infrastructure to support delivery to large audiences. 158 Since its first draft publication in 2009, HTTP Live Streaming has 159 been implemented and deployed by a wide array of content producers, 160 tools vendors, distributors, and device manufacturers. In the 161 subsequent eight years the protocol has been refined by extensive 162 review and discussion with a variety of media streaming implementors. 164 The purpose of this document is to facilitate interoperability 165 between HTTP Live Streaming implementations by describing the media 166 transmission protocol. Using this protocol, a client can receive a 167 continuous stream of media from a server for concurrent presentation. 169 This document describes version 8 of the protocol. 171 2. Overview 173 A multimedia presentation is specified by a Uniform Resource 174 Identifier (URI) [RFC3986] to a Playlist. 176 A Playlist is either a Media Playlist or a Master Playlist. Both are 177 UTF-8 text files containing URIs and descriptive tags. 179 A Media Playlist contains a list of Media Segments, which, when 180 played sequentially, will play the multimedia presentation. 182 Here is an example of a Media Playlist: 184 #EXTM3U 185 #EXT-X-TARGETDURATION:10 187 #EXTINF:9.009, 188 http://media.example.com/first.ts 189 #EXTINF:9.009, 190 http://media.example.com/second.ts 191 #EXTINF:3.003, 192 http://media.example.com/third.ts 194 The first line is the format identifier tag #EXTM3U. The line 195 containing #EXT-X-TARGETDURATION says that all Media Segments will be 196 10 seconds long or less. Then, three Media Segments are declared. 197 The first and second are 9.009 seconds long; the third is 3.003 198 seconds. 200 To play this Playlist, the client first downloads it and then 201 downloads and plays each Media Segment declared within it. The 202 client reloads the Playlist as described in this document to discover 203 any added segments. Data SHOULD be carried over HTTP [RFC7230], but, 204 in general, a URI can specify any protocol that can reliably transfer 205 the specified resource on demand. 207 A more complex presentation can be described by a Master Playlist. A 208 Master Playlist provides a set of Variant Streams, each of which 209 describes a different version of the same content. 211 A Variant Stream includes a Media Playlist that specifies media 212 encoded at a particular bit rate, in a particular format, and at a 213 particular resolution for media containing video. 215 A Variant Stream can also specify a set of Renditions. Renditions 216 are alternate versions of the content, such as audio produced in 217 different languages or video recorded from different camera angles. 219 Clients should switch between different Variant Streams to adapt to 220 network conditions. Clients should choose Renditions based on user 221 preferences. 223 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 224 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 225 "OPTIONAL" in this document are to be interpreted as described in BCP 226 14 [RFC2119] [RFC8174] when, and only when, they appear in all 227 capitals, as shown here. 229 3. Media Segments 231 A Media Playlist contains a series of Media Segments that make up the 232 overall presentation. A Media Segment is specified by a URI and 233 optionally a byte range. 235 The duration of each Media Segment is indicated in the Media Playlist 236 by its EXTINF tag (Section 4.4.2.1). 238 Each segment in a Media Playlist has a unique integer Media Sequence 239 Number. The Media Sequence Number of the first segment in the Media 240 Playlist is either 0 or declared in the Playlist (Section 4.4.4.2). 241 The Media Sequence Number of every other segment is equal to the 242 Media Sequence Number of the segment that precedes it plus one. 244 Each Media Segment MUST carry the continuation of the encoded 245 bitstream from the end of the segment with the previous Media 246 Sequence Number, where values in a series such as timestamps and 247 Continuity Counters MUST continue uninterrupted. The only exceptions 248 are the first Media Segment ever to appear in a Media Playlist and 249 Media Segments that are explicitly signaled as discontinuities 250 (Section 4.4.2.3). Unmarked media discontinuities can trigger 251 playback errors. 253 Any Media Segment that contains video SHOULD include enough 254 information to initialize a video decoder and decode a continuous set 255 of frames that includes the final frame in the Segment; network 256 efficiency is optimized if there is enough information in the Segment 257 to decode all frames in the Segment. For example, any Media Segment 258 containing H.264 video SHOULD contain an Instantaneous Decoding 259 Refresh (IDR); frames prior to the first IDR will be downloaded but 260 possibly discarded. 262 3.1. Supported Media Segment Formats 264 All Media Segments MUST be in a format described in this section. 265 Transport of other media file formats is not defined. 267 Some media formats require a common sequence of bytes to initialize a 268 parser before a Media Segment can be parsed. This format-specific 269 sequence is called the Media Initialization Section. The Media 270 Initialization Section can be specified by an EXT-X-MAP tag 271 (Section 4.4.2.5). The Media Initialization Section MUST NOT contain 272 sample data. 274 3.2. MPEG-2 Transport Streams 276 MPEG-2 Transport Streams are specified by [ISO_13818]. 278 The Media Initialization Section of an MPEG-2 Transport Stream 279 Segment is a Program Association Table (PAT) followed by a Program 280 Map Table (PMT). 282 Transport Stream Segments MUST contain a single MPEG-2 Program; 283 playback of Multi-Program Transport Streams is not defined. Each 284 Transport Stream Segment MUST contain a PAT and a PMT, or have an 285 EXT-X-MAP tag (Section 4.4.2.5) applied to it. The first two 286 Transport Stream packets in a Segment without an EXT-X-MAP tag SHOULD 287 be a PAT and a PMT. 289 3.3. Fragmented MPEG-4 291 MPEG-4 Fragments are specified by the ISO Base Media File Format 292 [ISOBMFF]. Unlike regular MPEG-4 files that have a Movie Box 293 ('moov') that contains sample tables and a Media Data Box ('mdat') 294 containing the corresponding samples, an MPEG-4 Fragment consists of 295 a Movie Fragment Box ('moof') containing a subset of the sample table 296 and a Media Data Box containing those samples. Use of MPEG-4 297 Fragments does require a Movie Box for initialization, but that Movie 298 Box contains only non-sample-specific information such as track and 299 sample descriptions. 301 A Fragmented MPEG-4 (fMP4) Segment is a "segment" as defined by 302 Section 3 of [ISOBMFF], including the constraints on Media Data Boxes 303 in Section 8.16 of [ISOBMFF]. 305 The Media Initialization Section for an fMP4 Segment is an ISO Base 306 Media File that can initialize a parser for that Segment. 308 Broadly speaking, fMP4 Segments and Media Initialization Sections are 309 [ISOBMFF] files that also satisfy the constraints described in this 310 section. 312 The Media Initialization Section for an fMP4 Segment MUST contain a 313 File Type Box ('ftyp') containing a brand that is compatible with 314 'iso6' or higher. The File Type Box MUST be followed by a Movie Box. 315 The Movie Box MUST contain a Track Box ('trak') for every Track 316 Fragment Box ('traf') in the fMP4 Segment, with matching track_ID. 317 Each Track Box SHOULD contain a sample table, but its sample count 318 MUST be zero. Movie Header Boxes ('mvhd') and Track Header Boxes 319 ('tkhd') MUST have durations of zero. The Movie Box MUST contain a 320 Movie Extends Box ('mvex'); it SHOULD follow the last Track Box. 322 Note that a Common Media Application Format [CMAF] Header meets all 323 these requirements. 325 In an fMP4 Segment, every Track Fragment Box MUST contain a Track 326 Fragment Decode Time Box ('tfdt'). fMP4 Segments MUST use movie- 327 fragment-relative addressing. fMP4 Segments MUST NOT use external 328 data references. Note that a CMAF Segment meets these requirements. 330 An fMP4 Segment in a Playlist containing the EXT-X-I-FRAMES-ONLY tag 331 (Section 4.4.4.6) MAY omit the portion of the Media Data Box 332 following the intra-coded frame (I-frame) sample data. 334 Each fMP4 Segment in a Media Playlist MUST have an EXT-X-MAP tag 335 applied to it. 337 3.4. Packed Audio 339 A Packed Audio Segment contains encoded audio samples and ID3 tags 340 that are simply packed together with minimal framing and no per- 341 sample timestamps. Supported Packed Audio formats are Advanced Audio 342 Coding (AAC) with Audio Data Transport Stream (ADTS) framing 343 [ISO_13818_7], MP3 [ISO_13818_3], AC-3 [AC_3], and Enhanced AC-3 344 [AC_3]. 346 A Packed Audio Segment has no Media Initialization Section. 348 Each Packed Audio Segment MUST signal the timestamp of its first 349 sample with an ID3 Private frame (PRIV) tag [ID3] at the beginning of 350 the segment. The ID3 PRIV owner identifier MUST be 351 "com.apple.streaming.transportStreamTimestamp". The ID3 payload MUST 352 be a 33-bit MPEG-2 Program Elementary Stream timestamp expressed as a 353 big-endian eight-octet number, with the upper 31 bits set to zero. 354 Clients SHOULD NOT play Packed Audio Segments without this ID3 tag. 356 3.5. WebVTT 358 A WebVTT Segment is a section of a WebVTT [WebVTT] file. WebVTT 359 Segments carry subtitles. 361 The Media Initialization Section of a WebVTT Segment is the WebVTT 362 header. 364 Each WebVTT Segment MUST contain all subtitle cues that are intended 365 to be displayed during the period indicated by the segment EXTINF 366 duration. The start time offset and end time offset of each cue MUST 367 indicate the total display time for that cue, even if part of the cue 368 time range is outside the Segment period. A WebVTT Segment MAY 369 contain no cues; this indicates that no subtitles are to be displayed 370 during that period. 372 Each WebVTT Segment MUST either start with a WebVTT header or have an 373 EXT-X-MAP tag applied to it. 375 In order to synchronize timestamps between audio/video and subtitles, 376 an X-TIMESTAMP-MAP metadata header SHOULD be added to each WebVTT 377 header. This header maps WebVTT cue timestamps to media timestamps 378 in other Renditions of the Variant Stream. Its format is: 380 X-TIMESTAMP-MAP=LOCAL:,MPEGTS: 381 e.g., X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000 383 indicating the media time to which the cue time MUST be mapped. The 384 cue timestamp in the LOCAL attribute MAY fall outside the range of 385 time covered by the segment. 387 The MPEGTS media timestamp MUST use a 90KHz timescale, even when non- 388 WebVTT Media Segments use a different timescale. 390 If a WebVTT segment does not have the X-TIMESTAMP-MAP, the client 391 MUST assume that the WebVTT cue time of 0 maps to an media timestamp 392 of 0. 394 When synchronizing WebVTT with PES timestamps, clients SHOULD account 395 for cases where the 33-bit PES timestamps have wrapped and the WebVTT 396 cue times have not. When the PES timestamp wraps, the WebVTT segment 397 SHOULD have a X-TIMESTAMP-MAP header that maps the current WebVTT 398 time to the new (low valued) PES timestamp. 400 3.6. IMSC Subtitles 402 An IMSC Segment is a Fragmented MPEG-4 (Section 3.3) Media Segment 403 that carries subtitle media according to MPEG-4 Part 30 404 [MP4_TIMED_TEXT]. This subtitle media MUST comply with the Text 405 Profile of IMSC1 [IMSC1]. 407 The Media Initialization Section of an IMSC Segment is specified in 408 Section 3.3. 410 Each IMSC Segment MUST contain all subtitle samples that are intended 411 to be displayed during the period indicated by the segment EXTINF 412 duration. Each Segment MUST contain definitions for all styles which 413 are applied to any part of any sample in the Segment. 415 4. Playlists 417 This section describes the Playlist files used by HTTP Live 418 Streaming. In this section, "MUST" and "MUST NOT" specify the rules 419 for the syntax and structure of legal Playlist files. Playlists that 420 violate these rules are invalid; clients MUST fail to parse them. 421 See Section 6.3.2. 423 The format of the Playlist files is derived from the M3U [M3U] 424 playlist file format and inherits two tags from that earlier file 425 format: EXTM3U (Section 4.4.1.1) and EXTINF (Section 4.4.2.1). 427 In the specification of tag syntax, a string enclosed by <> 428 identifies a tag parameter; its specific format is described in its 429 tag definition. If a parameter is further surrounded by [], it is 430 optional; otherwise, it is required. 432 Each Playlist file MUST be identifiable either by the path component 433 of its URI or by HTTP Content-Type. In the first case, the path MUST 434 end with either .m3u8 or .m3u. In the second, the HTTP Content-Type 435 MUST be "application/vnd.apple.mpegurl" or "audio/mpegurl". Clients 436 SHOULD refuse to parse Playlists that are not so identified. 438 4.1. Definition of a Playlist 440 Playlist files MUST be encoded in UTF-8 [RFC3629]. They MUST NOT 441 contain any Byte Order Mark (BOM); clients SHOULD fail to parse 442 Playlists that contain a BOM or do not parse as UTF-8. Playlist 443 files MUST NOT contain UTF-8 control characters (U+0000 to U+001F and 444 U+007F to U+009F), with the exceptions of CR (U+000D) and LF 445 (U+000A). All character sequences MUST be normalized according to 446 Unicode normalization form "NFC" [UNICODE]. Note that US-ASCII 447 [US_ASCII] conforms to these rules. 449 Lines in a Playlist file are terminated by either a single line feed 450 character or a carriage return character followed by a line feed 451 character. Each line is a URI, is blank, or starts with the 452 character '#'. Blank lines are ignored. Whitespace MUST NOT be 453 present, except for elements in which it is explicitly specified. 455 Lines that start with the character '#' are either comments or tags. 456 Tags begin with #EXT. They are case sensitive. All other lines that 457 begin with '#' are comments and SHOULD be ignored. 459 A URI line identifies a Media Segment or a Playlist file (see 460 Section 4.4.5.2). Each Media Segment is specified by a URI and the 461 tags that apply to it. 463 A Playlist is a Media Playlist if all URI lines in the Playlist 464 identify Media Segments. A Playlist is a Master Playlist if all URI 465 lines in the Playlist identify Media Playlists. A Playlist MUST be 466 either a Media Playlist or a Master Playlist; all other Playlists are 467 invalid. 469 A URI in a Playlist, whether it is a URI line or part of a tag, MAY 470 be relative. Any relative URI is considered to be relative to the 471 URI of the Playlist that contains it. 473 The duration of a Media Playlist is the sum of the durations of the 474 Media Segments within it. 476 The segment bit rate of a Media Segment is the size of the Media 477 Segment divided by its EXTINF duration (Section 4.4.2.1). Note that 478 this includes container overhead but does not include overhead 479 imposed by the delivery system, such as HTTP, TCP, or IP headers. 481 The peak segment bit rate of a Media Playlist is the largest bit rate 482 of any contiguous set of segments whose total duration is between 0.5 483 times the target duration and 1.5 times the target duration plus 0.5 484 seconds (since media segments may exceed the target duration by up to 485 0.5 seconds). The bit rate of a set is calculated by dividing the 486 sum of the segment sizes by the sum of the segment durations. 488 The average segment bit rate of a Media Playlist is the sum of the 489 sizes (in bits) of every Media Segment in the Media Playlist, divided 490 by the Media Playlist duration. Note that this includes container 491 overhead, but not HTTP or other overhead imposed by the delivery 492 system. 494 4.2. Attribute Lists 496 Certain tags have values that are attribute-lists. An attribute-list 497 is a comma-separated list of attribute/value pairs with no 498 whitespace. 500 An attribute/value pair has the following syntax: 502 AttributeName=AttributeValue 504 An AttributeName is an unquoted string containing characters from the 505 set [A..Z], [0..9], and '-'. Therefore, AttributeNames contain only 506 uppercase letters, not lowercase. There MUST NOT be any whitespace 507 between the AttributeName and the '=' character, nor between the '=' 508 character and the AttributeValue. 510 An AttributeValue is one of the following: 512 o decimal-integer: an unquoted string of characters from the set 513 [0..9] expressing an integer in base-10 arithmetic in the range 514 from 0 to 2^64-1 (18446744073709551615). A decimal-integer may be 515 from 1 to 20 characters long. 517 o hexadecimal-sequence: an unquoted string of characters from the 518 set [0..9] and [A..F] that is prefixed with 0x or 0X. The maximum 519 length of a hexadecimal-sequence depends on its AttributeNames. 521 o decimal-floating-point: an unquoted string of characters from the 522 set [0..9] and '.' that expresses a non-negative floating-point 523 number in decimal positional notation. 525 o signed-decimal-floating-point: an unquoted string of characters 526 from the set [0..9], '-', and '.' that expresses a signed 527 floating-point number in decimal positional notation. 529 o quoted-string: a string of characters within a pair of double 530 quotes (0x22). The following characters MUST NOT appear in a 531 quoted-string: line feed (0xA), carriage return (0xD), or double 532 quote (0x22). Quoted-string AttributeValues SHOULD be constructed 533 so that byte-wise comparison is sufficient to test two quoted- 534 string AttributeValues for equality. Note that this implies case- 535 sensitive comparison. 537 o enumerated-string: an unquoted character string from a set that is 538 explicitly defined by the AttributeName. An enumerated-string 539 will never contain double quotes ("), commas (,), or whitespace. 541 o decimal-resolution: two decimal-integers separated by the "x" 542 character. The first integer is a horizontal pixel dimension 543 (width); the second is a vertical pixel dimension (height). 545 The type of the AttributeValue for a given AttributeName is specified 546 by the attribute definition. 548 A given AttributeName MUST NOT appear more than once in a given 549 attribute-list. Clients SHOULD refuse to parse such Playlists. 551 4.3. Variable Substitution 553 The following Playlist elements are subject to variable substitution: 555 o URI lines 557 o quoted-string AttributeValues 559 o hexadecimal-sequence AttributeValues 560 A Variable Reference is a string of the form "{$" (0x7B,0x24) 561 followed by a Variable Name followed by "}" (0x7D). Variable Names 562 are defined by the EXT-X-DEFINE tag (Section 4.4.6.3). 564 See Section 6.3.1 for more information about variable substitution. 566 4.4. Playlist Tags 568 Playlist tags specify either global parameters of the Playlist or 569 information about the Media Segments or Media Playlists that appear 570 after them. 572 4.4.1. Basic Tags 574 These tags are allowed in both Media Playlists and Master Playlists. 576 4.4.1.1. EXTM3U 578 The EXTM3U tag indicates that the file is an Extended M3U [M3U] 579 Playlist file. It MUST be the first line of every Media Playlist and 580 every Master Playlist. Its format is: 582 #EXTM3U 584 4.4.1.2. EXT-X-VERSION 586 The EXT-X-VERSION tag indicates the compatibility version of the 587 Playlist file, its associated media, and its server. 589 The EXT-X-VERSION tag applies to the entire Playlist file. Its 590 format is: 592 #EXT-X-VERSION: 594 where n is an integer indicating the protocol compatibility version 595 number. 597 It MUST appear in all Playlists containing tags or attributes that 598 are not compatible with protocol version 1 to support 599 interoperability with older clients. Section 7 specifies the minimum 600 value of the compatibility version number for any given Playlist 601 file. 603 A Playlist file MUST NOT contain more than one EXT-X-VERSION tag. If 604 a client encounters a Playlist with multiple EXT-X-VERSION tags, it 605 MUST fail to parse it. 607 4.4.2. Media Segment Tags 609 Each Media Segment is specified by a series of Media Segment tags 610 followed by a URI. Some Media Segment tags apply to just the next 611 segment; others apply to all subsequent segments until another 612 instance of the same tag. 614 A Media Segment tag MUST NOT appear in a Master Playlist. Clients 615 MUST fail to parse Playlists that contain both Media Segment tags and 616 Master Playlist tags (Section 4.4.5). 618 4.4.2.1. EXTINF 620 The EXTINF tag specifies the duration of a Media Segment. It applies 621 only to the next Media Segment. This tag is REQUIRED for each Media 622 Segment. Its format is: 624 #EXTINF:,[] 626 where duration is a decimal-floating-point or decimal-integer number 627 (as described in Section 4.2) that specifies the duration of the 628 Media Segment in seconds. Durations SHOULD be decimal-floating- 629 point, with enough accuracy to avoid perceptible error when segment 630 durations are accumulated. However, if the compatibility version 631 number is less than 3, durations MUST be integers. Durations that 632 are reported as integers SHOULD be rounded to the nearest integer. 633 The remainder of the line following the comma is an optional human- 634 readable informative title of the Media Segment expressed as UTF-8 635 text. 637 4.4.2.2. EXT-X-BYTERANGE 639 The EXT-X-BYTERANGE tag indicates that a Media Segment is a sub-range 640 of the resource identified by its URI. It applies only to the next 641 URI line that follows it in the Playlist. Its format is: 643 #EXT-X-BYTERANGE:<n>[@<o>] 645 where n is a decimal-integer indicating the length of the sub-range 646 in bytes. If present, o is a decimal-integer indicating the start of 647 the sub-range, as a byte offset from the beginning of the resource. 648 If o is not present, the sub-range begins at the next byte following 649 the sub-range of the previous Media Segment. 651 If o is not present, a previous Media Segment MUST appear in the 652 Playlist file and MUST be a sub-range of the same media resource, or 653 the Media Segment is undefined and the client MUST fail to parse the 654 Playlist. 656 A Media Segment without an EXT-X-BYTERANGE tag consists of the entire 657 resource identified by its URI. 659 Use of the EXT-X-BYTERANGE tag REQUIRES a compatibility version 660 number of 4 or greater. 662 4.4.2.3. EXT-X-DISCONTINUITY 664 The EXT-X-DISCONTINUITY tag indicates a discontinuity between the 665 Media Segment that follows it and the one that preceded it. 667 Its format is: 669 #EXT-X-DISCONTINUITY 671 The EXT-X-DISCONTINUITY tag MUST be present if there is a change in 672 any of the following characteristics: 674 o file format 676 o number, type, and identifiers of tracks 678 o timestamp sequence 680 The EXT-X-DISCONTINUITY tag SHOULD be present if there is a change in 681 any of the following characteristics: 683 o encoding parameters 685 o encoding sequence 687 See Section 3, Section 6.2.1, and Section 6.3.3 for more information 688 about the EXT-X-DISCONTINUITY tag. 690 4.4.2.4. EXT-X-KEY 692 Media Segments MAY be encrypted. The EXT-X-KEY tag specifies how to 693 decrypt them. It applies to every Media Segment and to every Media 694 Initialization Section declared by an EXT-X-MAP tag that appears 695 between it and the next EXT-X-KEY tag in the Playlist file with the 696 same KEYFORMAT attribute (or the end of the Playlist file). Two or 697 more EXT-X-KEY tags with different KEYFORMAT attributes MAY apply to 698 the same Media Segment if they ultimately produce the same decryption 699 key. The format is: 701 #EXT-X-KEY:<attribute-list> 703 The following attributes are defined: 705 METHOD 707 The value is an enumerated-string that specifies the encryption 708 method. This attribute is REQUIRED. 710 The methods defined are: NONE, AES-128, and SAMPLE-AES. 712 An encryption method of NONE means that Media Segments are not 713 encrypted. If the encryption method is NONE, other attributes 714 MUST NOT be present. 716 An encryption method of AES-128 signals that Media Segments are 717 completely encrypted using the Advanced Encryption Standard (AES) 718 [AES_128] with a 128-bit key, Cipher Block Chaining (CBC), and 719 Public-Key Cryptography Standards #7 (PKCS7) padding [RFC5652]. 720 CBC is restarted on each segment boundary, using either the 721 Initialization Vector (IV) attribute value or the Media Sequence 722 Number as the IV; see Section 5.2. 724 An alternative to whole-segment encryption is Sample Encryption. 725 With Sample Encryption, only media sample data - such as audio 726 packets or video frames - is encrypted. The rest of the Media 727 Segment is unencrypted. Sample Encryption allows parts of the 728 Segment to be processed without (or before) decrypting the media 729 itself. 731 An encryption method of SAMPLE-AES means that the Media Segments 732 are Sample Encrypted using the Advanced Encryption Standard 733 [AES_128]. How these media streams are encrypted and encapsulated 734 in a segment depends on the media encoding and the media format of 735 the segment. fMP4 Media Segments are encrypted using the 'cbcs' 736 scheme of Common Encryption [COMMON_ENC]. Encryption of other 737 Media Segment formats containing H.264 [H_264], AAC [ISO_14496], 738 AC-3 [AC_3], and Enhanced AC-3 [AC_3] media streams is described 739 in the HTTP Live Streaming (HLS) Sample Encryption specification 740 [SampleEnc]. The IV attribute MAY be present; see Section 5.2. 742 URI 744 The value is a quoted-string containing a URI that specifies how 745 to obtain the key. This attribute is REQUIRED unless the METHOD 746 is NONE. 748 IV 750 The value is a hexadecimal-sequence that specifies a 128-bit 751 unsigned integer Initialization Vector to be used with the key. 753 Use of the IV attribute REQUIRES a compatibility version number of 754 2 or greater. See Section 5.2 for when the IV attribute is used. 756 KEYFORMAT 758 The value is a quoted-string that specifies how the key is 759 represented in the resource identified by the URI; see Section 5 760 for more detail. This attribute is OPTIONAL; its absence 761 indicates an implicit value of "identity". Use of the KEYFORMAT 762 attribute REQUIRES a compatibility version number of 5 or greater. 764 KEYFORMATVERSIONS 766 The value is a quoted-string containing one or more positive 767 integers separated by the "/" character (for example, "1", "1/2", 768 or "1/2/5"). If more than one version of a particular KEYFORMAT 769 is defined, this attribute can be used to indicate which 770 version(s) this instance complies with. This attribute is 771 OPTIONAL; if it is not present, its value is considered to be "1". 772 Use of the KEYFORMATVERSIONS attribute REQUIRES a compatibility 773 version number of 5 or greater. 775 If the Media Playlist file does not contain an EXT-X-KEY tag, then 776 Media Segments are not encrypted. 778 See Section 5 for the format of the Key file, and Section 5.2, 779 Section 6.2.3, and Section 6.3.6 for additional information on Media 780 Segment encryption. 782 4.4.2.5. EXT-X-MAP 784 The EXT-X-MAP tag specifies how to obtain the Media Initialization 785 Section (Section 3) required to parse the applicable Media Segments. 786 It applies to every Media Segment that appears after it in the 787 Playlist until the next EXT-X-MAP tag or until the end of the 788 Playlist. 790 Its format is: 792 #EXT-X-MAP:<attribute-list> 794 The following attributes are defined: 796 URI 798 The value is a quoted-string containing a URI that identifies a 799 resource that contains the Media Initialization Section. This 800 attribute is REQUIRED. 802 BYTERANGE 804 The value is a quoted-string specifying a byte range into the 805 resource identified by the URI attribute. This range SHOULD 806 contain only the Media Initialization Section. The format of the 807 byte range is described in Section 4.4.2.2. This attribute is 808 OPTIONAL; if it is not present, the byte range is the entire 809 resource indicated by the URI. 811 An EXT-X-MAP tag SHOULD be supplied for Media Segments in Playlists 812 with the EXT-X-I-FRAMES-ONLY tag when the first Media Segment (i.e., 813 I-frame) in the Playlist (or the first segment following an EXT- 814 X-DISCONTINUITY tag) does not immediately follow the Media 815 Initialization Section at the beginning of its resource. 817 Use of the EXT-X-MAP tag in a Media Playlist that contains the EXT- 818 X-I-FRAMES-ONLY tag REQUIRES a compatibility version number of 5 or 819 greater. Use of the EXT-X-MAP tag in a Media Playlist that DOES NOT 820 contain the EXT-X-I-FRAMES-ONLY tag REQUIRES a compatibility version 821 number of 6 or greater. 823 If the Media Initialization Section declared by an EXT-X-MAP tag is 824 encrypted with a METHOD of AES-128, the IV attribute of the EXT-X-KEY 825 tag that applies to the EXT-X-MAP is REQUIRED. 827 4.4.2.6. EXT-X-PROGRAM-DATE-TIME 829 The EXT-X-PROGRAM-DATE-TIME tag associates the first sample of a 830 Media Segment with an absolute date and/or time. It applies only to 831 the next Media Segment. Its format is: 833 #EXT-X-PROGRAM-DATE-TIME:<date-time-msec> 835 where date-time-msec is an ISO/IEC 8601:2004 [ISO_8601] date/time 836 representation, such as YYYY-MM-DDThh:mm:ss.SSSZ. It SHOULD indicate 837 a time zone and fractional parts of seconds, to millisecond accuracy. 839 For example: 841 #EXT-X-PROGRAM-DATE-TIME:2010-02-19T14:54:23.031+08:00 843 See Section 6.2.1 and Section 6.3.3 for more information on the EXT- 844 X-PROGRAM-DATE-TIME tag. 846 4.4.2.7. EXT-X-GAP 848 The EXT-X-GAP tag indicates that the segment URL to which it applies 849 does not contain media data and SHOULD NOT be loaded by clients. It 850 applies only to the next Media Segment. 852 Its format is: 854 #EXT-X-GAP 856 See Section 6.2.1 and Section 6.3.3 for more information on the EXT- 857 X-GAP tag. 859 4.4.2.8. EXT-X-BITRATE 861 The EXT-X-BITRATE tag identifies the approximate segment bit rate of 862 the Media Segment(s) to which it applies. It applies to every Media 863 Segment between it and the next EXT-X-BITRATE tag in the Playlist 864 file (or the end of the Playlist file) that does not have an EXT- 865 X-BYTERANGE tag applied to it. Its format is: 867 #EXT-X-BITRATE:<rate> 869 where rate is a decimal-integer of kilobits per second. 871 This tag is OPTIONAL. If it is present then its value MUST be no 872 less than 90% of the segment bit rate of each Media Segment to which 873 it is applied and no greater than 110% of the segment bit rate of 874 each Media Segment to which it is applied. 876 4.4.3. Media Metadata Tags 878 Media Metadata tags provide information about the playlist that is 879 not associated with specific Media Segments. There MAY be more than 880 one Media Metadata tag of each type in any Media Playlist. 882 4.4.3.1. EXT-X-DATERANGE 884 The EXT-X-DATERANGE tag associates a Date Range (i.e., a range of 885 time defined by a starting and ending date) with a set of attribute/ 886 value pairs. Its format is: 888 #EXT-X-DATERANGE:<attribute-list> 890 where the defined attributes are: 892 ID 893 A quoted-string that uniquely identifies a Date Range in the 894 Playlist. This attribute is REQUIRED. 896 CLASS 898 A client-defined quoted-string that specifies some set of 899 attributes and their associated value semantics. All Date Ranges 900 with the same CLASS attribute value MUST adhere to these 901 semantics. This attribute is OPTIONAL. 903 START-DATE 905 A quoted-string containing the [ISO_8601] date/time at which the 906 Date Range begins. This attribute is REQUIRED. 908 END-DATE 910 A quoted-string containing the [ISO_8601] date/time at which the 911 Date Range ends. It MUST be equal to or later than the value of 912 the START-DATE attribute. This attribute is OPTIONAL. 914 DURATION 916 The duration of the Date Range expressed as a decimal-floating- 917 point number of seconds. It MUST NOT be negative. A single 918 instant in time (e.g., crossing a finish line) SHOULD be 919 represented with a duration of 0. This attribute is OPTIONAL. 921 PLANNED-DURATION 923 The expected duration of the Date Range expressed as a decimal- 924 floating-point number of seconds. It MUST NOT be negative. This 925 attribute SHOULD be used to indicate the expected duration of a 926 Date Range whose actual duration is not yet known. It is 927 OPTIONAL. 929 X-<client-attribute> 931 The "X-" prefix defines a namespace reserved for client-defined 932 attributes. The client-attribute MUST be a legal AttributeName. 933 Clients SHOULD use a reverse-DNS syntax when defining their own 934 attribute names to avoid collisions. The attribute value MUST be 935 a quoted-string, a hexadecimal-sequence, or a decimal-floating- 936 point. An example of a client-defined attribute is X-COM-EXAMPLE- 937 AD-ID="XYZ123". These attributes are OPTIONAL. 939 SCTE35-CMD, SCTE35-OUT, SCTE35-IN 940 Used to carry SCTE-35 data; see Section 4.4.3.1.1 for more 941 information. These attributes are OPTIONAL. 943 END-ON-NEXT 945 An enumerated-string whose value MUST be YES. This attribute 946 indicates that the end of the range containing it is equal to the 947 START-DATE of its Following Range. The Following Range is the 948 Date Range of the same CLASS that has the earliest START-DATE 949 after the START-DATE of the range in question. This attribute is 950 OPTIONAL. 952 An EXT-X-DATERANGE tag with an END-ON-NEXT=YES attribute MUST have a 953 CLASS attribute. Other EXT-X-DATERANGE tags with the same CLASS 954 attribute MUST NOT specify Date Ranges that overlap. 956 An EXT-X-DATERANGE tag with an END-ON-NEXT=YES attribute MUST NOT 957 contain DURATION or END-DATE attributes. 959 A Date Range with neither a DURATION, an END-DATE, nor an END-ON- 960 NEXT=YES attribute has an unknown duration, even if it has a PLANNED- 961 DURATION. 963 If a Playlist contains an EXT-X-DATERANGE tag, it MUST also contain 964 at least one EXT-X-PROGRAM-DATE-TIME tag. 966 If a Playlist contains two EXT-X-DATERANGE tags with the same ID 967 attribute value, then any AttributeName that appears in both tags 968 MUST have the same AttributeValue. 970 If a Date Range contains both a DURATION attribute and an END-DATE 971 attribute, the value of the END-DATE attribute MUST be equal to the 972 value of the START-DATE attribute plus the value of the DURATION 973 attribute. 975 Clients SHOULD ignore EXT-X-DATERANGE tags with illegal syntax. 977 4.4.3.1.1. Mapping SCTE-35 into EXT-X-DATERANGE 979 Splice information carried in source media according to the SCTE-35 980 specification [SCTE35] MAY be represented in a Media Playlist using 981 EXT-X-DATERANGE tags. 983 Each SCTE-35 splice_info_section() containing a splice_null(), 984 splice_schedule(), bandwidth_reservation(), or private_cmd() SHOULD 985 be represented by an EXT-X-DATERANGE tag with an SCTE35-CMD attribute 986 whose value is the big-endian binary representation of the 987 splice_info_section(), expressed as a hexadecimal-sequence. 989 An SCTE-35 splice out/in pair signaled by a pair of splice_insert() 990 commands SHOULD be represented by one or more EXT-X-DATERANGE tags 991 carrying the same ID attribute, which MUST be unique to that splice 992 out/in pair. The "out" splice_info_section() (with 993 out_of_network_indicator set to 1) MUST be placed in an SCTE35-OUT 994 attribute, with the same formatting as SCTE35-CMD. The "in" 995 splice_info_section() (with out_of_network_indicator set to 0) MUST 996 be placed in an SCTE35-IN attribute, with the same formatting as 997 SCTE35-CMD. 999 An SCTE-35 splice out/in pair signaled by a pair of time_signal() 1000 commands, each carrying a single segmentation_descriptor(), SHOULD be 1001 represented by one or more EXT-X-DATERANGE tags carrying the same ID 1002 attribute, which MUST be unique to that splice out/in pair. The 1003 "out" splice_info_section() MUST be placed in an SCTE35-OUT 1004 attribute; the "in" splice_info_section() MUST be placed in an 1005 SCTE35-IN attribute. 1007 Different types of segmentation, as indicated by the 1008 segmentation_type_id in the segmentation_descriptor(), SHOULD be 1009 represented by separate EXT-X-DATERANGE tags, even if two or more 1010 segmentation_descriptor()s arrive in the same splice_info_section(). 1011 In that case, each EXT-X-DATERANGE tag will have an SCTE35-OUT, 1012 SCTE35-IN, or SCTE35-CMD attribute whose value is the entire 1013 splice_info_section(). 1015 An SCTE-35 time_signal() command that does not signal a splice out or 1016 in point SHOULD be represented by an EXT-X-DATERANGE tag with an 1017 SCTE35-CMD attribute. 1019 The START-DATE of an EXT-X-DATERANGE tag containing an SCTE35-OUT 1020 attribute MUST be the date and time that corresponds to the program 1021 time of that splice. 1023 The START-DATE of an EXT-X-DATERANGE tag containing an SCTE35-CMD 1024 MUST be the date and time specified by the splice_time() in the 1025 command or the program time at which the command appeared in the 1026 source stream if the command does not specify a splice_time(). 1028 An EXT-X-DATERANGE tag containing an SCTE35-OUT attribute MAY contain 1029 a PLANNED-DURATION attribute. Its value MUST be the planned duration 1030 of the splice. 1032 The DURATION of an EXT-X-DATERANGE tag containing an SCTE35-IN 1033 attribute MUST be the actual (not planned) program duration between 1034 the corresponding out-point and that in-point. 1036 The END-DATE of an EXT-X-DATERANGE tag containing an SCTE35-IN 1037 attribute MUST be the actual (not planned) program date and time of 1038 that in-point. 1040 If the actual end date and time is not known when an SCTE35-OUT 1041 attribute is added to the Playlist, the DURATION attribute and the 1042 END-TIME attribute MUST NOT be present; the actual end date of the 1043 splice SHOULD be signaled by another EXT-X-DATERANGE tag once it has 1044 been established. 1046 A canceled splice SHOULD NOT appear in the Playlist as an EXT- 1047 X-DATERANGE tag. 1049 An EXT-X-DATERANGE tag announcing a splice SHOULD be added to a 1050 Playlist at the same time as the last pre-splice Media Segment, or 1051 earlier if possible. 1053 The ID attribute of an EXT-X-DATERANGE tag MAY contain a 1054 splice_event_id and/or a segmentation_event_id, but it MUST be unique 1055 in the Playlist. If there is a possibility that an SCTE-35 id will 1056 be reused, the ID attribute value MUST include disambiguation, such 1057 as a date or sequence number. 1059 4.4.4. Media Playlist Tags 1061 Media Playlist tags describe global parameters of the Media Playlist. 1062 There MUST NOT be more than one Media Playlist tag of each type in 1063 any Media Playlist. 1065 A Media Playlist tag MUST NOT appear in a Master Playlist 1067 4.4.4.1. EXT-X-TARGETDURATION 1069 The EXT-X-TARGETDURATION tag specifies the maximum Media Segment 1070 duration. The EXTINF duration of each Media Segment in the Playlist 1071 file, when rounded to the nearest integer, MUST be less than or equal 1072 to the target duration; longer segments can trigger playback stalls 1073 or other errors. It applies to the entire Playlist file. Its format 1074 is: 1076 #EXT-X-TARGETDURATION:<s> 1078 where s is a decimal-integer indicating the target duration in 1079 seconds. The EXT-X-TARGETDURATION tag is REQUIRED. 1081 4.4.4.2. EXT-X-MEDIA-SEQUENCE 1083 The EXT-X-MEDIA-SEQUENCE tag indicates the Media Sequence Number of 1084 the first Media Segment that appears in a Playlist file. Its format 1085 is: 1087 #EXT-X-MEDIA-SEQUENCE:<number> 1089 where number is a decimal-integer. 1091 If the Media Playlist file does not contain an EXT-X-MEDIA-SEQUENCE 1092 tag, then the Media Sequence Number of the first Media Segment in the 1093 Media Playlist SHALL be considered to be 0. A client MUST NOT assume 1094 that segments with the same Media Sequence Number in different Media 1095 Playlists contain matching content (see Section 6.3.2). 1097 A URI for a Media Segment is not required to contain its Media 1098 Sequence Number. 1100 See Section 6.2.1 and Section 6.3.5 for more information on setting 1101 the EXT-X-MEDIA-SEQUENCE tag. 1103 The EXT-X-MEDIA-SEQUENCE tag MUST appear before the first Media 1104 Segment in the Playlist. 1106 4.4.4.3. EXT-X-DISCONTINUITY-SEQUENCE 1108 The EXT-X-DISCONTINUITY-SEQUENCE tag allows synchronization between 1109 different Renditions of the same Variant Stream or different Variant 1110 Streams that have EXT-X-DISCONTINUITY tags in their Media Playlists. 1112 Its format is: 1114 #EXT-X-DISCONTINUITY-SEQUENCE:<number> 1116 where number is a decimal-integer. 1118 If the Media Playlist does not contain an EXT-X-DISCONTINUITY- 1119 SEQUENCE tag, then the Discontinuity Sequence Number of the first 1120 Media Segment in the Playlist SHALL be considered to be 0. 1122 The EXT-X-DISCONTINUITY-SEQUENCE tag MUST appear before the first 1123 Media Segment in the Playlist. 1125 The EXT-X-DISCONTINUITY-SEQUENCE tag MUST appear before any EXT- 1126 X-DISCONTINUITY tag. 1128 See Section 6.2.1 and Section 6.2.2 for more information about 1129 setting the value of the EXT-X-DISCONTINUITY-SEQUENCE tag. 1131 4.4.4.4. EXT-X-ENDLIST 1133 The EXT-X-ENDLIST tag indicates that no more Media Segments will be 1134 added to the Media Playlist file. It MAY occur anywhere in the Media 1135 Playlist file. Its format is: 1137 #EXT-X-ENDLIST 1139 4.4.4.5. EXT-X-PLAYLIST-TYPE 1141 The EXT-X-PLAYLIST-TYPE tag provides mutability information about the 1142 Media Playlist file. It applies to the entire Media Playlist file. 1143 It is OPTIONAL. Its format is: 1145 #EXT-X-PLAYLIST-TYPE:<type-enum> 1147 where type-enum is either EVENT or VOD. 1149 Section 6.2.1 defines the implications of the EXT-X-PLAYLIST-TYPE 1150 tag. 1152 If the EXT-X-PLAYLIST-TYPE value is EVENT, Media Segments can only be 1153 added to the end of the Media Playlist. If the EXT-X-PLAYLIST-TYPE 1154 value is Video On Demand (VOD), the Media Playlist cannot change. 1156 If the EXT-X-PLAYLIST-TYPE tag is omitted from a Media Playlist, the 1157 Playlist can be updated according to the rules in Section 6.2.1 with 1158 no additional restrictions. For example, a live Playlist 1159 (Section 6.2.2) MAY be updated to remove Media Segments in the order 1160 that they appeared. 1162 4.4.4.6. EXT-X-I-FRAMES-ONLY 1164 The EXT-X-I-FRAMES-ONLY tag indicates that each Media Segment in the 1165 Playlist describes a single I-frame. I-frames are encoded video 1166 frames whose decoding does not depend on any other frame. I-frame 1167 Playlists can be used for trick play, such as fast forward, rapid 1168 reverse, and scrubbing. 1170 The EXT-X-I-FRAMES-ONLY tag applies to the entire Playlist. Its 1171 format is: 1173 #EXT-X-I-FRAMES-ONLY 1174 In a Playlist with the EXT-X-I-FRAMES-ONLY tag, the Media Segment 1175 duration (EXTINF tag value) is the time between the presentation time 1176 of the I-frame in the Media Segment and the presentation time of the 1177 next I-frame in the Playlist, or the end of the presentation if it is 1178 the last I-frame in the Playlist. 1180 Media resources containing I-frame segments MUST begin with either a 1181 Media Initialization Section (Section 3) or be accompanied by an EXT- 1182 X-MAP tag indicating the Media Initialization Section so that clients 1183 can load and decode I-frame segments in any order. The byte range of 1184 an I-frame segment with an EXT-X-BYTERANGE tag applied to it 1185 (Section 4.4.2.2) MUST NOT include its Media Initialization Section; 1186 clients can assume that the Media Initialization Section is defined 1187 by the EXT-X-MAP tag, or is located between the start of the resource 1188 and the offset of the first I-frame segment in that resource. 1190 Use of the EXT-X-I-FRAMES-ONLY REQUIRES a compatibility version 1191 number of 4 or greater. 1193 4.4.5. Master Playlist Tags 1195 Master Playlist tags define the Variant Streams, Renditions, and 1196 other global parameters of the presentation. 1198 Master Playlist tags MUST NOT appear in a Media Playlist; clients 1199 MUST fail to parse any Playlist that contains both a Master Playlist 1200 tag and either a Media Playlist tag or a Media Segment tag. 1202 4.4.5.1. EXT-X-MEDIA 1204 The EXT-X-MEDIA tag is used to relate Media Playlists that contain 1205 alternative Renditions (Section 4.4.5.2.1) of the same content. For 1206 example, three EXT-X-MEDIA tags can be used to identify audio-only 1207 Media Playlists that contain English, French, and Spanish Renditions 1208 of the same presentation. Or, two EXT-X-MEDIA tags can be used to 1209 identify video-only Media Playlists that show two different camera 1210 angles. 1212 Its format is: 1214 #EXT-X-MEDIA:<attribute-list> 1216 The following attributes are defined: 1218 TYPE 1220 The value is an enumerated-string; valid strings are AUDIO, VIDEO, 1221 SUBTITLES, and CLOSED-CAPTIONS. This attribute is REQUIRED. 1223 Typically, closed-caption [CEA608] media is carried in the video 1224 stream. Therefore, an EXT-X-MEDIA tag with TYPE of CLOSED- 1225 CAPTIONS does not specify a Rendition; the closed-caption media is 1226 present in the Media Segments of every video Rendition. 1228 URI 1230 The value is a quoted-string containing a URI that identifies the 1231 Media Playlist file. This attribute is OPTIONAL; see 1232 Section 4.4.5.2.1. If the TYPE is CLOSED-CAPTIONS, the URI 1233 attribute MUST NOT be present. 1235 GROUP-ID 1237 The value is a quoted-string that specifies the group to which the 1238 Rendition belongs. See Section 4.4.5.1.1. This attribute is 1239 REQUIRED. 1241 LANGUAGE 1243 The value is a quoted-string containing one of the standard Tags 1244 for Identifying Languages [RFC5646], which identifies the primary 1245 language used in the Rendition. This attribute is OPTIONAL. 1247 ASSOC-LANGUAGE 1249 The value is a quoted-string containing a language tag [RFC5646] 1250 that identifies a language that is associated with the Rendition. 1251 An associated language is often used in a different role than the 1252 language specified by the LANGUAGE attribute (e.g., written versus 1253 spoken, or a fallback dialect). This attribute is OPTIONAL. 1255 The LANGUAGE and ASSOC-LANGUAGE attributes can be used, for 1256 example, to link Norwegian Renditions that use different spoken 1257 and written languages. 1259 NAME 1261 The value is a quoted-string containing a human-readable 1262 description of the Rendition. If the LANGUAGE attribute is 1263 present, then this description SHOULD be in that language. This 1264 attribute is REQUIRED. 1266 DEFAULT 1268 The value is an enumerated-string; valid strings are YES and NO. 1269 If the value is YES, then the client SHOULD play this Rendition of 1270 the content in the absence of information from the user indicating 1271 a different choice. This attribute is OPTIONAL. Its absence 1272 indicates an implicit value of NO. 1274 AUTOSELECT 1276 The value is an enumerated-string; valid strings are YES and NO. 1277 This attribute is OPTIONAL. Its absence indicates an implicit 1278 value of NO. If the value is YES, then the client MAY choose to 1279 play this Rendition in the absence of explicit user preference 1280 because it matches the current playback environment, such as 1281 chosen system language. 1283 If the AUTOSELECT attribute is present, its value MUST be YES if 1284 the value of the DEFAULT attribute is YES. 1286 FORCED 1288 The value is an enumerated-string; valid strings are YES and NO. 1289 This attribute is OPTIONAL. Its absence indicates an implicit 1290 value of NO. The FORCED attribute MUST NOT be present unless the 1291 TYPE is SUBTITLES. 1293 A value of YES indicates that the Rendition contains content that 1294 is considered essential to play. When selecting a FORCED 1295 Rendition, a client SHOULD choose the one that best matches the 1296 current playback environment (e.g., language). 1298 A value of NO indicates that the Rendition contains content that 1299 is intended to be played in response to explicit user request. 1301 INSTREAM-ID 1303 The value is a quoted-string that specifies a Rendition within the 1304 segments in the Media Playlist. This attribute is REQUIRED if the 1305 TYPE attribute is CLOSED-CAPTIONS, in which case it MUST have one 1306 of the values: "CC1", "CC2", "CC3", "CC4", or "SERVICEn" where n 1307 MUST be an integer between 1 and 63 (e.g., "SERVICE9" or 1308 "SERVICE42"). 1310 The values "CC1", "CC2", "CC3", and "CC4" identify a Line 21 Data 1311 Services channel [CEA608]. The "SERVICE" values identify a 1312 Digital Television Closed Captioning [CEA708] service block 1313 number. 1315 For all other TYPE values, the INSTREAM-ID MUST NOT be specified. 1317 CHARACTERISTICS 1318 The value is a quoted-string containing one or more Uniform Type 1319 Identifiers [UTI] separated by comma (,) characters. This 1320 attribute is OPTIONAL. Each UTI indicates an individual 1321 characteristic of the Rendition. 1323 A SUBTITLES Rendition MAY include the following characteristics: 1324 "public.accessibility.transcribes-spoken-dialog", 1325 "public.accessibility.describes-music-and-sound", and 1326 "public.easy-to-read" (which indicates that the subtitles have 1327 been edited for ease of reading). 1329 An AUDIO Rendition MAY include the following characteristic: 1330 "public.accessibility.describes-video". 1332 The CHARACTERISTICS attribute MAY include private UTIs. 1334 CHANNELS 1336 The value is a quoted-string that specifies an ordered, slash- 1337 separated ("/") list of parameters. 1339 If the TYPE attribute is AUDIO, then the first parameter is a 1340 count of audio channels expressed as a decimal-integer, indicating 1341 the maximum number of independent, simultaneous audio channels 1342 present in any Media Segment in the Rendition. For example, an 1343 AC-3 5.1 Rendition would have a CHANNELS="6" attribute. 1345 If the TYPE attribute is AUDIO, then the second parameter 1346 identifies the encoding of object-based audio used by the 1347 Rendition. This parameter is a comma-separated list of Audio 1348 Object Coding Identifiers. It is optional. An Audio Object 1349 Coding Identifier is a string containing characters from the set 1350 [A..Z], [0..9], and '-'. They are codec-specific. A parameter 1351 value of consisting solely of the dash character (0x2D) indicates 1352 that the audio is not object-based. 1354 No other CHANNELS parameters are currently defined. 1356 All audio EXT-X-MEDIA tags SHOULD have a CHANNELS attribute. If a 1357 Master Playlist contains two Renditions with the same NAME encoded 1358 with the same codec but a different number of channels, then the 1359 CHANNELS attribute is REQUIRED; otherwise, it is OPTIONAL. 1361 4.4.5.1.1. Rendition Groups 1363 A set of one or more EXT-X-MEDIA tags with the same GROUP-ID value 1364 and the same TYPE value defines a Group of Renditions. Each member 1365 of the Group MUST be an alternative Rendition of the same content; 1366 otherwise, playback errors can occur. 1368 All EXT-X-MEDIA tags in a Playlist MUST meet the following 1369 constraints: 1371 o All EXT-X-MEDIA tags in the same Group MUST have different NAME 1372 attributes. 1374 o A Group MUST NOT have more than one member with a DEFAULT 1375 attribute of YES. 1377 o Each EXT-X-MEDIA tag with an AUTOSELECT=YES attribute SHOULD have 1378 a combination of LANGUAGE [RFC5646], ASSOC-LANGUAGE, FORCED, and 1379 CHARACTERISTICS attributes that is distinct from those of other 1380 AUTOSELECT=YES members of its Group. 1382 A Playlist MAY contain multiple Groups of the same TYPE in order to 1383 provide multiple encodings of that media type. If it does so, each 1384 Group of the same TYPE MUST have the same set of members, and each 1385 corresponding member MUST have identical attributes with the 1386 exception of the URI and CHANNELS attributes. 1388 Each member in a Group of Renditions MAY have a different sample 1389 format. For example, an English Rendition can be encoded with AC-3 1390 5.1 while a Spanish Rendition is encoded with AAC stereo. However, 1391 any EXT-X-STREAM-INF tag (Section 4.4.5.2) or EXT-X-I-FRAME-STREAM- 1392 INF tag (Section 4.4.5.3) that references such a Group MUST have a 1393 CODECS attribute that lists every sample format present in any 1394 Rendition in the Group, or client playback failures can occur. In 1395 the example above, the CODECS attribute would include 1396 "ac-3,mp4a.40.2". 1398 4.4.5.2. EXT-X-STREAM-INF 1400 The EXT-X-STREAM-INF tag specifies a Variant Stream, which is a set 1401 of Renditions that can be combined to play the presentation. The 1402 attributes of the tag provide information about the Variant Stream. 1404 The URI line that follows the EXT-X-STREAM-INF tag specifies a Media 1405 Playlist that carries a Rendition of the Variant Stream. The URI 1406 line is REQUIRED. Clients that do not support multiple video 1407 Renditions SHOULD play this Rendition. 1409 Its format is: 1411 #EXT-X-STREAM-INF:<attribute-list> 1412 <URI> 1413 The following attributes are defined: 1415 BANDWIDTH 1417 The value is a decimal-integer of bits per second. It represents 1418 the peak segment bit rate of the Variant Stream. 1420 If all the Media Segments in a Variant Stream have already been 1421 created, the BANDWIDTH value MUST be the largest sum of peak 1422 segment bit rates that is produced by any playable combination of 1423 Renditions. (For a Variant Stream with a single Media Playlist, 1424 this is just the peak segment bit rate of that Media Playlist.) 1425 An inaccurate value can cause playback stalls or prevent clients 1426 from playing the variant. 1428 If the Master Playlist is to be made available before all Media 1429 Segments in the presentation have been encoded, the BANDWIDTH 1430 value SHOULD be the BANDWIDTH value of a representative period of 1431 similar content, encoded using the same settings. 1433 Every EXT-X-STREAM-INF tag MUST include the BANDWIDTH attribute. 1435 AVERAGE-BANDWIDTH 1437 The value is a decimal-integer of bits per second. It represents 1438 the average segment bit rate of the Variant Stream. 1440 If all the Media Segments in a Variant Stream have already been 1441 created, the AVERAGE-BANDWIDTH value MUST be the largest sum of 1442 average segment bit rates that is produced by any playable 1443 combination of Renditions. (For a Variant Stream with a single 1444 Media Playlist, this is just the average segment bit rate of that 1445 Media Playlist.) An inaccurate value can cause playback stalls or 1446 prevent clients from playing the variant. 1448 If the Master Playlist is to be made available before all Media 1449 Segments in the presentation have been encoded, the AVERAGE- 1450 BANDWIDTH value SHOULD be the AVERAGE-BANDWIDTH value of a 1451 representative period of similar content, encoded using the same 1452 settings. 1454 The AVERAGE-BANDWIDTH attribute is OPTIONAL. 1456 CODECS 1458 The value is a quoted-string containing a comma-separated list of 1459 formats, where each format specifies a media sample type that is 1460 present in one or more Renditions specified by the Variant Stream. 1462 Valid format identifiers are those in the ISO Base Media File 1463 Format Name Space defined by "The 'Codecs' and 'Profiles' 1464 Parameters for "Bucket" Media Types" [RFC6381]. 1466 For example, a stream containing AAC low complexity (AAC-LC) audio 1467 and H.264 Main Profile Level 3.0 video would have a CODECS value 1468 of "mp4a.40.2,avc1.4d401e". 1470 Note that if a Variant Stream specifies one or more Renditions 1471 that include IMSC subtitles, the CODECS attribute MUST indicate 1472 this with a format identifier such as "stpp.ttml.im1t". 1474 Every EXT-X-STREAM-INF tag SHOULD include a CODECS attribute. 1476 RESOLUTION 1478 The value is a decimal-resolution describing the optimal pixel 1479 resolution at which to display all the video in the Variant 1480 Stream. 1482 The RESOLUTION attribute is OPTIONAL but is recommended if the 1483 Variant Stream includes video. 1485 FRAME-RATE 1487 The value is a decimal-floating-point describing the maximum frame 1488 rate for all the video in the Variant Stream, rounded to three 1489 decimal places. 1491 The FRAME-RATE attribute is OPTIONAL but is recommended if the 1492 Variant Stream includes video. The FRAME-RATE attribute SHOULD be 1493 included if any video in a Variant Stream exceeds 30 frames per 1494 second. 1496 HDCP-LEVEL 1498 The value is an enumerated-string; valid strings are TYPE-0, TYPE- 1499 1, and NONE. This attribute is advisory. A value of TYPE-0 1500 indicates that the Variant Stream could fail to play unless the 1501 output is protected by High-bandwidth Digital Content Protection 1502 (HDCP) Type 0 [HDCP] or equivalent. A value of TYPE-1 indicates 1503 that the Variant Stream could fail to play unless the output is 1504 protected by HDCP Type 1 or equivalent. A value of NONE indicates 1505 that the content does not require output copy protection. 1507 Encrypted Variant Streams with different HDCP levels SHOULD use 1508 different media encryption keys. 1510 The HDCP-LEVEL attribute is OPTIONAL. It SHOULD be present if any 1511 content in the Variant Stream will fail to play without HDCP. 1512 Clients without output copy protection SHOULD NOT load a Variant 1513 Stream with an HDCP-LEVEL attribute unless its value is NONE. 1515 ALLOWED-CPC 1517 The ALLOWED-CPC attribute allows a server to indicate that the 1518 playback of a Variant Stream containing encrypted Media Segments 1519 is to be restricted to devices that guarantee a certain level of 1520 content protection robustness. Its value is a quoted-string 1521 containing a comma-separated list of entries. Each entry consists 1522 of a KEYFORMAT attribute value followed by a colon character (:) 1523 followed by a sequence of Content Protection Configuration (CPC) 1524 Labels separated by slash (/) characters. Each CPC Label is a 1525 string containing characters from the set [A..Z], [0..9], and '-'. 1527 For example: ALLOWED-CPC="com.example.drm1:SMART-TV/PC, 1528 com.example.drm2:HW" 1530 A CPC Label identifies a class of playback device that implements 1531 the KEYFORMAT with a certain level of content protection 1532 robustness. Each KEYFORMAT can define its own set of CPC Labels. 1533 The "identity" KEYFORMAT does not define any labels. A KEYFORMAT 1534 that defines CPC Labels SHOULD also specify its robustness 1535 requirements in a secure manner in each key response. 1537 A client MAY play the Variant Stream if it implements one of the 1538 listed KEYFORMAT schemes with content protection robustness that 1539 matches one or more of the CPC Labels in the list. If it does not 1540 match any of the CPC Labels then it SHOULD NOT attempt to play the 1541 Variant Stream. 1543 The ALLOWED-CPC attribute is OPTIONAL. If it is not present or 1544 does not contain a particular KEYFORMAT then all clients that 1545 support that KEYFORMAT MAY play the Variant Stream. 1547 VIDEO-RANGE 1549 The value is an enumerated-string; valid strings are SDR and PQ. 1551 The value MUST be SDR if all the video in the Variant Stream is 1552 encoded using a reference opto-electronic transfer characteristic 1553 function specified by the TransferCharacteristics code point 1 1554 [CICP]. 1556 The value MUST be PQ if video in the Variant Stream includes some 1557 content that is encoded using a reference opto-electronic transfer 1558 characteristic function specified by the TransferCharacteristics 1559 code point 16 or 18, and potentially other content qualifying as 1560 SDR (see above). Note that certain TransferCharacteristics code 1561 points use the same transfer function. 1563 Otherwise the attribute MUST NOT be present. 1565 AUDIO 1567 The value is a quoted-string. It MUST match the value of the 1568 GROUP-ID attribute of an EXT-X-MEDIA tag elsewhere in the Master 1569 Playlist whose TYPE attribute is AUDIO. It indicates the set of 1570 audio Renditions that SHOULD be used when playing the 1571 presentation. See Section 4.4.5.2.1. 1573 The AUDIO attribute is OPTIONAL. 1575 VIDEO 1577 The value is a quoted-string. It MUST match the value of the 1578 GROUP-ID attribute of an EXT-X-MEDIA tag elsewhere in the Master 1579 Playlist whose TYPE attribute is VIDEO. It indicates the set of 1580 video Renditions that SHOULD be used when playing the 1581 presentation. See Section 4.4.5.2.1. 1583 The VIDEO attribute is OPTIONAL. 1585 SUBTITLES 1587 The value is a quoted-string. It MUST match the value of the 1588 GROUP-ID attribute of an EXT-X-MEDIA tag elsewhere in the Master 1589 Playlist whose TYPE attribute is SUBTITLES. It indicates the set 1590 of subtitle Renditions that can be used when playing the 1591 presentation. See Section 4.4.5.2.1. 1593 The SUBTITLES attribute is OPTIONAL. 1595 CLOSED-CAPTIONS 1597 The value can be either a quoted-string or an enumerated-string 1598 with the value NONE. If the value is a quoted-string, it MUST 1599 match the value of the GROUP-ID attribute of an EXT-X-MEDIA tag 1600 elsewhere in the Playlist whose TYPE attribute is CLOSED-CAPTIONS, 1601 and it indicates the set of closed-caption Renditions that can be 1602 used when playing the presentation. See Section 4.4.5.2.1. 1604 If the value is the enumerated-string value NONE, all EXT-X- 1605 STREAM-INF tags MUST have this attribute with a value of NONE, 1606 indicating that there are no closed captions in any Variant Stream 1607 in the Master Playlist. Having closed captions in one Variant 1608 Stream but not another can trigger playback inconsistencies. 1610 The CLOSED-CAPTIONS attribute is OPTIONAL. 1612 4.4.5.2.1. Alternative Renditions 1614 When an EXT-X-STREAM-INF tag contains an AUDIO, VIDEO, SUBTITLES, or 1615 CLOSED-CAPTIONS attribute, it indicates that alternative Renditions 1616 of the content are available for playback of that Variant Stream. 1618 When defining alternative Renditions, the following constraints MUST 1619 be met to prevent client playback errors: 1621 o All playable combinations of Renditions associated with an EXT-X- 1622 STREAM-INF tag MUST have an aggregate bandwidth less than or equal 1623 to the BANDWIDTH attribute of the EXT-X-STREAM-INF tag. 1625 o If an EXT-X-STREAM-INF tag contains a RESOLUTION attribute and a 1626 VIDEO attribute, then every alternative video Rendition MUST have 1627 an optimal display resolution matching the value of the RESOLUTION 1628 attribute. 1630 o Every alternative Rendition associated with an EXT-X-STREAM-INF 1631 tag MUST meet the constraints for a Variant Stream described in 1632 Section 6.2.4. 1634 The URI attribute of the EXT-X-MEDIA tag is REQUIRED if the media 1635 type is SUBTITLES, but OPTIONAL if the media type is VIDEO or AUDIO. 1636 If the media type is VIDEO or AUDIO, a missing URI attribute 1637 indicates that the media data for this Rendition is included in the 1638 Media Playlist of any EXT-X-STREAM-INF tag referencing this EXT- 1639 X-MEDIA tag. If the media TYPE is AUDIO and the URI attribute is 1640 missing, clients MUST assume that the audio data for this Rendition 1641 is present in every video Rendition specified by the EXT-X-STREAM-INF 1642 tag. 1644 The URI attribute of the EXT-X-MEDIA tag MUST NOT be included if the 1645 media type is CLOSED-CAPTIONS. 1647 4.4.5.3. EXT-X-I-FRAME-STREAM-INF 1648 The EXT-X-I-FRAME-STREAM-INF tag identifies a Media Playlist file 1649 containing the I-frames of a multimedia presentation. It stands 1650 alone, in that it does not apply to a particular URI in the Master 1651 Playlist. Its format is: 1653 #EXT-X-I-FRAME-STREAM-INF:<attribute-list> 1655 All attributes defined for the EXT-X-STREAM-INF tag (Section 4.4.5.2) 1656 are also defined for the EXT-X-I-FRAME-STREAM-INF tag, except for the 1657 FRAME-RATE, AUDIO, SUBTITLES, and CLOSED-CAPTIONS attributes. In 1658 addition, the following attribute is defined: 1660 URI 1662 The value is a quoted-string containing a URI that identifies the 1663 I-frame Media Playlist file. That Playlist file MUST contain an 1664 EXT-X-I-FRAMES-ONLY tag. 1666 Every EXT-X-I-FRAME-STREAM-INF tag MUST include a BANDWIDTH attribute 1667 and a URI attribute. 1669 The provisions in Section 4.4.5.2.1 also apply to EXT-X-I-FRAME- 1670 STREAM-INF tags with a VIDEO attribute. 1672 A Master Playlist that specifies alternative VIDEO Renditions and 1673 I-frame Playlists SHOULD include an alternative I-frame VIDEO 1674 Rendition for each regular VIDEO Rendition, with the same NAME and 1675 LANGUAGE attributes. 1677 4.4.5.4. EXT-X-SESSION-DATA 1679 The EXT-X-SESSION-DATA tag allows arbitrary session data to be 1680 carried in a Master Playlist. 1682 Its format is: 1684 #EXT-X-SESSION-DATA:<attribute-list> 1686 The following attributes are defined: 1688 DATA-ID 1690 The value of DATA-ID is a quoted-string that identifies a 1691 particular data value. The DATA-ID SHOULD conform to a reverse 1692 DNS naming convention, such as "com.example.movie.title"; however, 1693 there is no central registration authority, so Playlist authors 1694 SHOULD take care to choose a value that is unlikely to collide 1695 with others. This attribute is REQUIRED. 1697 VALUE 1699 VALUE is a quoted-string. It contains the data identified by 1700 DATA-ID. If the LANGUAGE is specified, VALUE SHOULD contain a 1701 human-readable string written in the specified language. 1703 URI 1705 The value is a quoted-string containing a URI. The resource 1706 identified by the URI MUST be formatted as JSON [RFC8259]; 1707 otherwise, clients may fail to interpret the resource. 1709 LANGUAGE 1711 The value is a quoted-string containing a language tag [RFC5646] 1712 that identifies the language of the VALUE. This attribute is 1713 OPTIONAL. 1715 Each EXT-X-SESSION-DATA tag MUST contain either a VALUE or URI 1716 attribute, but not both. 1718 A Playlist MAY contain multiple EXT-X-SESSION-DATA tags with the same 1719 DATA-ID attribute. A Playlist MUST NOT contain more than one EXT-X- 1720 SESSION-DATA tag with the same DATA-ID attribute and the same 1721 LANGUAGE attribute. 1723 4.4.5.5. EXT-X-SESSION-KEY 1725 The EXT-X-SESSION-KEY tag allows encryption keys from Media Playlists 1726 to be specified in a Master Playlist. This allows the client to 1727 preload these keys without having to read the Media Playlist(s) 1728 first. 1730 Its format is: 1732 #EXT-X-SESSION-KEY:<attribute-list> 1734 All attributes defined for the EXT-X-KEY tag (Section 4.4.2.4) are 1735 also defined for the EXT-X-SESSION-KEY, except that the value of the 1736 METHOD attribute MUST NOT be NONE. If an EXT-X-SESSION-KEY is used, 1737 the values of the METHOD, KEYFORMAT, and KEYFORMATVERSIONS attributes 1738 MUST match any EXT-X-KEY with the same URI value. 1740 EXT-X-SESSION-KEY tags SHOULD be added if multiple Variant Streams or 1741 Renditions use the same encryption keys and formats. An EXT-X- 1742 SESSION-KEY tag is not associated with any particular Media Playlist. 1744 A Master Playlist MUST NOT contain more than one EXT-X-SESSION-KEY 1745 tag with the same METHOD, URI, IV, KEYFORMAT, and KEYFORMATVERSIONS 1746 attribute values. 1748 The EXT-X-SESSION-KEY tag is optional. 1750 4.4.6. Media or Master Playlist Tags 1752 The tags in this section can appear in either Master Playlists or 1753 Media Playlists. If one of these tags appears in a Master Playlist, 1754 it SHOULD NOT appear in any Media Playlist referenced by that Master 1755 Playlist. A tag that appears in both MUST have the same value; 1756 otherwise, clients SHOULD ignore the value in the Media Playlist(s). 1758 These tags MUST NOT appear more than once in a Playlist. If a tag 1759 appears more than once, clients MUST fail to parse the Playlist. 1761 4.4.6.1. EXT-X-INDEPENDENT-SEGMENTS 1763 The EXT-X-INDEPENDENT-SEGMENTS tag indicates that all media samples 1764 in a Media Segment can be decoded without information from other 1765 segments. It applies to every Media Segment in the Playlist. 1767 Its format is: 1769 #EXT-X-INDEPENDENT-SEGMENTS 1771 If the EXT-X-INDEPENDENT-SEGMENTS tag appears in a Master Playlist, 1772 it applies to every Media Segment in every Media Playlist in the 1773 Master Playlist. 1775 4.4.6.2. EXT-X-START 1777 The EXT-X-START tag indicates a preferred point at which to start 1778 playing a Playlist. By default, clients SHOULD start playback at 1779 this point when beginning a playback session. This tag is OPTIONAL. 1781 Its format is: 1783 #EXT-X-START:<attribute-list> 1785 The following attributes are defined: 1787 TIME-OFFSET 1789 The value of TIME-OFFSET is a signed-decimal-floating-point number 1790 of seconds. A positive number indicates a time offset from the 1791 beginning of the Playlist. A negative number indicates a negative 1792 time offset from the end of the last Media Segment in the 1793 Playlist. This attribute is REQUIRED. 1795 The absolute value of TIME-OFFSET SHOULD NOT be larger than the 1796 Playlist duration. If the absolute value of TIME-OFFSET exceeds 1797 the duration of the Playlist, it indicates either the end of the 1798 Playlist (if positive) or the beginning of the Playlist (if 1799 negative). 1801 If the Playlist does not contain the EXT-X-ENDLIST tag, the TIME- 1802 OFFSET SHOULD NOT be within three target durations of the end of 1803 the Playlist file. 1805 PRECISE 1807 The value is an enumerated-string; valid strings are YES and NO. 1808 If the value is YES, clients SHOULD start playback at the Media 1809 Segment containing the TIME-OFFSET, but SHOULD NOT render media 1810 samples in that segment whose presentation times are prior to the 1811 TIME-OFFSET. If the value is NO, clients SHOULD attempt to render 1812 every media sample in that segment. This attribute is OPTIONAL. 1813 If it is missing, its value should be treated as NO. 1815 4.4.6.3. EXT-X-DEFINE 1817 The EXT-X-DEFINE tag provides a Playlist variable definition or 1818 declaration. This tag is OPTIONAL. 1820 Its format is: 1822 #EXT-X-DEFINE:<attribute-list> 1824 The following attributes are defined: 1826 NAME 1828 The value is a quoted-string which specifies the Variable Name. 1829 All characters in the quoted-string MUST be from the following 1830 set: [a..z], [A..Z], [0..9], '-', and '_'. 1832 VALUE 1834 The value is a quoted-string which specifies the Variable Value. 1835 This attribute is REQUIRED if the EXT-X-DEFINE tag has a NAME 1836 attribute. 1838 IMPORT 1839 The value is a quoted-string which specifies the Variable Name and 1840 indicates that its value is that of the variable of the same name 1841 in the Master Playlist. EXT-X-DEFINE tags containing the IMPORT 1842 attribute MUST NOT occur in Master Playlists; they are only 1843 allowed in Media Playlists. 1845 If the IMPORT attribute value does not match any Variable Name 1846 declared in the Master Playlist, or if the Media Playlist was not 1847 loaded from a Master Playlist, the parser MUST fail to parse the 1848 Playlist. 1850 An EXT-X-DEFINE tag MUST contain either a NAME or an IMPORT 1851 attribute, but not both. 1853 An EXT-X-DEFINE tag MUST NOT specify the same Variable Name as any 1854 other EXT-X-DEFINE tag in the same Playlist. Parsers that encounter 1855 duplicate Variable Name declarations MUST fail to parse the Playlist. 1857 EXT-X-DEFINE tags do NOT implicitly persist across Playlist reloads. 1859 5. Key Files 1861 5.1. Structure of Key Files 1863 An EXT-X-KEY tag with a URI attribute identifies a Key file. A Key 1864 file contains a cipher key that can decrypt Media Segments in the 1865 Playlist. 1867 [AES_128] encryption uses 16-octet keys. If the KEYFORMAT of an EXT- 1868 X-KEY tag is "identity", the Key file is a single packed array of 16 1869 octets in binary format. 1871 5.2. IV for AES-128 1873 [AES_128] REQUIRES the same 16-octet IV to be supplied when 1874 encrypting and decrypting. Varying this IV increases the strength of 1875 the cipher. 1877 An IV attribute on an EXT-X-KEY tag with a KEYFORMAT of "identity" 1878 specifies an IV that can be used when decrypting Media Segments 1879 encrypted with that Key file. IV values for AES-128 are 128-bit 1880 numbers. 1882 An EXT-X-KEY tag with a KEYFORMAT of "identity" that does not have an 1883 IV attribute indicates that the Media Sequence Number is to be used 1884 as the IV when decrypting a Media Segment, by putting its big-endian 1885 binary representation into a 16-octet (128-bit) buffer and padding 1886 (on the left) with zeros. 1888 6. Client/Server Responsibilities 1890 6.1. Introduction 1892 This section describes how the server generates the Playlist and 1893 Media Segments and how the client should download them for playback. 1895 6.2. Server Responsibilities 1897 6.2.1. General Server Responsibilities 1899 The production of the source media is outside the scope of this 1900 document, which simply presumes a source of continuous encoded media 1901 containing the presentation. 1903 The server MUST divide the source media into individual Media 1904 Segments whose duration is less than or equal to a constant target 1905 duration. Segments that are longer than the planned target duration 1906 can trigger playback stalls and other errors. 1908 The server SHOULD attempt to divide the source media at points that 1909 support effective decode of individual Media Segments, e.g., on 1910 packet and key frame boundaries. 1912 The server MUST create a URI for every Media Segment that enables its 1913 clients to obtain the segment data. If a server supports partial 1914 loading of resources (e.g., via HTTP Range requests), it MAY specify 1915 segments as sub-ranges of larger resources using the EXT-X-BYTERANGE 1916 tag. 1918 The absence of media data (due to, for example, the temporary 1919 unavailability of an encoder) SHOULD be signaled by adding one or 1920 more Media Segments to the Playlist whose Segment durations add up to 1921 the duration of absent media; these Media Segments MUST have EXT- 1922 X-GAP tags applied to them. Attempting to download these segments 1923 MAY produce an error, such as HTTP 404 or 410. 1925 Any Media Segment that is specified in a Playlist loaded by a client 1926 MUST be available for immediate download unless it has been marked 1927 with an EXT-X-GAP tag; otherwise playback errors can occur. Once 1928 download starts, its transfer rate SHOULD NOT be constrained by the 1929 segment production process. 1931 HTTP servers SHOULD transfer text files -- such as Playlists and 1932 WebVTT segments -- using the "gzip" Content-Encoding if the client 1933 indicates that it is prepared to accept it. 1935 The server must create a Media Playlist file (Section 4) that 1936 contains a URI for each Media Segment that the server wishes to make 1937 available, in the order in which they are to be played. 1939 The value of the EXT-X-VERSION tag (Section 4.4.1.2) SHOULD NOT be 1940 greater than what is required for the tags and attributes in the 1941 Playlist (see Section 7). 1943 Changes to the Playlist file MUST be made atomically from the point 1944 of view of the clients, or playback errors MAY occur. 1946 The server MUST NOT change the Media Playlist file, except to: 1948 Append lines to it (Section 6.2.1). 1950 Remove Media Segment URIs from the Playlist in the order that they 1951 appear, along with any tags that apply only to those segments 1952 (Section 6.2.2). 1954 Remove Media Metadata tags that no longer apply to the 1955 presentation (Section 6.2.1). 1957 Increment the value of the EXT-X-MEDIA-SEQUENCE or EXT-X- 1958 DISCONTINUITY-SEQUENCE tags (Section 6.2.2). 1960 Add an EXT-X-ENDLIST tag to the Playlist (Section 6.2.1). 1962 A Media Playlist has further constraints on its updates if it 1963 contains an EXT-X-PLAYLIST-TYPE tag. An EXT-X-PLAYLIST-TYPE tag with 1964 a value of VOD indicates that the Playlist file MUST NOT change. An 1965 EXT-X-PLAYLIST-TYPE tag with a value of EVENT indicates that the 1966 server MUST NOT change or delete any part of the Playlist file; it 1967 MAY append lines to it. 1969 The value of the EXT-X-TARGETDURATION tag in the Media Playlist MUST 1970 NOT change. A typical target duration is 10 seconds. 1972 Playlist changes other than those allowed here can trigger playback 1973 errors and inconsistent client behavior. 1975 Each Media Segment in a Media Playlist has an integer Discontinuity 1976 Sequence Number. The Discontinuity Sequence Number can be used in 1977 addition to the timestamps within the media to synchronize Media 1978 Segments across different Renditions. 1980 A segment's Discontinuity Sequence Number is the value of the EXT-X- 1981 DISCONTINUITY-SEQUENCE tag (or zero if none) plus the number of EXT- 1982 X-DISCONTINUITY tags in the Playlist preceding the URI line of the 1983 segment. 1985 The server MAY associate an absolute date and time with a Media 1986 Segment by applying an EXT-X-PROGRAM-DATE-TIME tag to it. This 1987 defines an informative mapping of the (wall-clock) date and time 1988 specified by the tag to the first media timestamp in the segment, 1989 which may be used as a basis for seeking, for display, or for other 1990 purposes. If a server provides this mapping, it SHOULD apply an EXT- 1991 X-PROGRAM-DATE-TIME tag to every segment that has an EXT- 1992 X-DISCONTINUITY tag applied to it. 1994 The Server MUST NOT add any EXT-X-PROGRAM-DATE-TIME tag to a Playlist 1995 that would cause the mapping between program date and Media Segment 1996 to become ambiguous. 1998 The server MUST NOT remove an EXT-X-DATERANGE tag from a Playlist if 1999 any date in the range maps to a Media Segment in the Playlist. 2001 The server MUST NOT reuse the ID attribute value of an EXT- 2002 X-DATERANGE tag for any new Date Range in the same Playlist. 2004 Once the Following Range of a Date Range with an END-ON-NEXT=YES 2005 attribute is added to a Playlist, the Server MUST NOT subsequently 2006 add a Date Range with the same CLASS attribute whose START-DATE is 2007 between that of the END-ON-NEXT=YES range and its Following Range. 2009 For Date Ranges with a PLANNED-DURATION attribute, the Server SHOULD 2010 signal the actual end of the range once it has been established. It 2011 can do so by adding another EXT-X-DATERANGE tag with the same ID 2012 attribute value and either a DURATION or an END-DATE attribute or, if 2013 the Date Range has an END-ON-NEXT=YES attribute, by adding a 2014 Following Range. 2016 If the Media Playlist contains the final Media Segment of the 2017 presentation, then the Playlist file MUST contain the EXT-X-ENDLIST 2018 tag; this allows clients to minimize unproductive Playlist reloads. 2020 If a Media Playlist does not contain the EXT-X-ENDLIST tag, the 2021 server MUST make a new version of the Playlist file available that 2022 contains at least one new Media Segment. It MUST be made available 2023 no later than 1.5 times the target duration after the previous time 2024 the Playlist was updated with a Media Segment. This allows clients 2025 to utilize the network efficiently. 2027 If the server wishes to remove an entire presentation, it SHOULD 2028 provide a clear indication to clients that the Playlist file is no 2029 longer available (e.g., with an HTTP 404 or 410 response). It MUST 2030 ensure that all Media Segments in the Playlist file remain available 2031 to clients for at least the duration of the Playlist file at the time 2032 of removal to prevent interruption of in-progress playback. 2034 6.2.2. Live Playlists 2036 The server MAY limit the availability of Media Segments by removing 2037 Media Segments from the Playlist file (Section 6.2.1). If Media 2038 Segments are to be removed, the Playlist file MUST contain an EXT-X- 2039 MEDIA-SEQUENCE tag. Its value MUST be incremented by 1 for every 2040 Media Segment that is removed from the Playlist file; it MUST NOT 2041 decrease or wrap. Clients can malfunction if each Media Segment does 2042 not have a consistent, unique Media Sequence Number. 2044 Media Segments MUST be removed from the Playlist file in the order 2045 that they appear in the Playlist; otherwise, client playback can 2046 malfunction. 2048 The server MUST NOT remove a Media Segment from a Playlist file 2049 without an EXT-X-ENDLIST tag if that would produce a Playlist whose 2050 duration is less than three times the target duration. Doing so can 2051 trigger playback stalls. 2053 The Availability Duration of a Media Segment is the duration of the 2054 segment plus the duration of the longest-duration Playlist 2055 distributed by the server containing that segment. If the server 2056 removes a Media Segment URI from a Playlist that contains an EXT- 2057 X-ENDLIST tag, clients MUST be able to download the corresponding 2058 Media Segment until the time of removal plus the segment's 2059 Availability Duration. If the server removes a Media Segment URI 2060 from a Playlist that does not contain an EXT-X-ENDLIST tag, clients 2061 MUST be able to download the segment until the time at which it first 2062 appeared in the Playlist plus the segment's Availability Duration. 2064 If the server wishes to remove segments from a Media Playlist 2065 containing an EXT-X-DISCONTINUITY tag, the Media Playlist MUST 2066 contain an EXT-X-DISCONTINUITY-SEQUENCE tag. Without the EXT-X- 2067 DISCONTINUITY-SEQUENCE tag, it can be impossible for a client to 2068 locate corresponding segments between Renditions. 2070 If the server removes an EXT-X-DISCONTINUITY tag from the Media 2071 Playlist, it MUST increment the value of the EXT-X-DISCONTINUITY- 2072 SEQUENCE tag so that the Discontinuity Sequence Numbers of the 2073 segments still in the Media Playlist remain unchanged. The value of 2074 the EXT-X-DISCONTINUITY-SEQUENCE tag MUST NOT decrease or wrap. 2075 Clients can malfunction if each Media Segment does not have a 2076 consistent Discontinuity Sequence Number. 2078 If a server plans to remove a Media Segment after it is delivered to 2079 clients over HTTP, it SHOULD ensure that the HTTP response contains 2080 an Expires header that reflects the planned time-to-live. 2082 A Live Playlist MUST NOT contain the EXT-X-PLAYLIST-TYPE tag, as no 2083 value of that tag allows Media Segments to be removed. 2085 6.2.3. Encrypting Media Segments 2087 Media Segments MAY be encrypted. Every encrypted Media Segment MUST 2088 have an EXT-X-KEY tag (Section 4.4.2.4) applied to it with a URI that 2089 the client can use to obtain a Key file (Section 5) containing the 2090 decryption key. 2092 A Media Segment can only be encrypted with one encryption METHOD, 2093 using one encryption key and IV. However, a server MAY offer 2094 multiple ways to retrieve that key by providing multiple EXT-X-KEY 2095 tags, each with a different KEYFORMAT attribute value. 2097 The server MAY set the HTTP Expires header in the key response to 2098 indicate the duration for which the key can be cached. 2100 Any unencrypted Media Segment in a Playlist that is preceded by an 2101 encrypted Media Segment MUST have an EXT-X-KEY tag applied to it with 2102 a METHOD attribute of NONE. Otherwise, the client will misinterpret 2103 those segments as encrypted. 2105 If the encryption METHOD is AES-128 and the Playlist does not contain 2106 the EXT-X-I-FRAMES-ONLY tag, AES encryption as described in 2107 Section 4.4.2.4 SHALL be applied to individual Media Segments. 2109 If the encryption METHOD is AES-128 and the Playlist contains an EXT- 2110 X-I-FRAMES-ONLY tag, the entire resource MUST be encrypted using 2111 AES-128 CBC with PKCS7 padding [RFC5652]. Encryption MAY be 2112 restarted on 16-byte block boundaries, unless the first block 2113 contains an I-frame. The IV used for encryption MUST be either the 2114 Media Sequence Number of the Media Segment or the value of the IV 2115 attribute of the EXT-X-KEY tag, as described in Section 5.2. These 2116 constraints allow a client to load and decrypt individual I-frames 2117 specified as sub-ranges of regular encrypted Media Segments, and 2118 their Media Initialization Sections. 2120 If the encryption METHOD indicates Sample Encryption, media samples 2121 MAY be encrypted prior to encapsulation in a Media Segment. 2123 The server MUST NOT remove an EXT-X-KEY tag from the Playlist file if 2124 it applies to any Media Segment in the Playlist file, or clients who 2125 subsequently load that Playlist will be unable to decrypt those Media 2126 Segments. 2128 6.2.4. Providing Variant Streams 2130 A server MAY offer multiple Media Playlist files to provide different 2131 encodings of the same presentation. If it does so, it SHOULD provide 2132 a Master Playlist file that lists each Variant Stream to allow 2133 clients to switch between encodings dynamically. 2135 Master Playlists describe regular Variant Streams with EXT-X-STREAM- 2136 INF tags and I-frame Variant Streams with EXT-X-I-FRAME-STREAM-INF 2137 tags. 2139 If an EXT-X-STREAM-INF tag or EXT-X-I-FRAME-STREAM-INF tag contains 2140 the CODECS attribute, the attribute value MUST include every media 2141 format [RFC6381] present in any Media Segment in any of the 2142 Renditions specified by the Variant Stream. 2144 The server MUST meet the following constraints when producing Variant 2145 Streams in order to allow clients to switch between them seamlessly: 2147 Each Variant Stream MUST present the same content. 2149 Matching content in Variant Streams MUST have matching timestamps. 2150 This allows clients to synchronize the media. 2152 Matching content in Variant Streams MUST have matching 2153 Discontinuity Sequence Numbers (see Section 4.4.4.3). 2155 Each Media Playlist in each Variant Stream MUST have the same 2156 target duration. The only exceptions are SUBTITLES Renditions and 2157 Media Playlists containing an EXT-X-I-FRAMES-ONLY tag, which MAY 2158 have different target durations if they have an EXT-X-PLAYLIST- 2159 TYPE of VOD. 2161 Content that appears in a Media Playlist of one Variant Stream but 2162 not in another MUST appear either at the beginning or at the end 2163 of the Media Playlist file and MUST NOT be longer than the target 2164 duration. 2166 If any Media Playlists have an EXT-X-PLAYLIST-TYPE tag, all Media 2167 Playlists MUST have an EXT-X-PLAYLIST-TYPE tag with the same 2168 value. 2170 If the Playlist contains an EXT-X-PLAYLIST-TYPE tag with the value 2171 of VOD, the first segment of every Media Playlist in every Variant 2172 Stream MUST start at the same media timestamp. 2174 If any Media Playlist in a Master Playlist contains an EXT-X- 2175 PROGRAM-DATE-TIME tag, then all Media Playlists in that Master 2176 Playlist MUST contain EXT-X-PROGRAM-DATE-TIME tags with consistent 2177 mappings of date and time to media timestamps. 2179 Each Variant Stream MUST contain the same set of Date Ranges. The 2180 EXT-X-DATERANGE tags of corresponding Date Ranges MUST have the 2181 same ID attribute value and contain the same set of attribute/ 2182 value pairs. 2184 In addition, for broadest compatibility, Variant Streams SHOULD 2185 contain the same encoded audio bitstream. This allows clients to 2186 switch between Variant Streams without audible glitching. 2188 The rules for Variant Streams also apply to alternative Renditions 2189 (see Section 4.4.5.2.1). 2191 6.3. Client Responsibilities 2193 6.3.1. General Client Responsibilities 2195 How the client obtains the URI to the Playlist file is outside the 2196 scope of this document; it is presumed to have done so. 2198 The client obtains the Playlist file from the URI. If the Playlist 2199 file so obtained is a Master Playlist, the client can select a 2200 Variant Stream to load from the Master Playlist. 2202 Clients MUST ensure that loaded Playlists comply with Section 4 and 2203 that the EXT-X-VERSION tag, if present, specifies a protocol version 2204 supported by the client; if either check fails, the client MUST NOT 2205 attempt to use the Playlist, or unintended behavior could occur. 2207 When parsing Playlist elements that are subject to variable 2208 substitution, a Variable Reference whose Variable Name has been 2209 provided by an EXT-X-DEFINE tag that precedes the Variable Reference 2210 MUST be replaced by the corresponding Variable Value. Such 2211 replacements themselves are NOT subject to variable substitution. 2213 When parsing Playlist elements that are subject to variable 2214 substitution, a Variable Reference whose Variable Name has NOT been 2215 provided by an EXT-X-DEFINE tag preceding the Variable Reference MUST 2216 trigger a parsing error. 2218 If any URI element in a Playlist contains an URI scheme that the 2219 client cannot handle, the client MUST stop playback. All clients 2220 MUST support HTTP schemes. 2222 To support forward compatibility, when parsing Playlists, clients 2223 MUST: 2225 o ignore any unrecognized tags. 2227 o ignore any attribute/value pair with an unrecognized 2228 AttributeName. 2230 o ignore any tag containing an attribute/value pair of type 2231 enumerated-string whose AttributeName is recognized but whose 2232 AttributeValue is not recognized, unless the definition of the 2233 attribute says otherwise. 2235 When identifying playable Renditions, Clients SHOULD consider an 2236 audio Rendition having unrecognized CHANNELS parameters to be 2237 playable if its associated CODECS attribute is supported. However, 2238 an equivalent Rendition with the same audio codec and recognized 2239 CHANNELS parameters SHOULD be preferred if it is present in the 2240 Master Playlist. 2242 Algorithms used by the client to switch between Variant Streams are 2243 beyond the scope of this document. 2245 6.3.2. Loading the Media Playlist File 2247 Every time a Media Playlist is loaded or reloaded from a Playlist 2248 URI, the client MUST determine the next Media Segment to load, as 2249 described in Section 6.3.5, if it intends to play the presentation 2250 normally (i.e., in Playlist order at the nominal playback rate). 2252 If the Media Playlist contains the EXT-X-MEDIA-SEQUENCE tag, the 2253 client SHOULD assume that each Media Segment in it will become 2254 unavailable at the time that the Playlist file was loaded plus the 2255 duration of the Playlist file. 2257 A client MAY use the segment Media Sequence Number to track the 2258 location of a Media Segment within a Playlist when the Playlist is 2259 reloaded. 2261 A client MUST NOT assume that segments with the same Media Sequence 2262 Number in different Variant Streams or Renditions have the same 2263 position in the presentation; Playlists MAY have independent Media 2264 Sequence Numbers. Instead, a client MUST use the relative position 2265 of each segment on the Playlist timeline and its Discontinuity 2266 Sequence Number to locate corresponding segments. 2268 A client MUST load the Media Playlist file of every Rendition 2269 selected for playback in order to locate the media specific to that 2270 Rendition. But, to prevent unnecessary load on the server, it SHOULD 2271 NOT load the Playlist file of any other Rendition. 2273 For some Variant Streams, it is possible to select Renditions that do 2274 not include the Rendition specified by the EXT-X-STREAM-INF tag. As 2275 noted above, the client SHOULD NOT load that Rendition in those 2276 cases. 2278 6.3.3. Playing the Media Playlist File 2280 The client SHALL choose which Media Segment to play first from the 2281 Media Playlist when playback starts. If the EXT-X-ENDLIST tag is not 2282 present and the client intends to play the media normally, the client 2283 SHOULD NOT choose a segment that starts less than the duration of the 2284 last segment in the Playlist plus two target durations from the end 2285 of the Playlist file. Doing so can trigger playback stalls. 2287 Normal playback can be achieved by playing the Media Segments in the 2288 order that they appear in the Playlist. The client MAY present the 2289 available media in any way it wishes, including normal playback, 2290 random access, and trick modes. 2292 The client SHOULD NOT attempt to load Media Segments that have been 2293 marked with an EXT-X-GAP tag. Instead, clients are encouraged to 2294 look for another Variant Stream of the same Rendition which does not 2295 have the same gap, and play that instead. 2297 The encoding parameters for samples in a Media Segment and across 2298 multiple Media Segments in a Media Playlist SHOULD remain consistent. 2299 However, clients SHOULD deal with encoding changes as they are 2300 encountered, for example, by scaling video content to accommodate a 2301 resolution change. If the Variant Stream includes a RESOLUTION 2302 attribute, clients SHOULD display all video within a rectangle with 2303 the same proportions as that resolution. 2305 Clients SHOULD be prepared to handle multiple tracks of a particular 2306 type (e.g., audio or video). A client with no other preference 2307 SHOULD choose the track with the lowest numerical track identifier 2308 that it can play. 2310 Clients SHOULD ignore private streams inside Transport Streams that 2311 they do not recognize. Private streams can be used to support 2312 different devices with the same stream, although stream authors 2313 SHOULD be sensitive to the additional network load that this imposes. 2315 The client MUST be prepared to reset its parser(s) and decoder(s) 2316 before playing a Media Segment that has an EXT-X-DISCONTINUITY tag 2317 applied to it; otherwise, playback errors can occur. 2319 The client SHOULD attempt to load Media Segments in advance of when 2320 they will be required for uninterrupted playback to compensate for 2321 temporary variations in latency and throughput. 2323 The client MAY use the value of the EXT-X-PROGRAM-DATE-TIME tag to 2324 display the program origination time to the user. If the value 2325 includes time zone information, the client SHALL take it into 2326 account; if it does not, the client MAY assume the time to be local. 2328 Note that dates in Playlists can refer to when the content was 2329 produced (or to other times), which have no relation to the time of 2330 playback. 2332 If the first EXT-X-PROGRAM-DATE-TIME tag in a Playlist appears after 2333 one or more Media Segment URIs, the client SHOULD extrapolate 2334 backward from that tag (using EXTINF durations and/or media 2335 timestamps) to associate dates with those segments. To associate a 2336 date with any other Media Segment that does not have an EXT-X- 2337 PROGRAM-DATE-TIME tag applied to it directly, the client SHOULD 2338 extrapolate forward from the last EXT-X-PROGRAM-DATE-TIME tag 2339 appearing before that segment in the Playlist. 2341 6.3.4. Reloading the Media Playlist File 2343 The client MUST periodically reload a Media Playlist file to learn 2344 what media is currently available, unless it contains an EXT-X- 2345 PLAYLIST-TYPE tag with a value of VOD, or a value of EVENT and the 2346 EXT-X-ENDLIST tag is also present. 2348 However, the client MUST NOT attempt to reload the Playlist file more 2349 frequently than specified by this section, in order to limit the 2350 collective load on the server. 2352 When a client loads a Playlist file for the first time or reloads a 2353 Playlist file and finds that it has changed since the last time it 2354 was loaded, the client MUST wait for at least the duration of the 2355 last segment in the Playlist before attempting to reload the Playlist 2356 file again, measured from the last time the client began loading the 2357 Playlist file. 2359 If the client reloads a Playlist file and finds that it has not 2360 changed, then it MUST wait for a period of one-half the target 2361 duration before retrying. 2363 After reloading a Media Playlist, the client SHOULD verify that each 2364 Media Segment in it has the same URI (and byte range, if specified) 2365 as the Media Segment with the same Media Sequence Number in the 2366 previous Media Playlist. It SHOULD halt playback if it does not, as 2367 this normally indicates a server error. 2369 In order to reduce server load, the client SHOULD NOT reload the 2370 Playlist files of Variant Streams or alternate Renditions that are 2371 not currently being played. If it decides to switch playback to a 2372 different Variant Stream, it SHOULD stop reloading the Playlist of 2373 the old Variant Stream and begin loading the Playlist of the new 2374 Variant Stream. It can use the EXTINF durations and the constraints 2375 in Section 6.2.4 to determine the approximate location of 2376 corresponding media. Once media from the new Variant Stream has been 2377 loaded, the timestamps in the Media Segments can be used to 2378 synchronize the old and new timelines precisely. 2380 A client MUST NOT attempt to use the Media Sequence Number to 2381 synchronize between streams (see Section 6.3.2). 2383 6.3.5. Determining the Next Segment to Load 2385 The client MUST examine the Media Playlist file every time it is 2386 loaded or reloaded to determine the next Media Segment to load, as 2387 the set of available media MAY have changed. 2389 The first segment to load is generally the segment that the client 2390 has chosen to play first (see Section 6.3.3). 2392 In order to play the presentation normally, the next Media Segment to 2393 load is the one with the lowest Media Sequence Number that is greater 2394 than the Media Sequence Number of the last Media Segment loaded. 2396 6.3.6. Decrypting Encrypted Media Segments 2398 If a Media Playlist file contains an EXT-X-KEY tag that specifies a 2399 Key file URI, the client can obtain that Key file and use the key 2400 inside it to decrypt all Media Segments to which that EXT-X-KEY tag 2401 applies. 2403 A client MUST ignore any EXT-X-KEY tag with an unsupported or 2404 unrecognized KEYFORMAT attribute, to allow for cross-device 2405 addressability. If the Playlist contains a Media Segment to which 2406 only EXT-X-KEY tags with unrecognized or unsupported KEYFORMAT 2407 attributes are applied, playback SHOULD fail. 2409 A client MUST NOT attempt to decrypt any segments whose EXT-X-KEY tag 2410 has a METHOD attribute that it does not recognize. 2412 If the encryption METHOD is AES-128, AES-128 CBC decryption SHALL be 2413 applied to individual Media Segments, whose encryption format is 2414 described in Section 4.4.2.4. 2416 If the encryption METHOD is AES-128 and the Media Segment is part of 2417 an I-frame Playlist (Section 4.4.4.6) and it has an EXT-X-BYTERANGE 2418 tag applied to it, special care needs to be taken in loading and 2419 decrypting the segment, because the resource identified by the URI is 2420 encrypted in 16-byte blocks from the start of the resource. 2422 The decrypted I-frame can be recovered by first widening its byte 2423 range, as specified by the EXT-X-BYTERANGE tag, so that it starts and 2424 ends on 16-byte boundaries from the start of the resource. 2426 Next, the byte range is widened further to include a 16-byte block at 2427 the beginning of the range. This 16-byte block allows the correct IV 2428 for the following block to be calculated. 2430 The widened byte range can then be loaded and decrypted with AES-128 2431 CBC using an arbitrary IV. The number of bytes added to the 2432 beginning and the end of the original byte range are discarded from 2433 the decrypted bytes; what remains is the decrypted I-frame. 2435 If the encryption METHOD indicates Sample Encryption, decryption 2436 SHALL be applied to encrypted media samples within the Media Segment. 2438 An EXT-X-KEY tag with a METHOD of NONE indicates that the Media 2439 Segments it applies to are not encrypted. 2441 7. Protocol Version Compatibility 2443 Protocol compatibility is specified by the EXT-X-VERSION tag. A 2444 Playlist that contains tags or attributes that are not compatible 2445 with protocol version 1 MUST include an EXT-X-VERSION tag. 2447 A client MUST NOT attempt playback if it does not support the 2448 protocol version specified by the EXT-X-VERSION tag, or unintended 2449 behavior could occur. 2451 A Media Playlist MUST indicate an EXT-X-VERSION of 2 or higher if it 2452 contains: 2454 o The IV attribute of the EXT-X-KEY tag. 2456 A Media Playlist MUST indicate an EXT-X-VERSION of 3 or higher if it 2457 contains: 2459 o Floating-point EXTINF duration values. 2461 A Media Playlist MUST indicate an EXT-X-VERSION of 4 or higher if it 2462 contains: 2464 o The EXT-X-BYTERANGE tag. 2466 o The EXT-X-I-FRAMES-ONLY tag. 2468 A Media Playlist MUST indicate an EXT-X-VERSION of 5 or higher if it 2469 contains: 2471 o An EXT-X-KEY tag with a METHOD of SAMPLE-AES. 2473 o The KEYFORMAT and KEYFORMATVERSIONS attributes of the EXT-X-KEY 2474 tag. 2476 o The EXT-X-MAP tag. 2478 A Media Playlist MUST indicate an EXT-X-VERSION of 6 or higher if it 2479 contains: 2481 o The EXT-X-MAP tag in a Media Playlist that does not contain EXT- 2482 X-I-FRAMES-ONLY. 2484 Note that in protocol version 6, the semantics of the EXT- 2485 X-TARGETDURATION tag changed slightly. In protocol version 5 and 2486 earlier it indicated the maximum segment duration; in protocol 2487 version 6 and later it indicates the the maximum segment duration 2488 rounded to the nearest integer number of seconds. 2490 A Master Playlist MUST indicate an EXT-X-VERSION of 7 or higher if it 2491 contains: 2493 o "SERVICE" values for the INSTREAM-ID attribute of the EXT-X-MEDIA 2494 tag. 2496 A Playlist MUST indicate an EXT-X-VERSION of 8 or higher if it 2497 contains: 2499 o Variable substitution. 2501 The EXT-X-MEDIA tag and the AUDIO, VIDEO, and SUBTITLES attributes of 2502 the EXT-X-STREAM-INF tag are backward compatible to protocol version 2503 1, but playback on older clients may not be desirable. A server MAY 2504 consider indicating an EXT-X-VERSION of 4 or higher in the Master 2505 Playlist but is not required to do so. 2507 The PROGRAM-ID attribute of the EXT-X-STREAM-INF and the EXT-X-I- 2508 FRAME-STREAM-INF tags was removed in protocol version 6. 2510 The EXT-X-ALLOW-CACHE tag was removed in protocol version 7. 2512 8. Playlist Examples 2514 8.1. Simple Media Playlist 2516 #EXTM3U 2517 #EXT-X-TARGETDURATION:10 2518 #EXT-X-VERSION:3 2519 #EXTINF:9.009, 2520 http://media.example.com/first.ts 2521 #EXTINF:9.009, 2522 http://media.example.com/second.ts 2523 #EXTINF:3.003, 2524 http://media.example.com/third.ts 2525 #EXT-X-ENDLIST 2527 8.2. Live Media Playlist Using HTTPS 2529 #EXTM3U 2530 #EXT-X-VERSION:3 2531 #EXT-X-TARGETDURATION:8 2532 #EXT-X-MEDIA-SEQUENCE:2680 2534 #EXTINF:7.975, 2535 https://priv.example.com/fileSequence2680.ts 2536 #EXTINF:7.941, 2537 https://priv.example.com/fileSequence2681.ts 2538 #EXTINF:7.975, 2539 https://priv.example.com/fileSequence2682.ts 2541 8.3. Playlist with Encrypted Media Segments 2542 #EXTM3U 2543 #EXT-X-VERSION:3 2544 #EXT-X-MEDIA-SEQUENCE:7794 2545 #EXT-X-TARGETDURATION:15 2547 #EXT-X-KEY:METHOD=AES-128,URI="https://priv.example.com/key.php?r=52" 2549 #EXTINF:2.833, 2550 http://media.example.com/fileSequence52-A.ts 2551 #EXTINF:15.0, 2552 http://media.example.com/fileSequence52-B.ts 2553 #EXTINF:13.333, 2554 http://media.example.com/fileSequence52-C.ts 2556 #EXT-X-KEY:METHOD=AES-128,URI="https://priv.example.com/key.php?r=53" 2558 #EXTINF:15.0, 2559 http://media.example.com/fileSequence53-A.ts 2561 8.4. Master Playlist 2563 #EXTM3U 2564 #EXT-X-STREAM-INF:BANDWIDTH=1280000,AVERAGE-BANDWIDTH=1000000 2565 http://example.com/low.m3u8 2566 #EXT-X-STREAM-INF:BANDWIDTH=2560000,AVERAGE-BANDWIDTH=2000000 2567 http://example.com/mid.m3u8 2568 #EXT-X-STREAM-INF:BANDWIDTH=7680000,AVERAGE-BANDWIDTH=6000000 2569 http://example.com/hi.m3u8 2570 #EXT-X-STREAM-INF:BANDWIDTH=65000,CODECS="mp4a.40.5" 2571 http://example.com/audio-only.m3u8 2573 8.5. Master Playlist with I-Frames 2575 #EXTM3U 2576 #EXT-X-STREAM-INF:BANDWIDTH=1280000 2577 low/audio-video.m3u8 2578 #EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=86000,URI="low/iframe.m3u8" 2579 #EXT-X-STREAM-INF:BANDWIDTH=2560000 2580 mid/audio-video.m3u8 2581 #EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=150000,URI="mid/iframe.m3u8" 2582 #EXT-X-STREAM-INF:BANDWIDTH=7680000 2583 hi/audio-video.m3u8 2584 #EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=550000,URI="hi/iframe.m3u8" 2585 #EXT-X-STREAM-INF:BANDWIDTH=65000,CODECS="mp4a.40.5" 2586 audio-only.m3u8 2588 8.6. Master Playlist with Alternative Audio 2590 In this example, the CODECS attributes have been condensed for space. 2591 A '\' is used to indicate that the tag continues on the following 2592 line with whitespace removed: 2594 #EXTM3U 2595 #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="aac",NAME="English", \ 2596 DEFAULT=YES,AUTOSELECT=YES,LANGUAGE="en", \ 2597 URI="main/english-audio.m3u8" 2598 #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="aac",NAME="Deutsch", \ 2599 DEFAULT=NO,AUTOSELECT=YES,LANGUAGE="de", \ 2600 URI="main/german-audio.m3u8" 2601 #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="aac",NAME="Commentary", \ 2602 DEFAULT=NO,AUTOSELECT=NO,LANGUAGE="en", \ 2603 URI="commentary/audio-only.m3u8" 2604 #EXT-X-STREAM-INF:BANDWIDTH=1280000,CODECS="...",AUDIO="aac" 2605 low/video-only.m3u8 2606 #EXT-X-STREAM-INF:BANDWIDTH=2560000,CODECS="...",AUDIO="aac" 2607 mid/video-only.m3u8 2608 #EXT-X-STREAM-INF:BANDWIDTH=7680000,CODECS="...",AUDIO="aac" 2609 hi/video-only.m3u8 2610 #EXT-X-STREAM-INF:BANDWIDTH=65000,CODECS="mp4a.40.5",AUDIO="aac" 2611 main/english-audio.m3u8 2613 8.7. Master Playlist with Alternative Video 2615 This example shows three different video Renditions (Main, 2616 Centerfield, and Dugout) and three different Variant Streams (low, 2617 mid, and high). In this example, clients that did not support the 2618 EXT-X-MEDIA tag and the VIDEO attribute of the EXT-X-STREAM-INF tag 2619 would only be able to play the video Rendition "Main". 2621 Since the EXT-X-STREAM-INF tag has no AUDIO attribute, all video 2622 Renditions would be required to contain the audio. 2624 In this example, the CODECS attributes have been condensed for space. 2625 A '\' is used to indicate that the tag continues on the following 2626 line with whitespace removed: 2628 #EXTM3U 2629 #EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="low",NAME="Main", \ 2630 DEFAULT=YES,URI="low/main/audio-video.m3u8" 2631 #EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="low",NAME="Centerfield", \ 2632 DEFAULT=NO,URI="low/centerfield/audio-video.m3u8" 2633 #EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="low",NAME="Dugout", \ 2634 DEFAULT=NO,URI="low/dugout/audio-video.m3u8" 2636 #EXT-X-STREAM-INF:BANDWIDTH=1280000,CODECS="...",VIDEO="low" 2637 low/main/audio-video.m3u8 2639 #EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="mid",NAME="Main", \ 2640 DEFAULT=YES,URI="mid/main/audio-video.m3u8" 2641 #EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="mid",NAME="Centerfield", \ 2642 DEFAULT=NO,URI="mid/centerfield/audio-video.m3u8" 2643 #EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="mid",NAME="Dugout", \ 2644 DEFAULT=NO,URI="mid/dugout/audio-video.m3u8" 2646 #EXT-X-STREAM-INF:BANDWIDTH=2560000,CODECS="...",VIDEO="mid" 2647 mid/main/audio-video.m3u8 2649 #EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="hi",NAME="Main", \ 2650 DEFAULT=YES,URI="hi/main/audio-video.m3u8" 2651 #EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="hi",NAME="Centerfield", \ 2652 DEFAULT=NO,URI="hi/centerfield/audio-video.m3u8" 2653 #EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="hi",NAME="Dugout", \ 2654 DEFAULT=NO,URI="hi/dugout/audio-video.m3u8" 2656 #EXT-X-STREAM-INF:BANDWIDTH=7680000,CODECS="...",VIDEO="hi" 2657 hi/main/audio-video.m3u8 2659 8.8. Session Data in a Master Playlist 2661 In this example, only the EXT-X-SESSION-DATA is shown: 2663 #EXT-X-SESSION-DATA:DATA-ID="com.example.lyrics",URI="lyrics.json" 2665 #EXT-X-SESSION-DATA:DATA-ID="com.example.title",LANGUAGE="en", \ 2666 VALUE="This is an example" 2667 #EXT-X-SESSION-DATA:DATA-ID="com.example.title",LANGUAGE="es", \ 2668 VALUE="Este es un ejemplo" 2670 8.9. CHARACTERISTICS Attribute Containing Multiple Characteristics 2672 Certain characteristics are valid in combination, as in: 2674 CHARACTERISTICS= 2675 "public.accessibility.transcribes-spoken-dialog,public.easy-to-read" 2677 8.10. EXT-X-DATERANGE Carrying SCTE-35 Tags 2679 This example shows two EXT-X-DATERANGE tags that describe a single 2680 Date Range, with an SCTE-35 "out" splice_insert() command that is 2681 subsequently updated with an SCTE-35 "in" splice_insert() command. 2683 #EXTM3U 2684 ... 2685 #EXT-X-DATERANGE:ID="splice-6FFFFFF0",START-DATE="2014-03-05T11: 2686 15:00Z",PLANNED-DURATION=59.993,SCTE35-OUT=0xFC002F0000000000FF0 2687 00014056FFFFFF000E011622DCAFF000052636200000000000A0008029896F50 2688 000008700000000 2690 ... Media Segment declarations for 60s worth of media 2692 #EXT-X-DATERANGE:ID="splice-6FFFFFF0",DURATION=59.993,SCTE35-IN= 2693 0xFC002A0000000000FF00000F056FFFFFF000401162802E6100000000000A00 2694 08029896F50000008700000000 2695 ... 2697 9. Contributors 2699 Significant contributions to the design of this protocol were made by 2700 Jim Batson, David Biderman, Bill May, Roger Pantos, Alan Tseng, and 2701 Eryk Vershen. Stuart Cheshire helped edit the specification. 2703 Significant contributions to the update of this protocol were made by 2704 Bill May, Eryk Vershen, and Peng Zhou. 2706 In particular, Bill May co-authored the first edition of HTTP Live 2707 Streaming, [RFC8216], and continues to provide valuable guidance and 2708 input. 2710 10. IANA Considerations 2712 IANA has registered the following media type [RFC2046]: 2714 Type name: application 2716 Subtype name: vnd.apple.mpegurl 2718 Required parameters: none 2720 Optional parameters: none 2721 Encoding considerations: encoded as UTF-8, which is 8-bit text. This 2722 media type may require encoding on transports not capable of handling 2723 8-bit text. See Section 4 for more information. 2725 Security considerations: See Section 11. 2727 Compression: this media type does not employ compression. 2729 Interoperability considerations: There are no byte-ordering issues, 2730 since files are 8-bit text. Applications could encounter 2731 unrecognized tags, which SHOULD be ignored. 2733 Published specification: see Section 4. 2735 Applications that use this media type: Multimedia applications such 2736 as the iPhone media player in iOS 3.0 and later and QuickTime Player 2737 in Mac OS X version 10.6 and later. 2739 Fragment identifier considerations: no Fragment Identifiers are 2740 defined for this media type. 2742 Additional information: 2744 Deprecated alias names for this type: none 2745 Magic number(s): #EXTM3U 2746 File extension(s): .m3u8, .m3u (see Section 4) 2747 Macintosh file type code(s): none 2749 Person & email address to contact for further information: David 2750 Singer, singer AT apple.com. 2752 Intended usage: LIMITED USE 2754 Restrictions on usage: none 2756 Author: Roger Pantos 2758 Change Controller: David Singer 2760 11. Security Considerations 2762 Since the protocol generally uses HTTP to transfer data, most of the 2763 same security considerations apply. See Section 15 of HTTP 2764 [RFC7230]. 2766 Media file parsers are typically subject to "fuzzing" attacks. 2767 Implementors SHOULD pay particular attention to code that will parse 2768 data received from a server and ensure that all possible inputs are 2769 handled correctly. 2771 Playlist files contain URIs, which clients will use to make network 2772 requests of arbitrary entities. Clients SHOULD range-check responses 2773 to prevent buffer overflows. See also the Security Considerations 2774 section of "Uniform Resource Identifier (URI): Generic Syntax" 2775 [RFC3986]. 2777 Apart from URL resolution, this format does not employ any form of 2778 active content. 2780 Clients SHOULD limit each playback session to a reasonable number of 2781 concurrent downloads (for example, four) to avoid contributing to 2782 denial-of-service attacks. 2784 HTTP requests often include session state ("cookies"), which may 2785 contain private user data. Implementations MUST follow cookie 2786 restriction and expiry rules specified by "HTTP State Management 2787 Mechanism" [RFC6265] to protect themselves from attack. See also the 2788 Security Considerations section of that document, and "Use of HTTP 2789 State Management" [RFC2964]. 2791 Encryption keys are specified by URI. The delivery of these keys 2792 SHOULD be secured by a mechanism such as HTTP Over TLS [RFC2818] 2793 (formerly SSL) in conjunction with a secure realm or a session token. 2795 12. References 2797 12.1. Normative References 2799 [AC_3] Advanced Television Systems Committee, "Digital Audio 2800 Compression (AC-3) (E-AC-3)", ATSC Standard A/52:2010, 2801 November 2010, <http://atsc.org/wp- 2802 content/uploads/2015/03/A52-201212-17.pdf>. 2804 [AES_128] National Institute of Standards and Technology, "Advanced 2805 Encryption Standard (AES)", FIPS PUB 197, DOI 2806 10.6028/NIST.FIPS.197, November 2001, 2807 <http://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.197.pdf>. 2809 [CEA608] Consumer Technology Association, "Line 21 Data Services", 2810 ANSI/CTA Standard 608-E, April 2008, 2811 <https://standards.cta.tech/kwspub/published_docs/ANSI- 2812 CTA-608-E-R-2014-Preview.pdf>. 2814 [CEA708] Consumer Technology Association, "Digital Television (DTV) 2815 Closed Captioning", ANSI/CTA Standard CEA-708-E, August 2816 2013, <https://standards.cta.tech/kwspub/published_docs/ 2817 ANSI-CTA-708-E-Preview.pdf>. 2819 [CICP] International Organization for Standardization, 2820 "Information technology - MPEG systems technologies - Part 2821 8: Coding-independent code points", ISO/IEC International 2822 Standard 23001-8:2016, 2016, <https://www.iso.org/obp/ 2823 ui/#iso:std:iso-iec:23001:-8:ed-2:v1:en>. 2825 [CMAF] International Organization for Standardization, 2826 "Information technology -- Multimedia application format 2827 (MPEG-A) -- Part 19: Common media application format 2828 (CMAF) for segmented media", ISO/IEC International 2829 Standard 23000-19:2017, December 2017, 2830 <https://www.iso.org/standard/71975.html>. 2832 [COMMON_ENC] 2833 International Organization for Standardization, 2834 "Information technology -- MPEG systems technologies -- 2835 Part 7: Common encryption in ISO base media file format 2836 files", ISO/IEC International Standard 23001-7:2016, 2837 February 2016, <http://www.iso.org/iso/ 2838 catalogue_detail.htm?csnumber=68042>. 2840 [H_264] International Telecommunications Union, "Advanced video 2841 coding for generic audiovisual services", January 2012, 2842 <http://www.itu.int/rec/T-REC-H.264>. 2844 [HDCP] Digital Content Protection LLC, "High-bandwidth Digital 2845 Content Protection System - Mapping HDCP to HDMI", 2846 February 2013, <http://www.digital- 2847 cp.com/sites/default/files/specifications/ 2848 HDCP%20on%20HDMI%20Specification%20Rev2_2_Final1.pdf>. 2850 [IMSC1] W3C, "TTML Profiles for Internet Media Subtitles and 2851 Captions 1.0 (IMSC1)", April 2016, 2852 <https://www.w3.org/TR/ttml-imsc1/>. 2854 [ISO_13818] 2855 International Organization for Standardization, "Generic 2856 coding of moving pictures and associated audio 2857 information", ISO/IEC International Standard 13818:2007, 2858 October 2007, 2859 <http://www.iso.org/iso/catalogue_detail?csnumber=44169>. 2861 [ISO_13818_3] 2862 International Organization for Standardization, "Generic 2863 coding of moving pictures and associated audio information 2864 -- Part 3: Audio", ISO/IEC International 2865 Standard 13818-3:1998, April 1998, 2866 <http://www.iso.org/iso/home/store/catalogue_tc/ 2867 catalogue_detail.htm?csnumber=26797>. 2869 [ISO_13818_7] 2870 International Organization for Standardization, "Generic 2871 coding of moving pictures and associated audio information 2872 -- Part 7: Advanced Audio Coding (AAC)", ISO/IEC 2873 International Standard 13818-7:2006, January 2006, 2874 <http://www.iso.org/iso/home/store/catalogue_tc/ 2875 catalogue_detail.htm?csnumber=43345>. 2877 [ISO_14496] 2878 International Organization for Standardization, 2879 "Information technology -- Coding of audio-visual objects 2880 -- Part 3: Audio", ISO/IEC International 2881 Standard 14496-3:2009, 2009, 2882 <http://www.iso.org/iso/catalogue_detail?csnumber=53943>. 2884 [ISO_8601] 2885 International Organization for Standardization, "Data 2886 elements and interchange formats -- Information 2887 interchange -- Representation of dates and times", ISO/IEC 2888 International Standard 8601:2004, December 2004, 2889 <http://www.iso.org/iso/catalogue_detail?csnumber=40874>. 2891 [ISOBMFF] International Organization for Standardization, 2892 "Information technology -- Coding of audio-visual objects 2893 -- Part 12: ISO base media file format", ISO/IEC 2894 International Standard 14496-12:2015, December 2015, 2895 <http://www.iso.org/iso/ 2896 catalogue_detail.htm?csnumber=68960>. 2898 [MP4_TIMED_TEXT] 2899 International Organization for Standardization, 2900 "Information technology -- Coding of audio-visual objects 2901 -- Part 30: Timed text and other visual overlays in ISO 2902 base media file format", ISO/IEC International 2903 Standard 14496-30:2014, March 2014, 2904 <https://www.iso.org/standard/63107.html>. 2906 [RFC2046] Freed, N. and N. Borenstein, "Multipurpose Internet Mail 2907 Extensions (MIME) Part Two: Media Types", RFC 2046, 2908 DOI 10.17487/RFC2046, November 1996, 2909 <https://www.rfc-editor.org/info/rfc2046>. 2911 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 2912 Requirement Levels", BCP 14, RFC 2119, 2913 DOI 10.17487/RFC2119, March 1997, 2914 <https://www.rfc-editor.org/info/rfc2119>. 2916 [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, 2917 DOI 10.17487/RFC2818, May 2000, 2918 <https://www.rfc-editor.org/info/rfc2818>. 2920 [RFC2964] Moore, K. and N. Freed, "Use of HTTP State Management", 2921 BCP 44, RFC 2964, DOI 10.17487/RFC2964, October 2000, 2922 <https://www.rfc-editor.org/info/rfc2964>. 2924 [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 2925 10646", STD 63, RFC 3629, DOI 10.17487/RFC3629, November 2926 2003, <https://www.rfc-editor.org/info/rfc3629>. 2928 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 2929 Resource Identifier (URI): Generic Syntax", STD 66, 2930 RFC 3986, DOI 10.17487/RFC3986, January 2005, 2931 <https://www.rfc-editor.org/info/rfc3986>. 2933 [RFC5646] Phillips, A., Ed. and M. Davis, Ed., "Tags for Identifying 2934 Languages", BCP 47, RFC 5646, DOI 10.17487/RFC5646, 2935 September 2009, <https://www.rfc-editor.org/info/rfc5646>. 2937 [RFC5652] Housley, R., "Cryptographic Message Syntax (CMS)", STD 70, 2938 RFC 5652, DOI 10.17487/RFC5652, September 2009, 2939 <https://www.rfc-editor.org/info/rfc5652>. 2941 [RFC6265] Barth, A., "HTTP State Management Mechanism", RFC 6265, 2942 DOI 10.17487/RFC6265, April 2011, 2943 <https://www.rfc-editor.org/info/rfc6265>. 2945 [RFC6381] Gellens, R., Singer, D., and P. Frojdh, "The 'Codecs' and 2946 'Profiles' Parameters for "Bucket" Media Types", RFC 6381, 2947 DOI 10.17487/RFC6381, August 2011, 2948 <https://www.rfc-editor.org/info/rfc6381>. 2950 [RFC7230] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 2951 Protocol (HTTP/1.1): Message Syntax and Routing", 2952 RFC 7230, DOI 10.17487/RFC7230, June 2014, 2953 <https://www.rfc-editor.org/info/rfc7230>. 2955 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2956 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 2957 May 2017, <https://www.rfc-editor.org/info/rfc8174>. 2959 [RFC8216] Pantos, R., Ed. and W. May, "HTTP Live Streaming", 2960 RFC 8216, DOI 10.17487/RFC8216, August 2017, 2961 <https://www.rfc-editor.org/info/rfc8216>. 2963 [RFC8259] Bray, T., Ed., "The JavaScript Object Notation (JSON) Data 2964 Interchange Format", STD 90, RFC 8259, 2965 DOI 10.17487/RFC8259, December 2017, 2966 <https://www.rfc-editor.org/info/rfc8259>. 2968 [SCTE35] Society of Cable Telecommunications Engineers, "Digital 2969 Program Insertion Cueing Message for Cable", ANSI/SCTE 35, 2970 August 2014, <http://www.scte.org/documents/pdf/Standards/ 2971 ANSI_SCTE%2035%202014.pdf>. 2973 [US_ASCII] 2974 American National Standards Institute, "Coded Character 2975 Sets - 7-Bit American National Standard Code for 2976 Information Interchange (7-Bit ASCII)", ANSI X3.4, 2977 December 1986. 2979 [WebVTT] World Wide Web Consortium (W3C), ""WebVTT: The Web Video 2980 Text Tracks Format", Draft Community Group Report", July 2981 2013, <http://dev.w3.org/html5/webvtt/>. 2983 12.2. Informative References 2985 [ID3] ID3.org, "The ID3 audio file data tagging format", 2986 <http://www.id3.org/Developer_Information>. 2988 [M3U] Nullsoft, Inc., "The M3U Playlist format, originally 2989 invented for the Winamp media player", 2990 <http://wikipedia.org/wiki/M3U>. 2992 [SampleEnc] 2993 Apple Inc., "MPEG-2 Stream Encryption Format for HTTP Live 2994 Streaming", 2995 <https://developer.apple.com/library/ios/documentation/ 2996 AudioVideo/Conceptual/HLS_Sample_Encryption/>. 2998 [UNICODE] The Unicode Consortium, "The Unicode Standard", 2999 <https://www.unicode.org/versions/latest/>. 3001 [UTI] Apple Inc., "Uniform Type Identifier", 3002 <http://developer.apple.com/library/ios/#documentation/ 3003 general/conceptual/DevPedia-CocoaCore/ 3004 UniformTypeIdentifier.html>. 3006 Appendix A. Changes from RFC 8216 3008 Several changes have been made since the publication of RFC 8216 3009 [RFC8216]. 3011 The following tags have been added: EXT-X-GAP, EXT-X-BITRATE, and 3012 EXT-X-DEFINE (including variable substitution). 3014 IMSC has been added to the set of recognized subtitle formats. 3016 The VIDEO-RANGE attribute has been added to the EXT-X-STREAM-INF and 3017 EXT-X-I-FRAME-STREAM-INF tags. 3019 The ALLOWED-CPC attribute has been added to the EXT-X-STREAM-INF and 3020 EXT-X-I-FRAME-STREAM-INF tags. 3022 TYPE-1 has been added as a defined value for the HDCP-LEVEL 3023 attribute. 3025 The minimum new segment publication latency has been removed from 3026 server timing model. 3028 The Availability Duration of a Media Segment now depends on the 3029 presence of an EXT-X-ENDLIST tag. 3031 The recommended playlist offset to join a live stream has changed. 3033 The minimum delay before reloading a Playlist file has changed. 3035 The definition of peak segment bit rate was changed to ensure every 3036 segment is included in at least one contiguous set. 3038 Media Metadata tags such as EXT-X-DATERANGE may be removed from 3039 playlists. 3041 There have been a number of minor editorial changes. 3043 Author's Address 3044 Roger Pantos (editor) 3045 Apple Inc. 3046 Cupertino, California 3047 United States 3049 Email: http-live-streaming-review@group.apple.com