idnits 2.17.1 draft-pantos-hls-rfc8216bis-06.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 (March 25, 2020) is 1491 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) March 25, 2020 5 Intended status: Informational 6 Expires: September 26, 2020 8 HTTP Live Streaming 2nd Edition 9 draft-pantos-hls-rfc8216bis-06 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 September 26, 2020. 36 Copyright Notice 38 Copyright (c) 2020 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.1.1. MPEG-2 Transport Streams . . . . . . . . . . . . . . 8 64 3.1.2. Fragmented MPEG-4 . . . . . . . . . . . . . . . . . . 8 65 3.1.3. Packed Audio . . . . . . . . . . . . . . . . . . . . 9 66 3.1.4. WebVTT . . . . . . . . . . . . . . . . . . . . . . . 9 67 3.1.5. 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 or Master Playlist Tags . . . . . . . . . . . . 15 77 4.4.2.1. EXT-X-INDEPENDENT-SEGMENTS . . . . . . . . . . . 15 78 4.4.2.2. EXT-X-START . . . . . . . . . . . . . . . . . . . 15 79 4.4.2.3. EXT-X-DEFINE . . . . . . . . . . . . . . . . . . 16 80 4.4.3. Media Playlist Tags . . . . . . . . . . . . . . . . . 17 81 4.4.3.1. EXT-X-TARGETDURATION . . . . . . . . . . . . . . 17 82 4.4.3.2. EXT-X-MEDIA-SEQUENCE . . . . . . . . . . . . . . 17 83 4.4.3.3. EXT-X-DISCONTINUITY-SEQUENCE . . . . . . . . . . 18 84 4.4.3.4. EXT-X-ENDLIST . . . . . . . . . . . . . . . . . . 19 85 4.4.3.5. EXT-X-PLAYLIST-TYPE . . . . . . . . . . . . . . . 19 86 4.4.3.6. EXT-X-I-FRAMES-ONLY . . . . . . . . . . . . . . . 19 87 4.4.4. Media Segment Tags . . . . . . . . . . . . . . . . . 20 88 4.4.4.1. EXTINF . . . . . . . . . . . . . . . . . . . . . 20 89 4.4.4.2. EXT-X-BYTERANGE . . . . . . . . . . . . . . . . . 21 90 4.4.4.3. EXT-X-DISCONTINUITY . . . . . . . . . . . . . . . 21 91 4.4.4.4. EXT-X-KEY . . . . . . . . . . . . . . . . . . . . 22 92 4.4.4.5. EXT-X-MAP . . . . . . . . . . . . . . . . . . . . 24 93 4.4.4.6. EXT-X-PROGRAM-DATE-TIME . . . . . . . . . . . . . 25 94 4.4.4.7. EXT-X-GAP . . . . . . . . . . . . . . . . . . . . 25 95 4.4.4.8. EXT-X-BITRATE . . . . . . . . . . . . . . . . . . 25 97 4.4.5. Media Metadata Tags . . . . . . . . . . . . . . . . . 26 98 4.4.5.1. EXT-X-DATERANGE . . . . . . . . . . . . . . . . . 26 99 4.4.5.1.1. Mapping SCTE-35 into EXT-X-DATERANGE . . . . 28 100 4.4.6. Master Playlist Tags . . . . . . . . . . . . . . . . 29 101 4.4.6.1. EXT-X-MEDIA . . . . . . . . . . . . . . . . . . . 30 102 4.4.6.1.1. Rendition Groups . . . . . . . . . . . . . . 33 103 4.4.6.2. EXT-X-STREAM-INF . . . . . . . . . . . . . . . . 34 104 4.4.6.2.1. Alternative Renditions . . . . . . . . . . . 38 105 4.4.6.3. EXT-X-I-FRAME-STREAM-INF . . . . . . . . . . . . 39 106 4.4.6.4. EXT-X-SESSION-DATA . . . . . . . . . . . . . . . 40 107 4.4.6.5. EXT-X-SESSION-KEY . . . . . . . . . . . . . . . . 41 108 5. Key Files . . . . . . . . . . . . . . . . . . . . . . . . . . 41 109 5.1. Structure of Key Files . . . . . . . . . . . . . . . . . 41 110 5.2. IV for AES-128 . . . . . . . . . . . . . . . . . . . . . 41 111 6. Client/Server Responsibilities . . . . . . . . . . . . . . . 42 112 6.1. Introduction . . . . . . . . . . . . . . . . . . . . . . 42 113 6.2. Server Responsibilities . . . . . . . . . . . . . . . . . 42 114 6.2.1. General Server Responsibilities . . . . . . . . . . . 42 115 6.2.2. Live Playlists . . . . . . . . . . . . . . . . . . . 45 116 6.2.3. Encrypting Media Segments . . . . . . . . . . . . . . 46 117 6.2.4. Providing Variant Streams . . . . . . . . . . . . . . 47 118 6.3. Client Responsibilities . . . . . . . . . . . . . . . . . 48 119 6.3.1. General Client Responsibilities . . . . . . . . . . . 48 120 6.3.2. Loading the Media Playlist File . . . . . . . . . . . 49 121 6.3.3. Playing the Media Playlist File . . . . . . . . . . . 50 122 6.3.4. Reloading the Media Playlist File . . . . . . . . . . 51 123 6.3.5. Determining the Next Segment to Load . . . . . . . . 52 124 6.3.6. Decrypting Encrypted Media Segments . . . . . . . . . 52 125 7. Protocol Version Compatibility . . . . . . . . . . . . . . . 53 126 8. Playlist Examples . . . . . . . . . . . . . . . . . . . . . . 55 127 8.1. Simple Media Playlist . . . . . . . . . . . . . . . . . . 55 128 8.2. Live Media Playlist Using HTTPS . . . . . . . . . . . . . 55 129 8.3. Playlist with Encrypted Media Segments . . . . . . . . . 55 130 8.4. Master Playlist . . . . . . . . . . . . . . . . . . . . . 56 131 8.5. Master Playlist with I-Frames . . . . . . . . . . . . . . 56 132 8.6. Master Playlist with Alternative Audio . . . . . . . . . 57 133 8.7. Master Playlist with Alternative Video . . . . . . . . . 57 134 8.8. Session Data in a Master Playlist . . . . . . . . . . . . 58 135 8.9. CHARACTERISTICS Attribute Containing Multiple 136 Characteristics . . . . . . . . . . . . . . . . . . . . . 58 137 8.10. EXT-X-DATERANGE Carrying SCTE-35 Tags . . . . . . . . . . 59 138 9. Contributors . . . . . . . . . . . . . . . . . . . . . . . . 59 139 10. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 59 140 11. Security Considerations . . . . . . . . . . . . . . . . . . . 60 141 12. References . . . . . . . . . . . . . . . . . . . . . . . . . 61 142 12.1. Normative References . . . . . . . . . . . . . . . . . . 61 143 12.2. Informative References . . . . . . . . . . . . . . . . . 65 144 Appendix A. Changes from RFC 8216 . . . . . . . . . . . . . . . 66 145 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 66 147 1. Introduction to HTTP Live Streaming 149 HTTP Live Streaming provides a reliable, cost-effective means of 150 delivering continuous and long-form video over the Internet. It 151 allows a receiver to adapt the bit rate of the media to the current 152 network conditions in order to maintain uninterrupted playback at the 153 best possible quality. It supports interstitial content boundaries. 154 It provides a flexible framework for media encryption. It can 155 efficiently offer multiple renditions of the same content, such as 156 audio translations. It offers compatibility with large-scale HTTP 157 caching infrastructure to support delivery to large audiences. 159 Since its first draft publication in 2009, HTTP Live Streaming has 160 been implemented and deployed by a wide array of content producers, 161 tools vendors, distributors, and device manufacturers. In the 162 subsequent ten years the protocol has been refined by extensive 163 review and discussion with a variety of media streaming implementors. 165 The purpose of this document is to facilitate interoperability 166 between HTTP Live Streaming implementations by describing the media 167 transmission protocol. Using this protocol, a client can receive a 168 continuous stream of media from a server for concurrent presentation. 170 This document describes version 8 of the protocol. 172 2. Overview 174 A multimedia presentation is specified by a Uniform Resource 175 Identifier (URI) [RFC3986] to a Playlist. 177 A Playlist is either a Media Playlist or a Master Playlist. Both are 178 UTF-8 text files containing URIs and descriptive tags. 180 A Media Playlist contains a list of Media Segments, which, when 181 played sequentially, will play the multimedia presentation. 183 Here is an example of a Media Playlist: 185 #EXTM3U 186 #EXT-X-TARGETDURATION:10 188 #EXTINF:9.009, 189 http://media.example.com/first.ts 190 #EXTINF:9.009, 191 http://media.example.com/second.ts 192 #EXTINF:3.003, 193 http://media.example.com/third.ts 195 The first line is the format identifier tag #EXTM3U. The line 196 containing #EXT-X-TARGETDURATION says that all Media Segments will be 197 10 seconds long or less. Then, three Media Segments are declared. 198 The first and second are 9.009 seconds long; the third is 3.003 199 seconds. 201 To play this Playlist, the client first downloads it and then 202 downloads and plays each Media Segment declared within it. The 203 client reloads the Playlist as described in this document to discover 204 any added segments. Data SHOULD be carried over HTTP [RFC7230], but, 205 in general, a URI can specify any protocol that can reliably transfer 206 the specified resource on demand. 208 A more complex presentation can be described by a Master Playlist. A 209 Master Playlist provides a set of Variant Streams, each of which 210 describes a different version of the same content. 212 A Variant Stream includes a Media Playlist that specifies media 213 encoded at a particular bit rate, in a particular format, and at a 214 particular resolution for media containing video. 216 A Variant Stream can also specify a set of Renditions. Renditions 217 are alternate versions of the content, such as audio produced in 218 different languages or video recorded from different camera angles. 220 Clients should switch between different Variant Streams to adapt to 221 network conditions. Clients should choose Renditions based on user 222 preferences. 224 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 225 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 226 "OPTIONAL" in this document are to be interpreted as described in BCP 227 14 [RFC2119] [RFC8174] when, and only when, they appear in all 228 capitals, as shown here. 230 3. Media Segments 232 A Media Playlist contains a series of Media Segments that make up the 233 overall presentation. A Media Segment is specified by a URI and 234 optionally a byte range. 236 The duration of each Media Segment is indicated in the Media Playlist 237 by its EXTINF tag (Section 4.4.4.1). 239 Each segment in a Media Playlist has a unique integer Media Sequence 240 Number. The Media Sequence Number of the first segment in the Media 241 Playlist is either 0 or declared in the Playlist (Section 4.4.3.2). 242 The Media Sequence Number of every other segment is equal to the 243 Media Sequence Number of the segment that precedes it plus one. 245 Each Media Segment MUST carry the continuation of the encoded 246 bitstream from the end of the segment with the previous Media 247 Sequence Number, where values in a series such as timestamps and 248 Continuity Counters MUST continue uninterrupted. The only exceptions 249 are the first Media Segment ever to appear in a Media Playlist and 250 Media Segments that are explicitly signaled as discontinuities 251 (Section 4.4.4.3). Unmarked media discontinuities can trigger 252 playback errors. 254 Any Media Segment that contains video SHOULD include enough 255 information to initialize a video decoder and decode a continuous set 256 of frames that includes the final frame in the Segment; network 257 efficiency is optimized if there is enough information in the Segment 258 to decode all frames in the Segment. For example, any Media Segment 259 containing H.264 video SHOULD contain an Instantaneous Decoding 260 Refresh (IDR); frames prior to the first IDR will be downloaded but 261 possibly discarded. 263 3.1. Supported Media Segment Formats 265 All Media Segments MUST be in a format described in this section. 266 Transport of other media file formats is not defined. 268 Some media formats require a common sequence of bytes to initialize a 269 parser before a Media Segment can be parsed. This format-specific 270 sequence is called the Media Initialization Section. The Media 271 Initialization Section can be specified by an EXT-X-MAP tag 272 (Section 4.4.4.5). The Media Initialization Section MUST NOT contain 273 sample data. 275 3.1.1. MPEG-2 Transport Streams 277 MPEG-2 Transport Streams are specified by [ISO_13818]. 279 The Media Initialization Section of an MPEG-2 Transport Stream 280 Segment is a Program Association Table (PAT) followed by a Program 281 Map Table (PMT). 283 Transport Stream Segments MUST contain a single MPEG-2 Program; 284 playback of Multi-Program Transport Streams is not defined. Each 285 Transport Stream Segment MUST contain a PAT and a PMT, or have an 286 EXT-X-MAP tag (Section 4.4.4.5) applied to it. The first two 287 Transport Stream packets in a Segment without an EXT-X-MAP tag SHOULD 288 be a PAT and a PMT. 290 3.1.2. Fragmented MPEG-4 292 MPEG-4 Fragments are specified by the ISO Base Media File Format 293 [ISOBMFF]. Unlike regular MPEG-4 files that have a Movie Box 294 ('moov') that contains sample tables and a Media Data Box ('mdat') 295 containing the corresponding samples, an MPEG-4 Fragment consists of 296 a Movie Fragment Box ('moof') containing a subset of the sample table 297 and a Media Data Box containing those samples. Use of MPEG-4 298 Fragments does require a Movie Box for initialization, but that Movie 299 Box contains only non-sample-specific information such as track and 300 sample descriptions. 302 A Fragmented MPEG-4 (fMP4) Segment is a "segment" as defined by 303 Section 3 of [ISOBMFF], including the constraints on Media Data Boxes 304 in Section 8.16 of [ISOBMFF]. 306 The Media Initialization Section for an fMP4 Segment is an ISO Base 307 Media File that can initialize a parser for that Segment. 309 Broadly speaking, fMP4 Segments and Media Initialization Sections are 310 [ISOBMFF] files that also satisfy the constraints described in this 311 section. 313 The Media Initialization Section for an fMP4 Segment MUST contain a 314 File Type Box ('ftyp') containing a brand that is compatible with 315 'iso6' or higher. The File Type Box MUST be followed by a Movie Box. 316 The Movie Box MUST contain a Track Box ('trak') for every Track 317 Fragment Box ('traf') in the fMP4 Segment, with matching track_ID. 318 Each Track Box SHOULD contain a sample table, but its sample count 319 MUST be zero. Movie Header Boxes ('mvhd') and Track Header Boxes 320 ('tkhd') MUST have durations of zero. The Movie Box MUST contain a 321 Movie Extends Box ('mvex'); it SHOULD follow the last Track Box. 323 Note that a Common Media Application Format [CMAF] Header meets all 324 these requirements. 326 In an fMP4 Segment, every Track Fragment Box MUST contain a Track 327 Fragment Decode Time Box ('tfdt'). fMP4 Segments MUST use movie- 328 fragment-relative addressing. fMP4 Segments MUST NOT use external 329 data references. Note that a CMAF Segment meets these requirements. 331 An fMP4 Segment in a Playlist containing the EXT-X-I-FRAMES-ONLY tag 332 (Section 4.4.3.6) MAY omit the portion of the Media Data Box 333 following the intra-coded frame (I-frame) sample data. 335 Each fMP4 Segment in a Media Playlist MUST have an EXT-X-MAP tag 336 applied to it. 338 3.1.3. Packed Audio 340 A Packed Audio Segment contains encoded audio samples and ID3 tags 341 that are simply packed together with minimal framing and no per- 342 sample timestamps. Supported Packed Audio formats are Advanced Audio 343 Coding (AAC) with Audio Data Transport Stream (ADTS) framing 344 [ISO_13818_7], MP3 [ISO_13818_3], AC-3 [AC_3], and Enhanced AC-3 345 [AC_3]. 347 A Packed Audio Segment has no Media Initialization Section. 349 Each Packed Audio Segment MUST signal the timestamp of its first 350 sample with an ID3 Private frame (PRIV) tag [ID3] at the beginning of 351 the segment. The ID3 PRIV owner identifier MUST be 352 "com.apple.streaming.transportStreamTimestamp". The ID3 payload MUST 353 be a 33-bit MPEG-2 Program Elementary Stream timestamp expressed as a 354 big-endian eight-octet number, with the upper 31 bits set to zero. 355 Clients SHOULD NOT play Packed Audio Segments without this ID3 tag. 357 3.1.4. WebVTT 359 A WebVTT Segment is a section of a WebVTT [WebVTT] file. WebVTT 360 Segments carry subtitles. 362 The Media Initialization Section of a WebVTT Segment is the WebVTT 363 header. 365 Each WebVTT Segment MUST contain all subtitle cues that are intended 366 to be displayed during the period indicated by the segment EXTINF 367 duration. The start time offset and end time offset of each cue MUST 368 indicate the total display time for that cue, even if part of the cue 369 time range is outside the Segment period. A WebVTT Segment MAY 370 contain no cues; this indicates that no subtitles are to be displayed 371 during that period. 373 Each WebVTT Segment MUST either start with a WebVTT header or have an 374 EXT-X-MAP tag applied to it. 376 In order to synchronize timestamps between audio/video and subtitles, 377 an X-TIMESTAMP-MAP metadata header SHOULD be added to each WebVTT 378 header. This header maps WebVTT cue timestamps to media timestamps 379 in other Renditions of the Variant Stream. Its format is: 381 X-TIMESTAMP-MAP=LOCAL:,MPEGTS: 382 e.g., X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000 384 indicating the media time to which the cue time MUST be mapped. The 385 cue timestamp in the LOCAL attribute MAY fall outside the range of 386 time covered by the segment. 388 The MPEGTS media timestamp MUST use a 90KHz timescale, even when non- 389 WebVTT Media Segments use a different timescale. 391 If a WebVTT segment does not have the X-TIMESTAMP-MAP, the client 392 MUST assume that the WebVTT cue time of 0 maps to an media timestamp 393 of 0. 395 When synchronizing WebVTT with PES timestamps, clients SHOULD account 396 for cases where the 33-bit PES timestamps have wrapped and the WebVTT 397 cue times have not. When the PES timestamp wraps, the WebVTT segment 398 SHOULD have a X-TIMESTAMP-MAP header that maps the current WebVTT 399 time to the new (low valued) PES timestamp. 401 3.1.5. IMSC Subtitles 403 An IMSC Segment is a Fragmented MPEG-4 (Section 3.1.2) Media Segment 404 that carries subtitle media according to MPEG-4 Part 30 405 [MP4_TIMED_TEXT]. This subtitle media MUST comply with the Text 406 Profile of IMSC1 [IMSC1]. 408 The Media Initialization Section of an IMSC Segment is specified in 409 Section 3.1.2. 411 Each IMSC Segment MUST contain all subtitle samples that are intended 412 to be displayed during the period indicated by the segment EXTINF 413 duration. Each Segment MUST contain definitions for all styles which 414 are applied to any part of any sample in the Segment. 416 4. Playlists 418 This section describes the Playlist files used by HTTP Live 419 Streaming. In this section, "MUST" and "MUST NOT" specify the rules 420 for the syntax and structure of legal Playlist files. Playlists that 421 violate these rules are invalid; clients MUST fail to parse them. 422 See Section 6.3.2. 424 The format of the Playlist files is derived from the M3U [M3U] 425 playlist file format and inherits two tags from that earlier file 426 format: EXTM3U (Section 4.4.1.1) and EXTINF (Section 4.4.4.1). 428 In the specification of tag syntax, a string enclosed by <> 429 identifies a tag parameter; its specific format is described in its 430 tag definition. If a parameter is further surrounded by [], it is 431 optional; otherwise, it is required. 433 Each Playlist file MUST be identifiable either by the path component 434 of its URI or by HTTP Content-Type. In the first case, the path MUST 435 end with either .m3u8 or .m3u. In the second, the HTTP Content-Type 436 MUST be "application/vnd.apple.mpegurl" or "audio/mpegurl". Clients 437 SHOULD refuse to parse Playlists that are not so identified. 439 4.1. Definition of a Playlist 441 Playlist files MUST be encoded in UTF-8 [RFC3629]. They MUST NOT 442 contain any Byte Order Mark (BOM); clients SHOULD fail to parse 443 Playlists that contain a BOM or do not parse as UTF-8. Playlist 444 files MUST NOT contain UTF-8 control characters (U+0000 to U+001F and 445 U+007F to U+009F), with the exceptions of CR (U+000D) and LF 446 (U+000A). All character sequences MUST be normalized according to 447 Unicode normalization form "NFC" [UNICODE]. Note that US-ASCII 448 [US_ASCII] conforms to these rules. 450 Lines in a Playlist file are terminated by either a single line feed 451 character or a carriage return character followed by a line feed 452 character. Each line is a URI, is blank, or starts with the 453 character '#'. Blank lines are ignored. Whitespace MUST NOT be 454 present, except for elements in which it is explicitly specified. 456 Lines that start with the character '#' are either comments or tags. 457 Tags begin with #EXT. They are case sensitive. All other lines that 458 begin with '#' are comments and SHOULD be ignored. 460 A URI line identifies a Media Segment or a Playlist file (see 461 Section 4.4.6.2). Each Media Segment is specified by a URI and the 462 tags that apply to it. 464 A Playlist is a Media Playlist if all URI lines in the Playlist 465 identify Media Segments. A Playlist is a Master Playlist if all URI 466 lines in the Playlist identify Media Playlists. A Playlist MUST be 467 either a Media Playlist or a Master Playlist; all other Playlists are 468 invalid. 470 A URI in a Playlist, whether it is a URI line or part of a tag, MAY 471 be relative. Any relative URI is considered to be relative to the 472 URI of the Playlist that contains it. 474 The duration of a Media Playlist is the sum of the durations of the 475 Media Segments within it. 477 The segment bit rate of a Media Segment is the size of the Media 478 Segment divided by its EXTINF duration (Section 4.4.4.1). Note that 479 this includes container overhead but does not include overhead 480 imposed by the delivery system, such as HTTP, TCP, or IP headers. 482 The peak segment bit rate of a Media Playlist is the largest bit rate 483 of any contiguous set of segments whose total duration is between 0.5 484 times the Target Duration and 1.5 times the Target Duration plus 0.5 485 seconds (since media segments may exceed the Target Duration by up to 486 0.5 seconds). The bit rate of a set is calculated by dividing the 487 sum of the segment sizes by the sum of the segment durations. 489 The average segment bit rate of a Media Playlist is the sum of the 490 sizes (in bits) of every Media Segment in the Media Playlist, divided 491 by the Media Playlist duration. Note that this includes container 492 overhead, but not HTTP or other overhead imposed by the delivery 493 system. 495 4.2. Attribute Lists 497 Certain tags have values that are attribute-lists. An attribute-list 498 is a comma-separated list of attribute/value pairs with no 499 whitespace. 501 An attribute/value pair has the following syntax: 503 AttributeName=AttributeValue 505 An AttributeName is an unquoted string containing characters from the 506 set [A..Z], [0..9], and '-'. Therefore, AttributeNames contain only 507 uppercase letters, not lowercase. There MUST NOT be any whitespace 508 between the AttributeName and the '=' character, nor between the '=' 509 character and the AttributeValue. 511 An AttributeValue is one of the following: 513 o decimal-integer: an unquoted string of characters from the set 514 [0..9] expressing an integer in base-10 arithmetic in the range 515 from 0 to 2^64-1 (18446744073709551615). A decimal-integer may be 516 from 1 to 20 characters long. 518 o hexadecimal-sequence: an unquoted string of characters from the 519 set [0..9] and [A..F] that is prefixed with 0x or 0X. The maximum 520 length of a hexadecimal-sequence depends on its AttributeNames. 522 o decimal-floating-point: an unquoted string of characters from the 523 set [0..9] and '.' that expresses a non-negative floating-point 524 number in decimal positional notation. 526 o signed-decimal-floating-point: an unquoted string of characters 527 from the set [0..9], '-', and '.' that expresses a signed 528 floating-point number in decimal positional notation. 530 o quoted-string: a string of characters within a pair of double 531 quotes (0x22). The following characters MUST NOT appear in a 532 quoted-string: line feed (0xA), carriage return (0xD), or double 533 quote (0x22). Quoted-string AttributeValues SHOULD be constructed 534 so that byte-wise comparison is sufficient to test two quoted- 535 string AttributeValues for equality. Note that this implies case- 536 sensitive comparison. 538 o enumerated-string: an unquoted character string from a set that is 539 explicitly defined by the AttributeName. An enumerated-string 540 will never contain double quotes ("), commas (,), or whitespace. 542 o decimal-resolution: two decimal-integers separated by the "x" 543 character. The first integer is a horizontal pixel dimension 544 (width); the second is a vertical pixel dimension (height). 546 The type of the AttributeValue for a given AttributeName is specified 547 by the attribute definition. 549 A given AttributeName MUST NOT appear more than once in a given 550 attribute-list. Clients SHOULD refuse to parse such Playlists. 552 4.3. Variable Substitution 554 The following Playlist elements are subject to variable substitution: 556 o URI lines 558 o quoted-string AttributeValues 560 o hexadecimal-sequence AttributeValues 561 A Variable Reference is a string of the form "{$" (0x7B,0x24) 562 followed by a Variable Name followed by "}" (0x7D). Variable Names 563 are defined by the EXT-X-DEFINE tag (Section 4.4.2.3). 565 See Section 6.3.1 for more information about variable substitution. 567 4.4. Playlist Tags 569 Playlist tags specify either global parameters of the Playlist or 570 information about the Media Segments or Media Playlists that appear 571 after them. 573 4.4.1. Basic Tags 575 These tags are allowed in both Media Playlists and Master Playlists. 577 4.4.1.1. EXTM3U 579 The EXTM3U tag indicates that the file is an Extended M3U [M3U] 580 Playlist file. It MUST be the first line of every Media Playlist and 581 every Master Playlist. Its format is: 583 #EXTM3U 585 4.4.1.2. EXT-X-VERSION 587 The EXT-X-VERSION tag indicates the compatibility version of the 588 Playlist file, its associated media, and its server. 590 The EXT-X-VERSION tag applies to the entire Playlist file. Its 591 format is: 593 #EXT-X-VERSION: 595 where n is an integer indicating the protocol compatibility version 596 number. 598 It MUST appear in all Playlists containing tags or attributes that 599 are not compatible with protocol version 1 to support 600 interoperability with older clients. Section 7 specifies the minimum 601 value of the compatibility version number for any given Playlist 602 file. 604 A Playlist file MUST NOT contain more than one EXT-X-VERSION tag. If 605 a client encounters a Playlist with multiple EXT-X-VERSION tags, it 606 MUST fail to parse it. 608 4.4.2. Media or Master Playlist Tags 610 The tags in this section can appear in either Master Playlists or 611 Media Playlists. If one of these tags appears in a Master Playlist, 612 it SHOULD NOT appear in any Media Playlist referenced by that Master 613 Playlist. A tag that appears in both MUST have the same value; 614 otherwise, clients SHOULD ignore the value in the Media Playlist(s). 616 Tags in this section MUST NOT appear more than once in a Playlist. 617 If one does, clients MUST fail to parse the Playlist. The only 618 exception to this rule is EXT-X-DEFINE, which MAY appear more than 619 once. 621 4.4.2.1. EXT-X-INDEPENDENT-SEGMENTS 623 The EXT-X-INDEPENDENT-SEGMENTS tag indicates that all media samples 624 in a Media Segment can be decoded without information from other 625 segments. It applies to every Media Segment in the Playlist. 627 Its format is: 629 #EXT-X-INDEPENDENT-SEGMENTS 631 If the EXT-X-INDEPENDENT-SEGMENTS tag appears in a Master Playlist, 632 it applies to every Media Segment in every Media Playlist in the 633 Master Playlist. 635 4.4.2.2. EXT-X-START 637 The EXT-X-START tag indicates a preferred point at which to start 638 playing a Playlist. By default, clients SHOULD start playback at 639 this point when beginning a playback session. This tag is OPTIONAL. 641 Its format is: 643 #EXT-X-START: 645 The following attributes are defined: 647 TIME-OFFSET 649 The value of TIME-OFFSET is a signed-decimal-floating-point number 650 of seconds. A positive number indicates a time offset from the 651 beginning of the Playlist. A negative number indicates a negative 652 time offset from the end of the last Media Segment in the 653 Playlist. This attribute is REQUIRED. 655 The absolute value of TIME-OFFSET SHOULD NOT be larger than the 656 Playlist duration. If the absolute value of TIME-OFFSET exceeds 657 the duration of the Playlist, it indicates either the end of the 658 Playlist (if positive) or the beginning of the Playlist (if 659 negative). 661 If the Playlist does not contain the EXT-X-ENDLIST tag, the TIME- 662 OFFSET SHOULD NOT be within three Target Durations of the end of 663 the Playlist file. 665 PRECISE 667 The value is an enumerated-string; valid strings are YES and NO. 668 If the value is YES, clients SHOULD start playback at the Media 669 Segment containing the TIME-OFFSET, but SHOULD NOT render media 670 samples in that segment whose presentation times are prior to the 671 TIME-OFFSET. If the value is NO, clients SHOULD attempt to render 672 every media sample in that segment. This attribute is OPTIONAL. 673 If it is missing, its value should be treated as NO. 675 4.4.2.3. EXT-X-DEFINE 677 The EXT-X-DEFINE tag provides a Playlist variable definition or 678 declaration. This tag is OPTIONAL. 680 Its format is: 682 #EXT-X-DEFINE: 684 The following attributes are defined: 686 NAME 688 The value is a quoted-string which specifies the Variable Name. 689 All characters in the quoted-string MUST be from the following 690 set: [a..z], [A..Z], [0..9], '-', and '_'. 692 VALUE 694 The value is a quoted-string which specifies the Variable Value. 695 This attribute is REQUIRED if the EXT-X-DEFINE tag has a NAME 696 attribute. 698 IMPORT 700 The value is a quoted-string which specifies the Variable Name and 701 indicates that its value is that of the variable of the same name 702 in the Master Playlist. EXT-X-DEFINE tags containing the IMPORT 703 attribute MUST NOT occur in Master Playlists; they are only 704 allowed in Media Playlists. 706 If the IMPORT attribute value does not match any Variable Name 707 declared in the Master Playlist, or if the Media Playlist was not 708 loaded from a Master Playlist, the parser MUST fail to parse the 709 Playlist. 711 An EXT-X-DEFINE tag MUST contain either a NAME or an IMPORT 712 attribute, but not both. 714 An EXT-X-DEFINE tag MUST NOT specify the same Variable Name as any 715 other EXT-X-DEFINE tag in the same Playlist. Parsers that encounter 716 duplicate Variable Name declarations MUST fail to parse the Playlist. 718 EXT-X-DEFINE tags do NOT implicitly persist across Playlist reloads. 720 4.4.3. Media Playlist Tags 722 Media Playlist tags describe global parameters of the Media Playlist. 723 There MUST NOT be more than one Media Playlist tag of each type in 724 any Media Playlist. 726 A Media Playlist tag MUST NOT appear in a Master Playlist 728 4.4.3.1. EXT-X-TARGETDURATION 730 The EXT-X-TARGETDURATION tag specifies the Target Duration, an upper 731 bound on the duration of all Media Segments in the Playlist. The 732 EXTINF duration of each Media Segment in a Playlist file, when 733 rounded to the nearest integer, MUST be less than or equal to the 734 Target Duration. Longer segments can trigger playback stalls or 735 other errors. It applies to the entire Playlist file. Its format 736 is: 738 #EXT-X-TARGETDURATION: 740 where s is a decimal-integer indicating the Target Duration in 741 seconds. The EXT-X-TARGETDURATION tag is REQUIRED. 743 4.4.3.2. EXT-X-MEDIA-SEQUENCE 744 The EXT-X-MEDIA-SEQUENCE tag indicates the Media Sequence Number of 745 the first Media Segment that appears in a Playlist file. Its format 746 is: 748 #EXT-X-MEDIA-SEQUENCE: 750 where number is a decimal-integer. 752 If the Media Playlist file does not contain an EXT-X-MEDIA-SEQUENCE 753 tag, then the Media Sequence Number of the first Media Segment in the 754 Media Playlist SHALL be considered to be 0. A client MUST NOT assume 755 that segments with the same Media Sequence Number in different Media 756 Playlists contain matching content (see Section 6.3.2). 758 A URI for a Media Segment is not required to contain its Media 759 Sequence Number. 761 See Section 6.2.1 and Section 6.3.5 for more information on setting 762 the EXT-X-MEDIA-SEQUENCE tag. 764 The EXT-X-MEDIA-SEQUENCE tag MUST appear before the first Media 765 Segment in the Playlist. 767 4.4.3.3. EXT-X-DISCONTINUITY-SEQUENCE 769 The EXT-X-DISCONTINUITY-SEQUENCE tag allows synchronization between 770 different Renditions of the same Variant Stream or different Variant 771 Streams that have EXT-X-DISCONTINUITY tags in their Media Playlists. 773 Its format is: 775 #EXT-X-DISCONTINUITY-SEQUENCE: 777 where number is a decimal-integer. 779 If the Media Playlist does not contain an EXT-X-DISCONTINUITY- 780 SEQUENCE tag, then the Discontinuity Sequence Number of the first 781 Media Segment in the Playlist SHALL be considered to be 0. 783 The EXT-X-DISCONTINUITY-SEQUENCE tag MUST appear before the first 784 Media Segment in the Playlist. 786 The EXT-X-DISCONTINUITY-SEQUENCE tag MUST appear before any EXT- 787 X-DISCONTINUITY tag. 789 See Section 6.2.1 and Section 6.2.2 for more information about 790 setting the value of the EXT-X-DISCONTINUITY-SEQUENCE tag. 792 4.4.3.4. EXT-X-ENDLIST 794 The EXT-X-ENDLIST tag indicates that no more Media Segments will be 795 added to the Media Playlist file. It MAY occur anywhere in the Media 796 Playlist file. Its format is: 798 #EXT-X-ENDLIST 800 4.4.3.5. EXT-X-PLAYLIST-TYPE 802 The EXT-X-PLAYLIST-TYPE tag provides mutability information about the 803 Media Playlist file. It applies to the entire Media Playlist file. 804 It is OPTIONAL. Its format is: 806 #EXT-X-PLAYLIST-TYPE: 808 where type-enum is either EVENT or VOD. 810 Section 6.2.1 defines the implications of the EXT-X-PLAYLIST-TYPE 811 tag. 813 If the EXT-X-PLAYLIST-TYPE value is EVENT, Media Segments can only be 814 added to the end of the Media Playlist. If the EXT-X-PLAYLIST-TYPE 815 value is Video On Demand (VOD), the Media Playlist cannot change. 817 If the EXT-X-PLAYLIST-TYPE tag is omitted from a Media Playlist, the 818 Playlist can be updated according to the rules in Section 6.2.1 with 819 no additional restrictions. For example, a live Playlist 820 (Section 6.2.2) MAY be updated to remove Media Segments in the order 821 that they appeared. 823 4.4.3.6. EXT-X-I-FRAMES-ONLY 825 The EXT-X-I-FRAMES-ONLY tag indicates that each Media Segment in the 826 Playlist describes a single I-frame. I-frames are encoded video 827 frames whose decoding does not depend on any other frame. I-frame 828 Playlists can be used for trick play, such as fast forward, rapid 829 reverse, and scrubbing. 831 The EXT-X-I-FRAMES-ONLY tag applies to the entire Playlist. Its 832 format is: 834 #EXT-X-I-FRAMES-ONLY 836 In a Playlist with the EXT-X-I-FRAMES-ONLY tag, the Media Segment 837 duration (EXTINF tag value) is the time between the presentation time 838 of the I-frame in the Media Segment and the presentation time of the 839 next I-frame in the Playlist, or the end of the presentation if it is 840 the last I-frame in the Playlist. 842 Media resources containing I-frame segments MUST begin with either a 843 Media Initialization Section (Section 3) or be accompanied by an EXT- 844 X-MAP tag indicating the Media Initialization Section so that clients 845 can load and decode I-frame segments in any order. The byte range of 846 an I-frame segment with an EXT-X-BYTERANGE tag applied to it 847 (Section 4.4.4.2) MUST NOT include its Media Initialization Section; 848 clients can assume that the Media Initialization Section is defined 849 by the EXT-X-MAP tag, or is located between the start of the resource 850 and the offset of the first I-frame segment in that resource. 852 Use of the EXT-X-I-FRAMES-ONLY REQUIRES a compatibility version 853 number of 4 or greater. 855 4.4.4. Media Segment Tags 857 Each Media Segment is specified by a series of Media Segment tags 858 followed by a URI. Some Media Segment tags apply to just the next 859 segment; others apply to all subsequent segments until another 860 instance of the same tag. 862 A Media Segment tag MUST NOT appear in a Master Playlist. Clients 863 MUST fail to parse Playlists that contain both Media Segment tags and 864 Master Playlist tags (Section 4.4.6). 866 4.4.4.1. EXTINF 868 The EXTINF tag specifies the duration of a Media Segment. It applies 869 only to the next Media Segment. This tag is REQUIRED for each Media 870 Segment. Its format is: 872 #EXTINF:,[] 874 where duration is a decimal-floating-point or decimal-integer number 875 (as described in Section 4.2) that specifies the duration of the 876 Media Segment in seconds. Durations SHOULD be decimal-floating- 877 point, with enough accuracy to avoid perceptible error when segment 878 durations are accumulated. However, if the compatibility version 879 number is less than 3, durations MUST be integers. Durations that 880 are reported as integers SHOULD be rounded to the nearest integer. 881 The remainder of the line following the comma is an optional human- 882 readable informative title of the Media Segment expressed as UTF-8 883 text. 885 4.4.4.2. EXT-X-BYTERANGE 887 The EXT-X-BYTERANGE tag indicates that a Media Segment is a sub-range 888 of the resource identified by its URI. It applies only to the next 889 URI line that follows it in the Playlist. Its format is: 891 #EXT-X-BYTERANGE:<n>[@<o>] 893 where n is a decimal-integer indicating the length of the sub-range 894 in bytes. If present, o is a decimal-integer indicating the start of 895 the sub-range, as a byte offset from the beginning of the resource. 896 If o is not present, the sub-range begins at the next byte following 897 the sub-range of the previous Media Segment. 899 If o is not present, a previous Media Segment MUST appear in the 900 Playlist file and MUST be a sub-range of the same media resource, or 901 the Media Segment is undefined and the client MUST fail to parse the 902 Playlist. 904 A Media Segment without an EXT-X-BYTERANGE tag consists of the entire 905 resource identified by its URI. 907 Use of the EXT-X-BYTERANGE tag REQUIRES a compatibility version 908 number of 4 or greater. 910 4.4.4.3. EXT-X-DISCONTINUITY 912 The EXT-X-DISCONTINUITY tag indicates a discontinuity between the 913 Media Segment that follows it and the one that preceded it. 915 Its format is: 917 #EXT-X-DISCONTINUITY 919 The EXT-X-DISCONTINUITY tag MUST be present if there is a change in 920 any of the following characteristics: 922 o file format 924 o number, type, and identifiers of tracks 926 o timestamp sequence 928 The EXT-X-DISCONTINUITY tag SHOULD be present if there is a change in 929 any of the following characteristics: 931 o encoding parameters 932 o encoding sequence 934 See Section 3, Section 6.2.1, and Section 6.3.3 for more information 935 about the EXT-X-DISCONTINUITY tag. 937 4.4.4.4. EXT-X-KEY 939 Media Segments MAY be encrypted. The EXT-X-KEY tag specifies how to 940 decrypt them. It applies to every Media Segment and to every Media 941 Initialization Section declared by an EXT-X-MAP tag that appears 942 between it and the next EXT-X-KEY tag in the Playlist file with the 943 same KEYFORMAT attribute (or the end of the Playlist file). Two or 944 more EXT-X-KEY tags with different KEYFORMAT attributes MAY apply to 945 the same Media Segment if they ultimately produce the same decryption 946 key. The format is: 948 #EXT-X-KEY:<attribute-list> 950 The following attributes are defined: 952 METHOD 954 The value is an enumerated-string that specifies the encryption 955 method. This attribute is REQUIRED. 957 The methods defined are: NONE, AES-128, and SAMPLE-AES. 959 An encryption method of NONE means that Media Segments are not 960 encrypted. If the encryption method is NONE, other attributes 961 MUST NOT be present. 963 An encryption method of AES-128 signals that Media Segments are 964 completely encrypted using the Advanced Encryption Standard (AES) 965 [AES_128] with a 128-bit key, Cipher Block Chaining (CBC), and 966 Public-Key Cryptography Standards #7 (PKCS7) padding [RFC5652]. 967 CBC is restarted on each segment boundary, using either the 968 Initialization Vector (IV) attribute value or the Media Sequence 969 Number as the IV; see Section 5.2. 971 An alternative to whole-segment encryption is Sample Encryption. 972 With Sample Encryption, only media sample data - such as audio 973 packets or video frames - is encrypted. The rest of the Media 974 Segment is unencrypted. Sample Encryption allows parts of the 975 Segment to be processed without (or before) decrypting the media 976 itself. 978 An encryption method of SAMPLE-AES means that the Media Segments 979 are Sample Encrypted using the Advanced Encryption Standard 981 [AES_128]. How these media streams are encrypted and encapsulated 982 in a segment depends on the media encoding and the media format of 983 the segment. fMP4 Media Segments are encrypted using the 'cbcs' 984 scheme of Common Encryption [COMMON_ENC]. Encryption of other 985 Media Segment formats containing H.264 [H_264], AAC [ISO_14496], 986 AC-3 [AC_3], and Enhanced AC-3 [AC_3] media streams is described 987 in the HTTP Live Streaming (HLS) Sample Encryption specification 988 [SampleEnc]. The IV attribute MAY be present; see Section 5.2. 990 URI 992 The value is a quoted-string containing a URI that specifies how 993 to obtain the key. This attribute is REQUIRED unless the METHOD 994 is NONE. 996 IV 998 The value is a hexadecimal-sequence that specifies a 128-bit 999 unsigned integer Initialization Vector to be used with the key. 1000 Use of the IV attribute REQUIRES a compatibility version number of 1001 2 or greater. See Section 5.2 for when the IV attribute is used. 1003 KEYFORMAT 1005 The value is a quoted-string that specifies how the key is 1006 represented in the resource identified by the URI; see Section 5 1007 for more detail. This attribute is OPTIONAL; its absence 1008 indicates an implicit value of "identity". Use of the KEYFORMAT 1009 attribute REQUIRES a compatibility version number of 5 or greater. 1011 KEYFORMATVERSIONS 1013 The value is a quoted-string containing one or more positive 1014 integers separated by the "/" character (for example, "1", "1/2", 1015 or "1/2/5"). If more than one version of a particular KEYFORMAT 1016 is defined, this attribute can be used to indicate which 1017 version(s) this instance complies with. This attribute is 1018 OPTIONAL; if it is not present, its value is considered to be "1". 1019 Use of the KEYFORMATVERSIONS attribute REQUIRES a compatibility 1020 version number of 5 or greater. 1022 If the Media Playlist file does not contain an EXT-X-KEY tag, then 1023 Media Segments are not encrypted. 1025 See Section 5 for the format of the Key file, and Section 5.2, 1026 Section 6.2.3, and Section 6.3.6 for additional information on Media 1027 Segment encryption. 1029 4.4.4.5. EXT-X-MAP 1031 The EXT-X-MAP tag specifies how to obtain the Media Initialization 1032 Section (Section 3) required to parse the applicable Media Segments. 1033 It applies to every Media Segment that appears after it in the 1034 Playlist until the next EXT-X-MAP tag or until the end of the 1035 Playlist. 1037 Its format is: 1039 #EXT-X-MAP:<attribute-list> 1041 The following attributes are defined: 1043 URI 1045 The value is a quoted-string containing a URI that identifies a 1046 resource that contains the Media Initialization Section. This 1047 attribute is REQUIRED. 1049 BYTERANGE 1051 The value is a quoted-string specifying a byte range into the 1052 resource identified by the URI attribute. This range SHOULD 1053 contain only the Media Initialization Section. The format of the 1054 byte range is described in Section 4.4.4.2. This attribute is 1055 OPTIONAL; if it is not present, the byte range is the entire 1056 resource indicated by the URI. 1058 An EXT-X-MAP tag SHOULD be supplied for Media Segments in Playlists 1059 with the EXT-X-I-FRAMES-ONLY tag when the first Media Segment (i.e., 1060 I-frame) in the Playlist (or the first segment following an EXT- 1061 X-DISCONTINUITY tag) does not immediately follow the Media 1062 Initialization Section at the beginning of its resource. 1064 Use of the EXT-X-MAP tag in a Media Playlist that contains the EXT- 1065 X-I-FRAMES-ONLY tag REQUIRES a compatibility version number of 5 or 1066 greater. Use of the EXT-X-MAP tag in a Media Playlist that DOES NOT 1067 contain the EXT-X-I-FRAMES-ONLY tag REQUIRES a compatibility version 1068 number of 6 or greater. 1070 If the Media Initialization Section declared by an EXT-X-MAP tag is 1071 encrypted with a METHOD of AES-128, the IV attribute of the EXT-X-KEY 1072 tag that applies to the EXT-X-MAP is REQUIRED. 1074 4.4.4.6. EXT-X-PROGRAM-DATE-TIME 1076 The EXT-X-PROGRAM-DATE-TIME tag associates the first sample of a 1077 Media Segment with an absolute date and/or time. It applies only to 1078 the next Media Segment. Its format is: 1080 #EXT-X-PROGRAM-DATE-TIME:<date-time-msec> 1082 where date-time-msec is an ISO/IEC 8601:2004 [ISO_8601] date/time 1083 representation, such as YYYY-MM-DDThh:mm:ss.SSSZ. It SHOULD indicate 1084 a time zone and fractional parts of seconds, to millisecond accuracy. 1086 For example: 1088 #EXT-X-PROGRAM-DATE-TIME:2010-02-19T14:54:23.031+08:00 1090 See Section 6.2.1 and Section 6.3.3 for more information on the EXT- 1091 X-PROGRAM-DATE-TIME tag. 1093 4.4.4.7. EXT-X-GAP 1095 The EXT-X-GAP tag indicates that the segment URL to which it applies 1096 does not contain media data and SHOULD NOT be loaded by clients. It 1097 applies only to the next Media Segment. 1099 Its format is: 1101 #EXT-X-GAP 1103 See Section 6.2.1 and Section 6.3.3 for more information on the EXT- 1104 X-GAP tag. 1106 4.4.4.8. EXT-X-BITRATE 1108 The EXT-X-BITRATE tag identifies the approximate segment bit rate of 1109 the Media Segment(s) to which it applies. It applies to every Media 1110 Segment between it and the next EXT-X-BITRATE tag in the Playlist 1111 file (or the end of the Playlist file) that does not have an EXT- 1112 X-BYTERANGE tag applied to it. Its format is: 1114 #EXT-X-BITRATE:<rate> 1116 where rate is a decimal-integer of kilobits per second. 1118 This tag is OPTIONAL. If it is present then its value MUST be no 1119 less than 90% of the segment bit rate of each Media Segment to which 1120 it is applied and no greater than 110% of the segment bit rate of 1121 each Media Segment to which it is applied. 1123 4.4.5. Media Metadata Tags 1125 Media Metadata tags provide information about the playlist that is 1126 not associated with specific Media Segments. There MAY be more than 1127 one Media Metadata tag of each type in any Media Playlist. 1129 4.4.5.1. EXT-X-DATERANGE 1131 The EXT-X-DATERANGE tag associates a Date Range (i.e., a range of 1132 time defined by a starting and ending date) with a set of attribute/ 1133 value pairs. Its format is: 1135 #EXT-X-DATERANGE:<attribute-list> 1137 where the defined attributes are: 1139 ID 1141 A quoted-string that uniquely identifies a Date Range in the 1142 Playlist. This attribute is REQUIRED. 1144 CLASS 1146 A client-defined quoted-string that specifies some set of 1147 attributes and their associated value semantics. All Date Ranges 1148 with the same CLASS attribute value MUST adhere to these 1149 semantics. This attribute is OPTIONAL. 1151 START-DATE 1153 A quoted-string containing the [ISO_8601] date/time at which the 1154 Date Range begins. This attribute is REQUIRED. 1156 END-DATE 1158 A quoted-string containing the [ISO_8601] date/time at which the 1159 Date Range ends. It MUST be equal to or later than the value of 1160 the START-DATE attribute. This attribute is OPTIONAL. 1162 DURATION 1164 The duration of the Date Range expressed as a decimal-floating- 1165 point number of seconds. It MUST NOT be negative. A single 1166 instant in time (e.g., crossing a finish line) SHOULD be 1167 represented with a duration of 0. This attribute is OPTIONAL. 1169 PLANNED-DURATION 1170 The expected duration of the Date Range expressed as a decimal- 1171 floating-point number of seconds. It MUST NOT be negative. This 1172 attribute SHOULD be used to indicate the expected duration of a 1173 Date Range whose actual duration is not yet known. It is 1174 OPTIONAL. 1176 X-<client-attribute> 1178 The "X-" prefix defines a namespace reserved for client-defined 1179 attributes. The client-attribute MUST be a legal AttributeName. 1180 Clients SHOULD use a reverse-DNS syntax when defining their own 1181 attribute names to avoid collisions. The attribute value MUST be 1182 a quoted-string, a hexadecimal-sequence, or a decimal-floating- 1183 point. An example of a client-defined attribute is X-COM-EXAMPLE- 1184 AD-ID="XYZ123". These attributes are OPTIONAL. 1186 SCTE35-CMD, SCTE35-OUT, SCTE35-IN 1188 Used to carry SCTE-35 data; see Section 4.4.5.1.1 for more 1189 information. These attributes are OPTIONAL. 1191 END-ON-NEXT 1193 An enumerated-string whose value MUST be YES. This attribute 1194 indicates that the end of the range containing it is equal to the 1195 START-DATE of its Following Range. The Following Range is the 1196 Date Range of the same CLASS that has the earliest START-DATE 1197 after the START-DATE of the range in question. This attribute is 1198 OPTIONAL. 1200 An EXT-X-DATERANGE tag with an END-ON-NEXT=YES attribute MUST have a 1201 CLASS attribute. Other EXT-X-DATERANGE tags with the same CLASS 1202 attribute MUST NOT specify Date Ranges that overlap. 1204 An EXT-X-DATERANGE tag with an END-ON-NEXT=YES attribute MUST NOT 1205 contain DURATION or END-DATE attributes. 1207 A Date Range with neither a DURATION, an END-DATE, nor an END-ON- 1208 NEXT=YES attribute has an unknown duration, even if it has a PLANNED- 1209 DURATION. 1211 If a Playlist contains an EXT-X-DATERANGE tag, it MUST also contain 1212 at least one EXT-X-PROGRAM-DATE-TIME tag. 1214 If a Playlist contains two EXT-X-DATERANGE tags with the same ID 1215 attribute value, then any AttributeName that appears in both tags 1216 MUST have the same AttributeValue. 1218 If a Date Range contains both a DURATION attribute and an END-DATE 1219 attribute, the value of the END-DATE attribute MUST be equal to the 1220 value of the START-DATE attribute plus the value of the DURATION 1221 attribute. 1223 Clients SHOULD ignore EXT-X-DATERANGE tags with illegal syntax. 1225 4.4.5.1.1. Mapping SCTE-35 into EXT-X-DATERANGE 1227 Splice information carried in source media according to the SCTE-35 1228 specification [SCTE35] MAY be represented in a Media Playlist using 1229 EXT-X-DATERANGE tags. 1231 Each SCTE-35 splice_info_section() containing a splice_null(), 1232 splice_schedule(), bandwidth_reservation(), or private_cmd() SHOULD 1233 be represented by an EXT-X-DATERANGE tag with an SCTE35-CMD attribute 1234 whose value is the big-endian binary representation of the 1235 splice_info_section(), expressed as a hexadecimal-sequence. 1237 An SCTE-35 splice out/in pair signaled by a pair of splice_insert() 1238 commands SHOULD be represented by one or more EXT-X-DATERANGE tags 1239 carrying the same ID attribute, which MUST be unique to that splice 1240 out/in pair. The "out" splice_info_section() (with 1241 out_of_network_indicator set to 1) MUST be placed in an SCTE35-OUT 1242 attribute, with the same formatting as SCTE35-CMD. The "in" 1243 splice_info_section() (with out_of_network_indicator set to 0) MUST 1244 be placed in an SCTE35-IN attribute, with the same formatting as 1245 SCTE35-CMD. 1247 An SCTE-35 splice out/in pair signaled by a pair of time_signal() 1248 commands, each carrying a single segmentation_descriptor(), SHOULD be 1249 represented by one or more EXT-X-DATERANGE tags carrying the same ID 1250 attribute, which MUST be unique to that splice out/in pair. The 1251 "out" splice_info_section() MUST be placed in an SCTE35-OUT 1252 attribute; the "in" splice_info_section() MUST be placed in an 1253 SCTE35-IN attribute. 1255 Different types of segmentation, as indicated by the 1256 segmentation_type_id in the segmentation_descriptor(), SHOULD be 1257 represented by separate EXT-X-DATERANGE tags, even if two or more 1258 segmentation_descriptor()s arrive in the same splice_info_section(). 1259 In that case, each EXT-X-DATERANGE tag will have an SCTE35-OUT, 1260 SCTE35-IN, or SCTE35-CMD attribute whose value is the entire 1261 splice_info_section(). 1263 An SCTE-35 time_signal() command that does not signal a splice out or 1264 in point SHOULD be represented by an EXT-X-DATERANGE tag with an 1265 SCTE35-CMD attribute. 1267 The START-DATE of an EXT-X-DATERANGE tag containing an SCTE35-OUT 1268 attribute MUST be the date and time that corresponds to the program 1269 time of that splice. 1271 The START-DATE of an EXT-X-DATERANGE tag containing an SCTE35-CMD 1272 MUST be the date and time specified by the splice_time() in the 1273 command or the program time at which the command appeared in the 1274 source stream if the command does not specify a splice_time(). 1276 An EXT-X-DATERANGE tag containing an SCTE35-OUT attribute MAY contain 1277 a PLANNED-DURATION attribute. Its value MUST be the planned duration 1278 of the splice. 1280 The DURATION of an EXT-X-DATERANGE tag containing an SCTE35-IN 1281 attribute MUST be the actual (not planned) program duration between 1282 the corresponding out-point and that in-point. 1284 The END-DATE of an EXT-X-DATERANGE tag containing an SCTE35-IN 1285 attribute MUST be the actual (not planned) program date and time of 1286 that in-point. 1288 If the actual end date and time is not known when an SCTE35-OUT 1289 attribute is added to the Playlist, the DURATION attribute and the 1290 END-TIME attribute MUST NOT be present; the actual end date of the 1291 splice SHOULD be signaled by another EXT-X-DATERANGE tag once it has 1292 been established. 1294 A canceled splice SHOULD NOT appear in the Playlist as an EXT- 1295 X-DATERANGE tag. 1297 An EXT-X-DATERANGE tag announcing a splice SHOULD be added to a 1298 Playlist at the same time as the last pre-splice Media Segment, or 1299 earlier if possible. 1301 The ID attribute of an EXT-X-DATERANGE tag MAY contain a 1302 splice_event_id and/or a segmentation_event_id, but it MUST be unique 1303 in the Playlist. If there is a possibility that an SCTE-35 id will 1304 be reused, the ID attribute value MUST include disambiguation, such 1305 as a date or sequence number. 1307 4.4.6. Master Playlist Tags 1309 Master Playlist tags define the Variant Streams, Renditions, and 1310 other global parameters of the presentation. 1312 Master Playlist tags MUST NOT appear in a Media Playlist; clients 1313 MUST fail to parse any Playlist that contains both a Master Playlist 1314 tag and either a Media Playlist tag or a Media Segment tag. 1316 4.4.6.1. EXT-X-MEDIA 1318 The EXT-X-MEDIA tag is used to relate Media Playlists that contain 1319 alternative Renditions (Section 4.4.6.2.1) of the same content. For 1320 example, three EXT-X-MEDIA tags can be used to identify audio-only 1321 Media Playlists that contain English, French, and Spanish Renditions 1322 of the same presentation. Or, two EXT-X-MEDIA tags can be used to 1323 identify video-only Media Playlists that show two different camera 1324 angles. 1326 Its format is: 1328 #EXT-X-MEDIA:<attribute-list> 1330 The following attributes are defined: 1332 TYPE 1334 The value is an enumerated-string; valid strings are AUDIO, VIDEO, 1335 SUBTITLES, and CLOSED-CAPTIONS. This attribute is REQUIRED. 1337 Typically, closed-caption [CEA608] media is carried in the video 1338 stream. Therefore, an EXT-X-MEDIA tag with TYPE of CLOSED- 1339 CAPTIONS does not specify a Rendition; the closed-caption media is 1340 present in the Media Segments of every video Rendition. 1342 URI 1344 The value is a quoted-string containing a URI that identifies the 1345 Media Playlist file. This attribute is OPTIONAL; see 1346 Section 4.4.6.2.1. If the TYPE is CLOSED-CAPTIONS, the URI 1347 attribute MUST NOT be present. 1349 GROUP-ID 1351 The value is a quoted-string that specifies the group to which the 1352 Rendition belongs. See Section 4.4.6.1.1. This attribute is 1353 REQUIRED. 1355 LANGUAGE 1357 The value is a quoted-string containing one of the standard Tags 1358 for Identifying Languages [RFC5646], which identifies the primary 1359 language used in the Rendition. This attribute is OPTIONAL. 1361 ASSOC-LANGUAGE 1362 The value is a quoted-string containing a language tag [RFC5646] 1363 that identifies a language that is associated with the Rendition. 1364 An associated language is often used in a different role than the 1365 language specified by the LANGUAGE attribute (e.g., written versus 1366 spoken, or a fallback dialect). This attribute is OPTIONAL. 1368 The LANGUAGE and ASSOC-LANGUAGE attributes can be used, for 1369 example, to link Norwegian Renditions that use different spoken 1370 and written languages. 1372 NAME 1374 The value is a quoted-string containing a human-readable 1375 description of the Rendition. If the LANGUAGE attribute is 1376 present, then this description SHOULD be in that language. This 1377 attribute is REQUIRED. 1379 DEFAULT 1381 The value is an enumerated-string; valid strings are YES and NO. 1382 If the value is YES, then the client SHOULD play this Rendition of 1383 the content in the absence of information from the user indicating 1384 a different choice. This attribute is OPTIONAL. Its absence 1385 indicates an implicit value of NO. 1387 AUTOSELECT 1389 The value is an enumerated-string; valid strings are YES and NO. 1390 This attribute is OPTIONAL. Its absence indicates an implicit 1391 value of NO. If the value is YES, then the client MAY choose to 1392 play this Rendition in the absence of explicit user preference 1393 because it matches the current playback environment, such as 1394 chosen system language. 1396 If the AUTOSELECT attribute is present, its value MUST be YES if 1397 the value of the DEFAULT attribute is YES. 1399 FORCED 1401 The value is an enumerated-string; valid strings are YES and NO. 1402 This attribute is OPTIONAL. Its absence indicates an implicit 1403 value of NO. The FORCED attribute MUST NOT be present unless the 1404 TYPE is SUBTITLES. 1406 A value of YES indicates that the Rendition contains content that 1407 is considered essential to play. When selecting a FORCED 1408 Rendition, a client SHOULD choose the one that best matches the 1409 current playback environment (e.g., language). 1411 A value of NO indicates that the Rendition contains content that 1412 is intended to be played in response to explicit user request. 1414 INSTREAM-ID 1416 The value is a quoted-string that specifies a Rendition within the 1417 segments in the Media Playlist. This attribute is REQUIRED if the 1418 TYPE attribute is CLOSED-CAPTIONS, in which case it MUST have one 1419 of the values: "CC1", "CC2", "CC3", "CC4", or "SERVICEn" where n 1420 MUST be an integer between 1 and 63 (e.g., "SERVICE9" or 1421 "SERVICE42"). 1423 The values "CC1", "CC2", "CC3", and "CC4" identify a Line 21 Data 1424 Services channel [CEA608]. The "SERVICE" values identify a 1425 Digital Television Closed Captioning [CEA708] service block 1426 number. 1428 For all other TYPE values, the INSTREAM-ID MUST NOT be specified. 1430 CHARACTERISTICS 1432 The value is a quoted-string containing one or more Uniform Type 1433 Identifiers [UTI] separated by comma (,) characters. This 1434 attribute is OPTIONAL. Each UTI indicates an individual 1435 characteristic of the Rendition. 1437 A SUBTITLES Rendition MAY include the following characteristics: 1438 "public.accessibility.transcribes-spoken-dialog", 1439 "public.accessibility.describes-music-and-sound", and 1440 "public.easy-to-read" (which indicates that the subtitles have 1441 been edited for ease of reading). 1443 An AUDIO Rendition MAY include the following characteristic: 1444 "public.accessibility.describes-video". 1446 The CHARACTERISTICS attribute MAY include private UTIs. 1448 CHANNELS 1450 The value is a quoted-string that specifies an ordered, slash- 1451 separated ("/") list of parameters. 1453 If the TYPE attribute is AUDIO, then the first parameter is a 1454 count of audio channels expressed as a decimal-integer, indicating 1455 the maximum number of independent, simultaneous audio channels 1456 present in any Media Segment in the Rendition. For example, an 1457 AC-3 5.1 Rendition would have a CHANNELS="6" attribute. 1459 If the TYPE attribute is AUDIO, then the second parameter 1460 identifies the encoding of object-based audio used by the 1461 Rendition. This parameter is a comma-separated list of Audio 1462 Object Coding Identifiers. It is optional. An Audio Object 1463 Coding Identifier is a string containing characters from the set 1464 [A..Z], [0..9], and '-'. They are codec-specific. A parameter 1465 value of consisting solely of the dash character (0x2D) indicates 1466 that the audio is not object-based. 1468 No other CHANNELS parameters are currently defined. 1470 All audio EXT-X-MEDIA tags SHOULD have a CHANNELS attribute. If a 1471 Master Playlist contains two Renditions with the same NAME encoded 1472 with the same codec but a different number of channels, then the 1473 CHANNELS attribute is REQUIRED; otherwise, it is OPTIONAL. 1475 4.4.6.1.1. Rendition Groups 1477 A set of one or more EXT-X-MEDIA tags with the same GROUP-ID value 1478 and the same TYPE value defines a Group of Renditions. Each member 1479 of the Group MUST be an alternative Rendition of the same content; 1480 otherwise, playback errors can occur. 1482 All EXT-X-MEDIA tags in a Playlist MUST meet the following 1483 constraints: 1485 o All EXT-X-MEDIA tags in the same Group MUST have different NAME 1486 attributes. 1488 o A Group MUST NOT have more than one member with a DEFAULT 1489 attribute of YES. 1491 o Each EXT-X-MEDIA tag with an AUTOSELECT=YES attribute SHOULD have 1492 a combination of LANGUAGE [RFC5646], ASSOC-LANGUAGE, FORCED, and 1493 CHARACTERISTICS attributes that is distinct from those of other 1494 AUTOSELECT=YES members of its Group. 1496 A Playlist MAY contain multiple Groups of the same TYPE in order to 1497 provide multiple encodings of that media type. If it does so, each 1498 Group of the same TYPE MUST have the same set of members, and each 1499 corresponding member MUST have identical attributes with the 1500 exception of the URI and CHANNELS attributes. 1502 Each member in a Group of Renditions MAY have a different sample 1503 format. For example, an English Rendition can be encoded with AC-3 1504 5.1 while a Spanish Rendition is encoded with AAC stereo. However, 1505 any EXT-X-STREAM-INF tag (Section 4.4.6.2) or EXT-X-I-FRAME-STREAM- 1506 INF tag (Section 4.4.6.3) that references such a Group MUST have a 1507 CODECS attribute that lists every sample format present in any 1508 Rendition in the Group, or client playback failures can occur. In 1509 the example above, the CODECS attribute would include 1510 "ac-3,mp4a.40.2". 1512 4.4.6.2. EXT-X-STREAM-INF 1514 The EXT-X-STREAM-INF tag specifies a Variant Stream, which is a set 1515 of Renditions that can be combined to play the presentation. The 1516 attributes of the tag provide information about the Variant Stream. 1518 The URI line that follows the EXT-X-STREAM-INF tag specifies a Media 1519 Playlist that carries a Rendition of the Variant Stream. The URI 1520 line is REQUIRED. Clients that do not support multiple video 1521 Renditions SHOULD play this Rendition. 1523 Its format is: 1525 #EXT-X-STREAM-INF:<attribute-list> 1526 <URI> 1528 The following attributes are defined: 1530 BANDWIDTH 1532 The value is a decimal-integer of bits per second. It represents 1533 the peak segment bit rate of the Variant Stream. 1535 If all the Media Segments in a Variant Stream have already been 1536 created, the BANDWIDTH value MUST be the largest sum of peak 1537 segment bit rates that is produced by any playable combination of 1538 Renditions. (For a Variant Stream with a single Media Playlist, 1539 this is just the peak segment bit rate of that Media Playlist.) 1540 An inaccurate value can cause playback stalls or prevent clients 1541 from playing the variant. 1543 If the Master Playlist is to be made available before all Media 1544 Segments in the presentation have been encoded, the BANDWIDTH 1545 value SHOULD be the BANDWIDTH value of a representative period of 1546 similar content, encoded using the same settings. 1548 Every EXT-X-STREAM-INF tag MUST include the BANDWIDTH attribute. 1550 AVERAGE-BANDWIDTH 1552 The value is a decimal-integer of bits per second. It represents 1553 the average segment bit rate of the Variant Stream. 1555 If all the Media Segments in a Variant Stream have already been 1556 created, the AVERAGE-BANDWIDTH value MUST be the largest sum of 1557 average segment bit rates that is produced by any playable 1558 combination of Renditions. (For a Variant Stream with a single 1559 Media Playlist, this is just the average segment bit rate of that 1560 Media Playlist.) An inaccurate value can cause playback stalls or 1561 prevent clients from playing the variant. 1563 If the Master Playlist is to be made available before all Media 1564 Segments in the presentation have been encoded, the AVERAGE- 1565 BANDWIDTH value SHOULD be the AVERAGE-BANDWIDTH value of a 1566 representative period of similar content, encoded using the same 1567 settings. 1569 The AVERAGE-BANDWIDTH attribute is OPTIONAL. 1571 CODECS 1573 The value is a quoted-string containing a comma-separated list of 1574 formats, where each format specifies a media sample type that is 1575 present in one or more Renditions specified by the Variant Stream. 1576 Valid format identifiers are those in the ISO Base Media File 1577 Format Name Space defined by "The 'Codecs' and 'Profiles' 1578 Parameters for "Bucket" Media Types" [RFC6381]. 1580 For example, a stream containing AAC low complexity (AAC-LC) audio 1581 and H.264 Main Profile Level 3.0 video would have a CODECS value 1582 of "mp4a.40.2,avc1.4d401e". 1584 Note that if a Variant Stream specifies one or more Renditions 1585 that include IMSC subtitles, the CODECS attribute MUST indicate 1586 this with a format identifier such as "stpp.ttml.im1t". 1588 Every EXT-X-STREAM-INF tag SHOULD include a CODECS attribute. 1590 RESOLUTION 1592 The value is a decimal-resolution describing the optimal pixel 1593 resolution at which to display all the video in the Variant 1594 Stream. 1596 The RESOLUTION attribute is OPTIONAL but is recommended if the 1597 Variant Stream includes video. 1599 FRAME-RATE 1600 The value is a decimal-floating-point describing the maximum frame 1601 rate for all the video in the Variant Stream, rounded to three 1602 decimal places. 1604 The FRAME-RATE attribute is OPTIONAL but is recommended if the 1605 Variant Stream includes video. The FRAME-RATE attribute SHOULD be 1606 included if any video in a Variant Stream exceeds 30 frames per 1607 second. 1609 HDCP-LEVEL 1611 The value is an enumerated-string; valid strings are TYPE-0, TYPE- 1612 1, and NONE. This attribute is advisory. A value of TYPE-0 1613 indicates that the Variant Stream could fail to play unless the 1614 output is protected by High-bandwidth Digital Content Protection 1615 (HDCP) Type 0 [HDCP] or equivalent. A value of TYPE-1 indicates 1616 that the Variant Stream could fail to play unless the output is 1617 protected by HDCP Type 1 or equivalent. A value of NONE indicates 1618 that the content does not require output copy protection. 1620 Encrypted Variant Streams with different HDCP levels SHOULD use 1621 different media encryption keys. 1623 The HDCP-LEVEL attribute is OPTIONAL. It SHOULD be present if any 1624 content in the Variant Stream will fail to play without HDCP. 1625 Clients without output copy protection SHOULD NOT load a Variant 1626 Stream with an HDCP-LEVEL attribute unless its value is NONE. 1628 ALLOWED-CPC 1630 The ALLOWED-CPC attribute allows a server to indicate that the 1631 playback of a Variant Stream containing encrypted Media Segments 1632 is to be restricted to devices that guarantee a certain level of 1633 content protection robustness. Its value is a quoted-string 1634 containing a comma-separated list of entries. Each entry consists 1635 of a KEYFORMAT attribute value followed by a colon character (:) 1636 followed by a sequence of Content Protection Configuration (CPC) 1637 Labels separated by slash (/) characters. Each CPC Label is a 1638 string containing characters from the set [A..Z], [0..9], and '-'. 1640 For example: ALLOWED-CPC="com.example.drm1:SMART-TV/PC, 1641 com.example.drm2:HW" 1643 A CPC Label identifies a class of playback device that implements 1644 the KEYFORMAT with a certain level of content protection 1645 robustness. Each KEYFORMAT can define its own set of CPC Labels. 1646 The "identity" KEYFORMAT does not define any labels. A KEYFORMAT 1647 that defines CPC Labels SHOULD also specify its robustness 1648 requirements in a secure manner in each key response. 1650 A client MAY play the Variant Stream if it implements one of the 1651 listed KEYFORMAT schemes with content protection robustness that 1652 matches one or more of the CPC Labels in the list. If it does not 1653 match any of the CPC Labels then it SHOULD NOT attempt to play the 1654 Variant Stream. 1656 The ALLOWED-CPC attribute is OPTIONAL. If it is not present or 1657 does not contain a particular KEYFORMAT then all clients that 1658 support that KEYFORMAT MAY play the Variant Stream. 1660 VIDEO-RANGE 1662 The value is an enumerated-string; valid strings are SDR and PQ. 1664 The value MUST be SDR if all the video in the Variant Stream is 1665 encoded using a reference opto-electronic transfer characteristic 1666 function specified by the TransferCharacteristics code point 1 1667 [CICP]. 1669 The value MUST be PQ if video in the Variant Stream includes some 1670 content that is encoded using a reference opto-electronic transfer 1671 characteristic function specified by the TransferCharacteristics 1672 code point 16 or 18, and potentially other content qualifying as 1673 SDR (see above). Note that certain TransferCharacteristics code 1674 points use the same transfer function. 1676 Otherwise the attribute MUST NOT be present. 1678 AUDIO 1680 The value is a quoted-string. It MUST match the value of the 1681 GROUP-ID attribute of an EXT-X-MEDIA tag elsewhere in the Master 1682 Playlist whose TYPE attribute is AUDIO. It indicates the set of 1683 audio Renditions that SHOULD be used when playing the 1684 presentation. See Section 4.4.6.2.1. 1686 The AUDIO attribute is OPTIONAL. 1688 VIDEO 1690 The value is a quoted-string. It MUST match the value of the 1691 GROUP-ID attribute of an EXT-X-MEDIA tag elsewhere in the Master 1692 Playlist whose TYPE attribute is VIDEO. It indicates the set of 1693 video Renditions that SHOULD be used when playing the 1694 presentation. See Section 4.4.6.2.1. 1696 The VIDEO attribute is OPTIONAL. 1698 SUBTITLES 1700 The value is a quoted-string. It MUST match the value of the 1701 GROUP-ID attribute of an EXT-X-MEDIA tag elsewhere in the Master 1702 Playlist whose TYPE attribute is SUBTITLES. It indicates the set 1703 of subtitle Renditions that can be used when playing the 1704 presentation. See Section 4.4.6.2.1. 1706 The SUBTITLES attribute is OPTIONAL. 1708 CLOSED-CAPTIONS 1710 The value can be either a quoted-string or an enumerated-string 1711 with the value NONE. If the value is a quoted-string, it MUST 1712 match the value of the GROUP-ID attribute of an EXT-X-MEDIA tag 1713 elsewhere in the Playlist whose TYPE attribute is CLOSED-CAPTIONS, 1714 and it indicates the set of closed-caption Renditions that can be 1715 used when playing the presentation. See Section 4.4.6.2.1. 1717 If the value is the enumerated-string value NONE, all EXT-X- 1718 STREAM-INF tags MUST have this attribute with a value of NONE, 1719 indicating that there are no closed captions in any Variant Stream 1720 in the Master Playlist. Having closed captions in one Variant 1721 Stream but not another can trigger playback inconsistencies. 1723 The CLOSED-CAPTIONS attribute is OPTIONAL. 1725 4.4.6.2.1. Alternative Renditions 1727 When an EXT-X-STREAM-INF tag contains an AUDIO, VIDEO, SUBTITLES, or 1728 CLOSED-CAPTIONS attribute, it indicates that alternative Renditions 1729 of the content are available for playback of that Variant Stream. 1731 When defining alternative Renditions, the following constraints MUST 1732 be met to prevent client playback errors: 1734 o All playable combinations of Renditions associated with an EXT-X- 1735 STREAM-INF tag MUST have an aggregate bandwidth less than or equal 1736 to the BANDWIDTH attribute of the EXT-X-STREAM-INF tag. 1738 o If an EXT-X-STREAM-INF tag contains a RESOLUTION attribute and a 1739 VIDEO attribute, then every alternative video Rendition MUST have 1740 an optimal display resolution matching the value of the RESOLUTION 1741 attribute. 1743 o Every alternative Rendition associated with an EXT-X-STREAM-INF 1744 tag MUST meet the constraints for a Variant Stream described in 1745 Section 6.2.4. 1747 The URI attribute of the EXT-X-MEDIA tag is REQUIRED if the media 1748 type is SUBTITLES, but OPTIONAL if the media type is VIDEO or AUDIO. 1749 If the media type is VIDEO or AUDIO, a missing URI attribute 1750 indicates that the media data for this Rendition is included in the 1751 Media Playlist of any EXT-X-STREAM-INF tag referencing this EXT- 1752 X-MEDIA tag. If the media TYPE is AUDIO and the URI attribute is 1753 missing, clients MUST assume that the audio data for this Rendition 1754 is present in every video Rendition specified by the EXT-X-STREAM-INF 1755 tag. 1757 The URI attribute of the EXT-X-MEDIA tag MUST NOT be included if the 1758 media type is CLOSED-CAPTIONS. 1760 4.4.6.3. EXT-X-I-FRAME-STREAM-INF 1762 The EXT-X-I-FRAME-STREAM-INF tag identifies a Media Playlist file 1763 containing the I-frames of a multimedia presentation. It stands 1764 alone, in that it does not apply to a particular URI in the Master 1765 Playlist. Its format is: 1767 #EXT-X-I-FRAME-STREAM-INF:<attribute-list> 1769 All attributes defined for the EXT-X-STREAM-INF tag (Section 4.4.6.2) 1770 are also defined for the EXT-X-I-FRAME-STREAM-INF tag, except for the 1771 FRAME-RATE, AUDIO, SUBTITLES, and CLOSED-CAPTIONS attributes. In 1772 addition, the following attribute is defined: 1774 URI 1776 The value is a quoted-string containing a URI that identifies the 1777 I-frame Media Playlist file. That Playlist file MUST contain an 1778 EXT-X-I-FRAMES-ONLY tag. 1780 Every EXT-X-I-FRAME-STREAM-INF tag MUST include a BANDWIDTH attribute 1781 and a URI attribute. 1783 The provisions in Section 4.4.6.2.1 also apply to EXT-X-I-FRAME- 1784 STREAM-INF tags with a VIDEO attribute. 1786 A Master Playlist that specifies alternative VIDEO Renditions and 1787 I-frame Playlists SHOULD include an alternative I-frame VIDEO 1788 Rendition for each regular VIDEO Rendition, with the same NAME and 1789 LANGUAGE attributes. 1791 4.4.6.4. EXT-X-SESSION-DATA 1793 The EXT-X-SESSION-DATA tag allows arbitrary session data to be 1794 carried in a Master Playlist. 1796 Its format is: 1798 #EXT-X-SESSION-DATA:<attribute-list> 1800 The following attributes are defined: 1802 DATA-ID 1804 The value of DATA-ID is a quoted-string that identifies a 1805 particular data value. The DATA-ID SHOULD conform to a reverse 1806 DNS naming convention, such as "com.example.movie.title"; however, 1807 there is no central registration authority, so Playlist authors 1808 SHOULD take care to choose a value that is unlikely to collide 1809 with others. This attribute is REQUIRED. 1811 VALUE 1813 VALUE is a quoted-string. It contains the data identified by 1814 DATA-ID. If the LANGUAGE is specified, VALUE SHOULD contain a 1815 human-readable string written in the specified language. 1817 URI 1819 The value is a quoted-string containing a URI. The resource 1820 identified by the URI MUST be formatted as JSON [RFC8259]; 1821 otherwise, clients may fail to interpret the resource. 1823 LANGUAGE 1825 The value is a quoted-string containing a language tag [RFC5646] 1826 that identifies the language of the VALUE. This attribute is 1827 OPTIONAL. 1829 Each EXT-X-SESSION-DATA tag MUST contain either a VALUE or URI 1830 attribute, but not both. 1832 A Playlist MAY contain multiple EXT-X-SESSION-DATA tags with the same 1833 DATA-ID attribute. A Playlist MUST NOT contain more than one EXT-X- 1834 SESSION-DATA tag with the same DATA-ID attribute and the same 1835 LANGUAGE attribute. 1837 4.4.6.5. EXT-X-SESSION-KEY 1839 The EXT-X-SESSION-KEY tag allows encryption keys from Media Playlists 1840 to be specified in a Master Playlist. This allows the client to 1841 preload these keys without having to read the Media Playlist(s) 1842 first. 1844 Its format is: 1846 #EXT-X-SESSION-KEY:<attribute-list> 1848 All attributes defined for the EXT-X-KEY tag (Section 4.4.4.4) are 1849 also defined for the EXT-X-SESSION-KEY, except that the value of the 1850 METHOD attribute MUST NOT be NONE. If an EXT-X-SESSION-KEY is used, 1851 the values of the METHOD, KEYFORMAT, and KEYFORMATVERSIONS attributes 1852 MUST match any EXT-X-KEY with the same URI value. 1854 EXT-X-SESSION-KEY tags SHOULD be added if multiple Variant Streams or 1855 Renditions use the same encryption keys and formats. An EXT-X- 1856 SESSION-KEY tag is not associated with any particular Media Playlist. 1858 A Master Playlist MUST NOT contain more than one EXT-X-SESSION-KEY 1859 tag with the same METHOD, URI, IV, KEYFORMAT, and KEYFORMATVERSIONS 1860 attribute values. 1862 The EXT-X-SESSION-KEY tag is optional. 1864 5. Key Files 1866 5.1. Structure of Key Files 1868 An EXT-X-KEY tag with a URI attribute identifies a Key file. A Key 1869 file contains a cipher key that can decrypt Media Segments in the 1870 Playlist. 1872 [AES_128] encryption uses 16-octet keys. If the KEYFORMAT of an EXT- 1873 X-KEY tag is "identity", the Key file is a single packed array of 16 1874 octets in binary format. 1876 5.2. IV for AES-128 1878 [AES_128] REQUIRES the same 16-octet IV to be supplied when 1879 encrypting and decrypting. Varying this IV increases the strength of 1880 the cipher. 1882 An IV attribute on an EXT-X-KEY tag with a KEYFORMAT of "identity" 1883 specifies an IV that can be used when decrypting Media Segments 1884 encrypted with that Key file. IV values for AES-128 are 128-bit 1885 numbers. 1887 An EXT-X-KEY tag with a KEYFORMAT of "identity" that does not have an 1888 IV attribute indicates that the Media Sequence Number is to be used 1889 as the IV when decrypting a Media Segment, by putting its big-endian 1890 binary representation into a 16-octet (128-bit) buffer and padding 1891 (on the left) with zeros. 1893 6. Client/Server Responsibilities 1895 6.1. Introduction 1897 This section describes how the server generates the Playlist and 1898 Media Segments and how the client should download them for playback. 1900 6.2. Server Responsibilities 1902 6.2.1. General Server Responsibilities 1904 The production of the source media is outside the scope of this 1905 document, which simply presumes a source of continuous encoded media 1906 containing the presentation. 1908 The server MUST divide the source media into individual Media 1909 Segments whose duration (when rounded to a whole second) is less than 1910 or equal to the Target Duration. Segments longer than that can 1911 trigger playback stalls and other errors. 1913 The server SHOULD attempt to divide the source media at points that 1914 support effective decode of individual Media Segments, such as on 1915 packet and key frame boundaries. 1917 The server MUST create a URI for every Media Segment that enables its 1918 clients to obtain the segment data. If a server supports partial 1919 loading of resources (e.g., via HTTP Range requests), it MAY specify 1920 segments as sub-ranges of larger resources using the EXT-X-BYTERANGE 1921 tag. 1923 The absence of media data (due to, for example, the temporary 1924 unavailability of an encoder) SHOULD be signaled by adding one or 1925 more Media Segments to the Playlist whose Segment durations add up to 1926 the duration of absent media; these Media Segments MUST have EXT- 1927 X-GAP tags applied to them. Attempting to download these segments 1928 MAY produce an error, such as HTTP 404 or 410. 1930 A Media Segment MUST be available for immediate download at the full 1931 speed of the link to the Client when it is added to a Playlist unless 1932 it has been marked with an EXT-X-GAP tag; otherwise playback errors 1933 can occur. Once download starts, its transfer rate SHOULD NOT be 1934 constrained by the segment production process. 1936 HTTP servers SHOULD transfer text files -- such as Playlists and 1937 WebVTT segments -- using the "gzip" Content-Encoding if the client 1938 indicates that it is prepared to accept it. 1940 The server must create a Media Playlist file (Section 4) that 1941 contains a URI for each Media Segment that the server wishes to make 1942 available, in the order in which they are to be played. 1944 The value of the EXT-X-VERSION tag (Section 4.4.1.2) SHOULD NOT be 1945 greater than what is required for the tags and attributes in the 1946 Playlist (see Section 7). 1948 Changes to the Playlist file MUST be made atomically from the point 1949 of view of the clients, or playback errors MAY occur. 1951 The server MUST NOT change the Media Playlist file, except to: 1953 Append lines to it (Section 6.2.1). 1955 Remove Media Segment URIs from the Playlist in the order that they 1956 appear, along with any tags that apply only to those segments 1957 (Section 6.2.2). 1959 Remove Media Metadata tags that no longer apply to the 1960 presentation (Section 6.2.1). 1962 Increment the value of the EXT-X-MEDIA-SEQUENCE or EXT-X- 1963 DISCONTINUITY-SEQUENCE tags (Section 6.2.2). 1965 Add an EXT-X-ENDLIST tag to the Playlist (Section 6.2.1). 1967 A Media Playlist has further constraints on its updates if it 1968 contains an EXT-X-PLAYLIST-TYPE tag. An EXT-X-PLAYLIST-TYPE tag with 1969 a value of VOD indicates that the Playlist file MUST NOT change. An 1970 EXT-X-PLAYLIST-TYPE tag with a value of EVENT indicates that the 1971 Server MUST NOT change or remove any part of the Playlist file, with 1972 the exception of Media Metadata tags as described above; the Server 1973 MAY append lines to the Playlist. 1975 The value of the EXT-X-TARGETDURATION tag in the Media Playlist MUST 1976 NOT change. A typical Target Duration is 6 seconds. 1978 Playlist changes other than those allowed here can trigger playback 1979 errors and inconsistent client behavior. 1981 Each Media Segment in a Media Playlist has an integer Discontinuity 1982 Sequence Number. The Discontinuity Sequence Number can be used in 1983 addition to the timestamps within the media to synchronize Media 1984 Segments across different Renditions. 1986 A segment's Discontinuity Sequence Number is the value of the EXT-X- 1987 DISCONTINUITY-SEQUENCE tag (or zero if none) plus the number of EXT- 1988 X-DISCONTINUITY tags in the Playlist preceding the URI line of the 1989 segment. 1991 The server MAY associate an absolute date and time with a Media 1992 Segment by applying an EXT-X-PROGRAM-DATE-TIME tag to it. This 1993 defines an informative mapping of the (wall-clock) date and time 1994 specified by the tag to the first media timestamp in the segment, 1995 which may be used as a basis for seeking, for display, or for other 1996 purposes. If a server provides this mapping, it SHOULD apply an EXT- 1997 X-PROGRAM-DATE-TIME tag to every segment that has an EXT- 1998 X-DISCONTINUITY tag applied to it. 2000 The Server MUST NOT add any EXT-X-PROGRAM-DATE-TIME tag to a Playlist 2001 that would cause the mapping between program date and Media Segment 2002 to become ambiguous. 2004 The server MUST NOT remove an EXT-X-DATERANGE tag from a Playlist if 2005 any date in the range maps to a Media Segment in the Playlist. 2007 The server MUST NOT reuse the ID attribute value of an EXT- 2008 X-DATERANGE tag for any new Date Range in the same Playlist. 2010 Once the Following Range of a Date Range with an END-ON-NEXT=YES 2011 attribute is added to a Playlist, the Server MUST NOT subsequently 2012 add a Date Range with the same CLASS attribute whose START-DATE is 2013 between that of the END-ON-NEXT=YES range and its Following Range. 2015 For Date Ranges with a PLANNED-DURATION attribute, the Server SHOULD 2016 signal the actual end of the range once it has been established. It 2017 can do so by adding another EXT-X-DATERANGE tag with the same ID 2018 attribute value and either a DURATION or an END-DATE attribute or, if 2019 the Date Range has an END-ON-NEXT=YES attribute, by adding a 2020 Following Range. 2022 If the Media Playlist contains the final Media Segment of the 2023 presentation, then the Playlist file MUST contain the EXT-X-ENDLIST 2024 tag; this allows clients to minimize unproductive Playlist reloads. 2026 If a Media Playlist does not contain the EXT-X-ENDLIST tag, the 2027 server MUST make a new version of the Playlist file available that 2028 contains at least one new Media Segment. It MUST be made available 2029 no later than 1.5 times the Target Duration after the previous time 2030 the Playlist was updated with a Media Segment. This allows clients 2031 to utilize the network efficiently. 2033 If the server wishes to remove an entire presentation, it SHOULD 2034 provide a clear indication to clients that the Playlist file is no 2035 longer available (e.g., with an HTTP 404 or 410 response). It MUST 2036 ensure that all Media Segments in the Playlist file remain available 2037 to clients for at least the duration of the Playlist file at the time 2038 of removal to prevent interruption of in-progress playback. 2040 6.2.2. Live Playlists 2042 The server MAY limit the availability of Media Segments by removing 2043 Media Segments from the Playlist file (Section 6.2.1). If Media 2044 Segments are to be removed, the Playlist file MUST contain an EXT-X- 2045 MEDIA-SEQUENCE tag. Its value MUST be incremented by 1 for every 2046 Media Segment that is removed from the Playlist file; it MUST NOT 2047 decrease or wrap. Clients can malfunction if each Media Segment does 2048 not have a consistent, unique Media Sequence Number. 2050 Media Segments MUST be removed from the Playlist file in the order 2051 that they appear in the Playlist; otherwise, client playback can 2052 malfunction. 2054 The server MUST NOT remove a Media Segment from a Playlist file 2055 without an EXT-X-ENDLIST tag if that would produce a Playlist whose 2056 duration is less than three times the Target Duration. Doing so can 2057 trigger playback stalls. 2059 The Availability Duration of a Media Segment is the duration of the 2060 segment plus the duration of the longest-duration Playlist 2061 distributed by the server containing that segment. If the server 2062 removes a Media Segment URI from a Playlist that contains an EXT- 2063 X-ENDLIST tag, clients MUST be able to download the corresponding 2064 Media Segment until the time of removal plus the segment's 2065 Availability Duration. If the server removes a Media Segment URI 2066 from a Playlist that does not contain an EXT-X-ENDLIST tag, clients 2067 MUST be able to download the segment until the time at which it first 2068 appeared in the Playlist plus the segment's Availability Duration. 2070 If the server wishes to remove segments from a Media Playlist 2071 containing an EXT-X-DISCONTINUITY tag, the Media Playlist MUST 2072 contain an EXT-X-DISCONTINUITY-SEQUENCE tag. Without the EXT-X- 2073 DISCONTINUITY-SEQUENCE tag, it can be impossible for a client to 2074 locate corresponding segments between Renditions. 2076 If the server removes an EXT-X-DISCONTINUITY tag from the Media 2077 Playlist, it MUST increment the value of the EXT-X-DISCONTINUITY- 2078 SEQUENCE tag so that the Discontinuity Sequence Numbers of the 2079 segments still in the Media Playlist remain unchanged. The value of 2080 the EXT-X-DISCONTINUITY-SEQUENCE tag MUST NOT decrease or wrap. 2081 Clients can malfunction if each Media Segment does not have a 2082 consistent Discontinuity Sequence Number. 2084 If a server plans to remove a Media Segment after it is delivered to 2085 clients over HTTP, it SHOULD ensure that the HTTP response contains 2086 an Expires header that reflects the planned time-to-live. 2088 A Live Playlist MUST NOT contain the EXT-X-PLAYLIST-TYPE tag, as no 2089 value of that tag allows Media Segments to be removed. 2091 6.2.3. Encrypting Media Segments 2093 Media Segments MAY be encrypted. Every encrypted Media Segment MUST 2094 have an EXT-X-KEY tag (Section 4.4.4.4) applied to it with a URI that 2095 the client can use to obtain a Key file (Section 5) containing the 2096 decryption key. 2098 A Media Segment can only be encrypted with one encryption METHOD, 2099 using one encryption key and IV. However, a server MAY offer 2100 multiple ways to retrieve that key by providing multiple EXT-X-KEY 2101 tags, each with a different KEYFORMAT attribute value. 2103 The server MAY set the HTTP Expires header in the key response to 2104 indicate the duration for which the key can be cached. 2106 Any unencrypted Media Segment in a Playlist that is preceded by an 2107 encrypted Media Segment MUST have an EXT-X-KEY tag applied to it with 2108 a METHOD attribute of NONE. Otherwise, the client will misinterpret 2109 those segments as encrypted. 2111 If the encryption METHOD is AES-128 and the Playlist does not contain 2112 the EXT-X-I-FRAMES-ONLY tag, AES encryption as described in 2113 Section 4.4.4.4 SHALL be applied to individual Media Segments. 2115 If the encryption METHOD is AES-128 and the Playlist contains an EXT- 2116 X-I-FRAMES-ONLY tag, the entire resource MUST be encrypted using 2117 AES-128 CBC with PKCS7 padding [RFC5652]. Encryption MAY be 2118 restarted on 16-byte block boundaries, unless the first block 2119 contains an I-frame. The IV used for encryption MUST be either the 2120 Media Sequence Number of the Media Segment or the value of the IV 2121 attribute of the EXT-X-KEY tag, as described in Section 5.2. These 2122 constraints allow a client to load and decrypt individual I-frames 2123 specified as sub-ranges of regular encrypted Media Segments, and 2124 their Media Initialization Sections. 2126 If the encryption METHOD indicates Sample Encryption, media samples 2127 MAY be encrypted prior to encapsulation in a Media Segment. 2129 The server MUST NOT remove an EXT-X-KEY tag from the Playlist file if 2130 it applies to any Media Segment in the Playlist file, or clients who 2131 subsequently load that Playlist will be unable to decrypt those Media 2132 Segments. 2134 6.2.4. Providing Variant Streams 2136 A server MAY offer multiple Media Playlist files to provide different 2137 encodings of the same presentation. If it does so, it SHOULD provide 2138 a Master Playlist file that lists each Variant Stream to allow 2139 clients to switch between encodings dynamically. 2141 Master Playlists describe regular Variant Streams with EXT-X-STREAM- 2142 INF tags and I-frame Variant Streams with EXT-X-I-FRAME-STREAM-INF 2143 tags. 2145 If an EXT-X-STREAM-INF tag or EXT-X-I-FRAME-STREAM-INF tag contains 2146 the CODECS attribute, the attribute value MUST include every media 2147 format [RFC6381] present in any Media Segment in any of the 2148 Renditions specified by the Variant Stream. 2150 The server MUST meet the following constraints when producing Variant 2151 Streams in order to allow clients to switch between them seamlessly: 2153 Each Variant Stream MUST present the same content. 2155 Matching content in Variant Streams MUST have matching timestamps. 2156 This allows clients to synchronize the media. 2158 Matching content in Variant Streams MUST have matching 2159 Discontinuity Sequence Numbers (see Section 4.4.3.3). 2161 Each Media Playlist in each Variant Stream MUST have the same 2162 Target Duration. The only exceptions are SUBTITLES Renditions and 2163 Media Playlists containing an EXT-X-I-FRAMES-ONLY tag, which MAY 2164 have different Target Durations if they have an EXT-X-PLAYLIST- 2165 TYPE of VOD. 2167 Content that appears in a Media Playlist of one Variant Stream but 2168 not in another MUST appear either at the beginning or at the end 2169 of the Media Playlist file and MUST NOT be longer than the Target 2170 Duration. 2172 If any Media Playlists have an EXT-X-PLAYLIST-TYPE tag, all Media 2173 Playlists MUST have an EXT-X-PLAYLIST-TYPE tag with the same 2174 value. 2176 If the Playlist contains an EXT-X-PLAYLIST-TYPE tag with the value 2177 of VOD, the first segment of every Media Playlist in every Variant 2178 Stream MUST start at the same media timestamp. 2180 If any Media Playlist in a Master Playlist contains an EXT-X- 2181 PROGRAM-DATE-TIME tag, then all Media Playlists in that Master 2182 Playlist MUST contain EXT-X-PROGRAM-DATE-TIME tags with consistent 2183 mappings of date and time to media timestamps. 2185 Each Variant Stream MUST contain the same set of Date Ranges. The 2186 EXT-X-DATERANGE tags of corresponding Date Ranges MUST have the 2187 same ID attribute value and contain the same set of attribute/ 2188 value pairs. 2190 In addition, for broadest compatibility, Variant Streams SHOULD 2191 contain the same encoded audio bitstream. This allows clients to 2192 switch between Variant Streams without audible glitching. 2194 The rules for Variant Streams also apply to alternative Renditions 2195 (see Section 4.4.6.2.1). 2197 6.3. Client Responsibilities 2199 6.3.1. General Client Responsibilities 2201 How the client obtains the URI to the Playlist file is outside the 2202 scope of this document; it is presumed to have done so. 2204 The client obtains the Playlist file from the URI. If the Playlist 2205 file so obtained is a Master Playlist, the client can select a 2206 Variant Stream to load from the Master Playlist. 2208 Clients MUST ensure that loaded Playlists comply with Section 4 and 2209 that the EXT-X-VERSION tag, if present, specifies a protocol version 2210 supported by the client; if either check fails, the client MUST NOT 2211 attempt to use the Playlist, or unintended behavior could occur. 2213 When parsing Playlist elements that are subject to variable 2214 substitution, a Variable Reference whose Variable Name has been 2215 provided by an EXT-X-DEFINE tag that precedes the Variable Reference 2216 MUST be replaced by the corresponding Variable Value. Such 2217 replacements themselves are NOT subject to variable substitution. 2219 When parsing Playlist elements that are subject to variable 2220 substitution, a Variable Reference whose Variable Name has NOT been 2221 provided by an EXT-X-DEFINE tag preceding the Variable Reference MUST 2222 trigger a parsing error. 2224 If any URI element in a Playlist contains an URI scheme that the 2225 client cannot handle, the client MUST stop playback. All clients 2226 MUST support HTTP schemes. 2228 To support forward compatibility, when parsing Playlists, clients 2229 MUST: 2231 o ignore any unrecognized tags. 2233 o ignore any attribute/value pair with an unrecognized 2234 AttributeName. 2236 o ignore any tag containing an attribute/value pair of type 2237 enumerated-string whose AttributeName is recognized but whose 2238 AttributeValue is not recognized, unless the definition of the 2239 attribute says otherwise. 2241 When identifying playable Renditions, Clients SHOULD consider an 2242 audio Rendition having unrecognized CHANNELS parameters to be 2243 playable if its associated CODECS attribute is supported. However, 2244 an equivalent Rendition with the same audio codec and recognized 2245 CHANNELS parameters SHOULD be preferred if it is present in the 2246 Master Playlist. 2248 Algorithms used by the client to switch between Variant Streams are 2249 beyond the scope of this document. 2251 6.3.2. Loading the Media Playlist File 2253 Every time a Media Playlist is loaded or reloaded from a Playlist 2254 URI, the client MUST determine the next Media Segment to load, as 2255 described in Section 6.3.5, if it intends to play the presentation 2256 normally (i.e., in Playlist order at the nominal playback rate). 2258 If the Media Playlist contains the EXT-X-MEDIA-SEQUENCE tag, the 2259 client SHOULD assume that each Media Segment in it will become 2260 unavailable at the time that the Playlist file was loaded plus the 2261 duration of the Playlist file. 2263 A client MAY use the segment Media Sequence Number to track the 2264 location of a Media Segment within a Playlist when the Playlist is 2265 reloaded. 2267 A client MUST NOT assume that segments with the same Media Sequence 2268 Number in different Variant Streams or Renditions have the same 2269 position in the presentation; Playlists MAY have independent Media 2270 Sequence Numbers. Instead, a client MUST use the relative position 2271 of each segment on the Playlist timeline and its Discontinuity 2272 Sequence Number to locate corresponding segments. 2274 A client MUST load the Media Playlist file of every Rendition 2275 selected for playback in order to locate the media specific to that 2276 Rendition. But, to prevent unnecessary load on the server, it SHOULD 2277 NOT load the Playlist file of any other Rendition. 2279 For some Variant Streams, it is possible to select Renditions that do 2280 not include the Rendition specified by the EXT-X-STREAM-INF tag. As 2281 noted above, the client SHOULD NOT load that Rendition in those 2282 cases. 2284 6.3.3. Playing the Media Playlist File 2286 The client SHALL choose which Media Segment to play first from the 2287 Media Playlist when playback starts. If the EXT-X-ENDLIST tag is not 2288 present and the client intends to play the media normally, the client 2289 SHOULD NOT choose a segment that starts less than the duration of the 2290 last segment in the Playlist plus two target durations from the end 2291 of the Playlist file. Doing so can trigger playback stalls. 2293 Normal playback can be achieved by playing the Media Segments in the 2294 order that they appear in the Playlist. The client MAY present the 2295 available media in any way it wishes, including normal playback, 2296 random access, and trick modes. 2298 The client SHOULD NOT attempt to load Media Segments that have been 2299 marked with an EXT-X-GAP tag. Instead, clients are encouraged to 2300 look for another Variant Stream of the same Rendition which does not 2301 have the same gap, and play that instead. 2303 The encoding parameters for samples in a Media Segment and across 2304 multiple Media Segments in a Media Playlist SHOULD remain consistent. 2305 However, clients SHOULD deal with encoding changes as they are 2306 encountered, for example, by scaling video content to accommodate a 2307 resolution change. If the Variant Stream includes a RESOLUTION 2308 attribute, clients SHOULD display all video within a rectangle with 2309 the same proportions as that resolution. 2311 Clients SHOULD be prepared to handle multiple tracks of a particular 2312 type (e.g., audio or video). A client with no other preference 2313 SHOULD choose the track with the lowest numerical track identifier 2314 that it can play. 2316 Clients SHOULD ignore private streams inside Transport Streams that 2317 they do not recognize. Private streams can be used to support 2318 different devices with the same stream, although stream authors 2319 SHOULD be sensitive to the additional network load that this imposes. 2321 The client MUST be prepared to reset its parser(s) and decoder(s) 2322 before playing a Media Segment that has an EXT-X-DISCONTINUITY tag 2323 applied to it; otherwise, playback errors can occur. 2325 The client SHOULD attempt to load Media Segments in advance of when 2326 they will be required for uninterrupted playback to compensate for 2327 temporary variations in latency and throughput. 2329 The client MAY use the value of the EXT-X-PROGRAM-DATE-TIME tag to 2330 display the program origination time to the user. If the value 2331 includes time zone information, the client SHALL take it into 2332 account; if it does not, the client MAY assume the time to be local. 2334 Note that dates in Playlists can refer to when the content was 2335 produced (or to other times), which have no relation to the time of 2336 playback. 2338 If the first EXT-X-PROGRAM-DATE-TIME tag in a Playlist appears after 2339 one or more Media Segment URIs, the client SHOULD extrapolate 2340 backward from that tag (using EXTINF durations and/or media 2341 timestamps) to associate dates with those segments. To associate a 2342 date with any other Media Segment that does not have an EXT-X- 2343 PROGRAM-DATE-TIME tag applied to it directly, the client SHOULD 2344 extrapolate forward from the last EXT-X-PROGRAM-DATE-TIME tag 2345 appearing before that segment in the Playlist. 2347 6.3.4. Reloading the Media Playlist File 2349 The client MUST periodically reload a Media Playlist file to learn 2350 what media is currently available, unless it contains an EXT-X- 2351 PLAYLIST-TYPE tag with a value of VOD, or a value of EVENT and the 2352 EXT-X-ENDLIST tag is also present. 2354 However, the client MUST NOT attempt to reload the Playlist file more 2355 frequently than specified by this section, in order to limit the 2356 collective load on the server. 2358 When a client loads a Playlist file for the first time or reloads a 2359 Playlist file and finds that it has changed since the last time it 2360 was loaded, the client MUST wait for at least the duration of the 2361 last segment in the Playlist before attempting to reload the Playlist 2362 file again, measured from the last time the client began loading the 2363 Playlist file. 2365 If the client reloads a Playlist file and finds that it has not 2366 changed, then it MUST wait for a period of one-half the Target 2367 Duration before retrying. 2369 After reloading a Media Playlist, the client SHOULD verify that each 2370 Media Segment in it has the same URI (and byte range, if specified) 2371 as the Media Segment with the same Media Sequence Number in the 2372 previous Media Playlist. It SHOULD halt playback if it does not, as 2373 this normally indicates a server error. 2375 In order to reduce server load, the client SHOULD NOT reload the 2376 Playlist files of Variant Streams or alternate Renditions that are 2377 not currently being played. If it decides to switch playback to a 2378 different Variant Stream, it SHOULD stop reloading the Playlist of 2379 the old Variant Stream and begin loading the Playlist of the new 2380 Variant Stream. It can use the EXTINF durations and the constraints 2381 in Section 6.2.4 to determine the approximate location of 2382 corresponding media. Once media from the new Variant Stream has been 2383 loaded, the timestamps in the Media Segments can be used to 2384 synchronize the old and new timelines precisely. 2386 A client MUST NOT attempt to use the Media Sequence Number to 2387 synchronize between streams (see Section 6.3.2). 2389 6.3.5. Determining the Next Segment to Load 2391 The client MUST examine the Media Playlist file every time it is 2392 loaded or reloaded to determine the next Media Segment to load, as 2393 the set of available media MAY have changed. 2395 The first segment to load is generally the segment that the client 2396 has chosen to play first (see Section 6.3.3). 2398 In order to play the presentation normally, the next Media Segment to 2399 load is the one with the lowest Media Sequence Number that is greater 2400 than the Media Sequence Number of the last Media Segment loaded. 2402 6.3.6. Decrypting Encrypted Media Segments 2404 If a Media Playlist file contains an EXT-X-KEY tag that specifies a 2405 Key file URI, the client can obtain that Key file and use the key 2406 inside it to decrypt all Media Segments to which that EXT-X-KEY tag 2407 applies. 2409 A client MUST ignore any EXT-X-KEY tag with an unsupported or 2410 unrecognized KEYFORMAT attribute, to allow for cross-device 2411 addressability. If the Playlist contains a Media Segment to which 2412 only EXT-X-KEY tags with unrecognized or unsupported KEYFORMAT 2413 attributes are applied, playback SHOULD fail. 2415 A client MUST NOT attempt to decrypt any segments whose EXT-X-KEY tag 2416 has a METHOD attribute that it does not recognize. 2418 If the encryption METHOD is AES-128, AES-128 CBC decryption SHALL be 2419 applied to individual Media Segments, whose encryption format is 2420 described in Section 4.4.4.4. 2422 If the encryption METHOD is AES-128 and the Media Segment is part of 2423 an I-frame Playlist (Section 4.4.3.6) and it has an EXT-X-BYTERANGE 2424 tag applied to it, special care needs to be taken in loading and 2425 decrypting the segment, because the resource identified by the URI is 2426 encrypted in 16-byte blocks from the start of the resource. 2428 The decrypted I-frame can be recovered by first widening its byte 2429 range, as specified by the EXT-X-BYTERANGE tag, so that it starts and 2430 ends on 16-byte boundaries from the start of the resource. 2432 Next, the byte range is widened further to include a 16-byte block at 2433 the beginning of the range. This 16-byte block allows the correct IV 2434 for the following block to be calculated. 2436 The widened byte range can then be loaded and decrypted with AES-128 2437 CBC using an arbitrary IV. The number of bytes added to the 2438 beginning and the end of the original byte range are discarded from 2439 the decrypted bytes; what remains is the decrypted I-frame. 2441 If the encryption METHOD indicates Sample Encryption, decryption 2442 SHALL be applied to encrypted media samples within the Media Segment. 2444 An EXT-X-KEY tag with a METHOD of NONE indicates that the Media 2445 Segments it applies to are not encrypted. 2447 7. Protocol Version Compatibility 2449 Protocol compatibility is specified by the EXT-X-VERSION tag. A 2450 Playlist that contains tags or attributes that are not compatible 2451 with protocol version 1 MUST include an EXT-X-VERSION tag. 2453 A client MUST NOT attempt playback if it does not support the 2454 protocol version specified by the EXT-X-VERSION tag, or unintended 2455 behavior could occur. 2457 A Media Playlist MUST indicate an EXT-X-VERSION of 2 or higher if it 2458 contains: 2460 o The IV attribute of the EXT-X-KEY tag. 2462 A Media Playlist MUST indicate an EXT-X-VERSION of 3 or higher if it 2463 contains: 2465 o Floating-point EXTINF duration values. 2467 A Media Playlist MUST indicate an EXT-X-VERSION of 4 or higher if it 2468 contains: 2470 o The EXT-X-BYTERANGE tag. 2472 o The EXT-X-I-FRAMES-ONLY tag. 2474 A Media Playlist MUST indicate an EXT-X-VERSION of 5 or higher if it 2475 contains: 2477 o An EXT-X-KEY tag with a METHOD of SAMPLE-AES. 2479 o The KEYFORMAT and KEYFORMATVERSIONS attributes of the EXT-X-KEY 2480 tag. 2482 o The EXT-X-MAP tag. 2484 A Media Playlist MUST indicate an EXT-X-VERSION of 6 or higher if it 2485 contains: 2487 o The EXT-X-MAP tag in a Media Playlist that does not contain EXT- 2488 X-I-FRAMES-ONLY. 2490 Note that in protocol version 6, the semantics of the EXT- 2491 X-TARGETDURATION tag changed slightly. In protocol version 5 and 2492 earlier it indicated the maximum segment duration; in protocol 2493 version 6 and later it indicates the the maximum segment duration 2494 rounded to the nearest integer number of seconds. 2496 A Master Playlist MUST indicate an EXT-X-VERSION of 7 or higher if it 2497 contains: 2499 o "SERVICE" values for the INSTREAM-ID attribute of the EXT-X-MEDIA 2500 tag. 2502 A Playlist MUST indicate an EXT-X-VERSION of 8 or higher if it 2503 contains: 2505 o Variable substitution. 2507 The EXT-X-MEDIA tag and the AUDIO, VIDEO, and SUBTITLES attributes of 2508 the EXT-X-STREAM-INF tag are backward compatible to protocol version 2509 1, but playback on older clients may not be desirable. A server MAY 2510 consider indicating an EXT-X-VERSION of 4 or higher in the Master 2511 Playlist but is not required to do so. 2513 The PROGRAM-ID attribute of the EXT-X-STREAM-INF and the EXT-X-I- 2514 FRAME-STREAM-INF tags was removed in protocol version 6. 2516 The EXT-X-ALLOW-CACHE tag was removed in protocol version 7. 2518 8. Playlist Examples 2520 8.1. Simple Media Playlist 2522 #EXTM3U 2523 #EXT-X-TARGETDURATION:10 2524 #EXT-X-VERSION:3 2525 #EXTINF:9.009, 2526 http://media.example.com/first.ts 2527 #EXTINF:9.009, 2528 http://media.example.com/second.ts 2529 #EXTINF:3.003, 2530 http://media.example.com/third.ts 2531 #EXT-X-ENDLIST 2533 8.2. Live Media Playlist Using HTTPS 2535 #EXTM3U 2536 #EXT-X-VERSION:3 2537 #EXT-X-TARGETDURATION:8 2538 #EXT-X-MEDIA-SEQUENCE:2680 2540 #EXTINF:7.975, 2541 https://priv.example.com/fileSequence2680.ts 2542 #EXTINF:7.941, 2543 https://priv.example.com/fileSequence2681.ts 2544 #EXTINF:7.975, 2545 https://priv.example.com/fileSequence2682.ts 2547 8.3. Playlist with Encrypted Media Segments 2548 #EXTM3U 2549 #EXT-X-VERSION:3 2550 #EXT-X-MEDIA-SEQUENCE:7794 2551 #EXT-X-TARGETDURATION:15 2553 #EXT-X-KEY:METHOD=AES-128,URI="https://priv.example.com/key.php?r=52" 2555 #EXTINF:2.833, 2556 http://media.example.com/fileSequence52-A.ts 2557 #EXTINF:15.0, 2558 http://media.example.com/fileSequence52-B.ts 2559 #EXTINF:13.333, 2560 http://media.example.com/fileSequence52-C.ts 2562 #EXT-X-KEY:METHOD=AES-128,URI="https://priv.example.com/key.php?r=53" 2564 #EXTINF:15.0, 2565 http://media.example.com/fileSequence53-A.ts 2567 8.4. Master Playlist 2569 #EXTM3U 2570 #EXT-X-STREAM-INF:BANDWIDTH=1280000,AVERAGE-BANDWIDTH=1000000 2571 http://example.com/low.m3u8 2572 #EXT-X-STREAM-INF:BANDWIDTH=2560000,AVERAGE-BANDWIDTH=2000000 2573 http://example.com/mid.m3u8 2574 #EXT-X-STREAM-INF:BANDWIDTH=7680000,AVERAGE-BANDWIDTH=6000000 2575 http://example.com/hi.m3u8 2576 #EXT-X-STREAM-INF:BANDWIDTH=65000,CODECS="mp4a.40.5" 2577 http://example.com/audio-only.m3u8 2579 8.5. Master Playlist with I-Frames 2581 #EXTM3U 2582 #EXT-X-STREAM-INF:BANDWIDTH=1280000 2583 low/audio-video.m3u8 2584 #EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=86000,URI="low/iframe.m3u8" 2585 #EXT-X-STREAM-INF:BANDWIDTH=2560000 2586 mid/audio-video.m3u8 2587 #EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=150000,URI="mid/iframe.m3u8" 2588 #EXT-X-STREAM-INF:BANDWIDTH=7680000 2589 hi/audio-video.m3u8 2590 #EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=550000,URI="hi/iframe.m3u8" 2591 #EXT-X-STREAM-INF:BANDWIDTH=65000,CODECS="mp4a.40.5" 2592 audio-only.m3u8 2594 8.6. Master Playlist with Alternative Audio 2596 In this example, the CODECS attributes have been condensed for space. 2597 A '\' is used to indicate that the tag continues on the following 2598 line with whitespace removed: 2600 #EXTM3U 2601 #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="aac",NAME="English", \ 2602 DEFAULT=YES,AUTOSELECT=YES,LANGUAGE="en", \ 2603 URI="main/english-audio.m3u8" 2604 #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="aac",NAME="Deutsch", \ 2605 DEFAULT=NO,AUTOSELECT=YES,LANGUAGE="de", \ 2606 URI="main/german-audio.m3u8" 2607 #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="aac",NAME="Commentary", \ 2608 DEFAULT=NO,AUTOSELECT=NO,LANGUAGE="en", \ 2609 URI="commentary/audio-only.m3u8" 2610 #EXT-X-STREAM-INF:BANDWIDTH=1280000,CODECS="...",AUDIO="aac" 2611 low/video-only.m3u8 2612 #EXT-X-STREAM-INF:BANDWIDTH=2560000,CODECS="...",AUDIO="aac" 2613 mid/video-only.m3u8 2614 #EXT-X-STREAM-INF:BANDWIDTH=7680000,CODECS="...",AUDIO="aac" 2615 hi/video-only.m3u8 2616 #EXT-X-STREAM-INF:BANDWIDTH=65000,CODECS="mp4a.40.5",AUDIO="aac" 2617 main/english-audio.m3u8 2619 8.7. Master Playlist with Alternative Video 2621 This example shows three different video Renditions (Main, 2622 Centerfield, and Dugout) and three different Variant Streams (low, 2623 mid, and high). In this example, clients that did not support the 2624 EXT-X-MEDIA tag and the VIDEO attribute of the EXT-X-STREAM-INF tag 2625 would only be able to play the video Rendition "Main". 2627 Since the EXT-X-STREAM-INF tag has no AUDIO attribute, all video 2628 Renditions would be required to contain the audio. 2630 In this example, the CODECS attributes have been condensed for space. 2631 A '\' is used to indicate that the tag continues on the following 2632 line with whitespace removed: 2634 #EXTM3U 2635 #EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="low",NAME="Main", \ 2636 DEFAULT=YES,URI="low/main/audio-video.m3u8" 2637 #EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="low",NAME="Centerfield", \ 2638 DEFAULT=NO,URI="low/centerfield/audio-video.m3u8" 2639 #EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="low",NAME="Dugout", \ 2640 DEFAULT=NO,URI="low/dugout/audio-video.m3u8" 2642 #EXT-X-STREAM-INF:BANDWIDTH=1280000,CODECS="...",VIDEO="low" 2643 low/main/audio-video.m3u8 2645 #EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="mid",NAME="Main", \ 2646 DEFAULT=YES,URI="mid/main/audio-video.m3u8" 2647 #EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="mid",NAME="Centerfield", \ 2648 DEFAULT=NO,URI="mid/centerfield/audio-video.m3u8" 2649 #EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="mid",NAME="Dugout", \ 2650 DEFAULT=NO,URI="mid/dugout/audio-video.m3u8" 2652 #EXT-X-STREAM-INF:BANDWIDTH=2560000,CODECS="...",VIDEO="mid" 2653 mid/main/audio-video.m3u8 2655 #EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="hi",NAME="Main", \ 2656 DEFAULT=YES,URI="hi/main/audio-video.m3u8" 2657 #EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="hi",NAME="Centerfield", \ 2658 DEFAULT=NO,URI="hi/centerfield/audio-video.m3u8" 2659 #EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="hi",NAME="Dugout", \ 2660 DEFAULT=NO,URI="hi/dugout/audio-video.m3u8" 2662 #EXT-X-STREAM-INF:BANDWIDTH=7680000,CODECS="...",VIDEO="hi" 2663 hi/main/audio-video.m3u8 2665 8.8. Session Data in a Master Playlist 2667 In this example, only the EXT-X-SESSION-DATA is shown: 2669 #EXT-X-SESSION-DATA:DATA-ID="com.example.lyrics",URI="lyrics.json" 2671 #EXT-X-SESSION-DATA:DATA-ID="com.example.title",LANGUAGE="en", \ 2672 VALUE="This is an example" 2673 #EXT-X-SESSION-DATA:DATA-ID="com.example.title",LANGUAGE="es", \ 2674 VALUE="Este es un ejemplo" 2676 8.9. CHARACTERISTICS Attribute Containing Multiple Characteristics 2678 Certain characteristics are valid in combination, as in: 2680 CHARACTERISTICS= 2681 "public.accessibility.transcribes-spoken-dialog,public.easy-to-read" 2683 8.10. EXT-X-DATERANGE Carrying SCTE-35 Tags 2685 This example shows two EXT-X-DATERANGE tags that describe a single 2686 Date Range, with an SCTE-35 "out" splice_insert() command that is 2687 subsequently updated with an SCTE-35 "in" splice_insert() command. 2689 #EXTM3U 2690 ... 2691 #EXT-X-DATERANGE:ID="splice-6FFFFFF0",START-DATE="2014-03-05T11: 2692 15:00Z",PLANNED-DURATION=59.993,SCTE35-OUT=0xFC002F0000000000FF0 2693 00014056FFFFFF000E011622DCAFF000052636200000000000A0008029896F50 2694 000008700000000 2696 ... Media Segment declarations for 60s worth of media 2698 #EXT-X-DATERANGE:ID="splice-6FFFFFF0",DURATION=59.993,SCTE35-IN= 2699 0xFC002A0000000000FF00000F056FFFFFF000401162802E6100000000000A00 2700 08029896F50000008700000000 2701 ... 2703 9. Contributors 2705 Significant contributions to the design of this protocol were made by 2706 Jim Batson, David Biderman, Bill May, Roger Pantos, Alan Tseng, and 2707 Eryk Vershen. Stuart Cheshire helped edit the specification. 2709 Significant contributions to the update of this protocol were made by 2710 Bill May, Eryk Vershen, and Peng Zhou. 2712 In particular, Bill May co-authored the first edition of HTTP Live 2713 Streaming, [RFC8216], and continues to provide valuable guidance and 2714 input. 2716 10. IANA Considerations 2718 IANA has registered the following media type [RFC2046]: 2720 Type name: application 2722 Subtype name: vnd.apple.mpegurl 2724 Required parameters: none 2726 Optional parameters: none 2727 Encoding considerations: encoded as UTF-8, which is 8-bit text. This 2728 media type may require encoding on transports not capable of handling 2729 8-bit text. See Section 4 for more information. 2731 Security considerations: See Section 11. 2733 Compression: this media type does not employ compression. 2735 Interoperability considerations: There are no byte-ordering issues, 2736 since files are 8-bit text. Applications could encounter 2737 unrecognized tags, which SHOULD be ignored. 2739 Published specification: see Section 4. 2741 Applications that use this media type: Multimedia applications such 2742 as the iPhone media player in iOS 3.0 and later and QuickTime Player 2743 in Mac OS X version 10.6 and later. 2745 Fragment identifier considerations: no Fragment Identifiers are 2746 defined for this media type. 2748 Additional information: 2750 Deprecated alias names for this type: none 2751 Magic number(s): #EXTM3U 2752 File extension(s): .m3u8, .m3u (see Section 4) 2753 Macintosh file type code(s): none 2755 Person & email address to contact for further information: David 2756 Singer, singer AT apple.com. 2758 Intended usage: LIMITED USE 2760 Restrictions on usage: none 2762 Author: Roger Pantos 2764 Change Controller: David Singer 2766 11. Security Considerations 2768 Since the protocol generally uses HTTP to transfer data, most of the 2769 same security considerations apply. See Section 15 of HTTP 2770 [RFC7230]. 2772 Media file parsers are typically subject to "fuzzing" attacks. 2773 Implementors SHOULD pay particular attention to code that will parse 2774 data received from a server and ensure that all possible inputs are 2775 handled correctly. 2777 Playlist files contain URIs, which clients will use to make network 2778 requests of arbitrary entities. Clients SHOULD range-check responses 2779 to prevent buffer overflows. See also the Security Considerations 2780 section of "Uniform Resource Identifier (URI): Generic Syntax" 2781 [RFC3986]. 2783 Apart from URL resolution, this format does not employ any form of 2784 active content. 2786 Clients SHOULD limit each playback session to a reasonable number of 2787 concurrent downloads (for example, four) to avoid contributing to 2788 denial-of-service attacks. 2790 HTTP requests often include session state ("cookies"), which may 2791 contain private user data. Implementations MUST follow cookie 2792 restriction and expiry rules specified by "HTTP State Management 2793 Mechanism" [RFC6265] to protect themselves from attack. See also the 2794 Security Considerations section of that document, and "Use of HTTP 2795 State Management" [RFC2964]. 2797 Encryption keys are specified by URI. The delivery of these keys 2798 SHOULD be secured by a mechanism such as HTTP Over TLS [RFC2818] 2799 (formerly SSL) in conjunction with a secure realm or a session token. 2801 12. References 2803 12.1. Normative References 2805 [AC_3] Advanced Television Systems Committee, "Digital Audio 2806 Compression (AC-3) (E-AC-3)", ATSC Standard A/52:2010, 2807 November 2010, <http://atsc.org/wp- 2808 content/uploads/2015/03/A52-201212-17.pdf>. 2810 [AES_128] National Institute of Standards and Technology, "Advanced 2811 Encryption Standard (AES)", FIPS PUB 197, DOI 2812 10.6028/NIST.FIPS.197, November 2001, 2813 <http://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.197.pdf>. 2815 [CEA608] Consumer Technology Association, "Line 21 Data Services", 2816 ANSI/CTA Standard 608-E, April 2008, 2817 <https://standards.cta.tech/kwspub/published_docs/ANSI- 2818 CTA-608-E-R-2014-Preview.pdf>. 2820 [CEA708] Consumer Technology Association, "Digital Television (DTV) 2821 Closed Captioning", ANSI/CTA Standard CEA-708-E, August 2822 2013, <https://standards.cta.tech/kwspub/published_docs/ 2823 ANSI-CTA-708-E-Preview.pdf>. 2825 [CICP] International Organization for Standardization, 2826 "Information technology - MPEG systems technologies - Part 2827 8: Coding-independent code points", ISO/IEC International 2828 Standard 23001-8:2016, 2016, <https://www.iso.org/obp/ 2829 ui/#iso:std:iso-iec:23001:-8:ed-2:v1:en>. 2831 [CMAF] International Organization for Standardization, 2832 "Information technology -- Multimedia application format 2833 (MPEG-A) -- Part 19: Common media application format 2834 (CMAF) for segmented media", ISO/IEC International 2835 Standard 23000-19:2017, December 2017, 2836 <https://www.iso.org/standard/71975.html>. 2838 [COMMON_ENC] 2839 International Organization for Standardization, 2840 "Information technology -- MPEG systems technologies -- 2841 Part 7: Common encryption in ISO base media file format 2842 files", ISO/IEC International Standard 23001-7:2016, 2843 February 2016, <http://www.iso.org/iso/ 2844 catalogue_detail.htm?csnumber=68042>. 2846 [H_264] International Telecommunications Union, "Advanced video 2847 coding for generic audiovisual services", January 2012, 2848 <http://www.itu.int/rec/T-REC-H.264>. 2850 [HDCP] Digital Content Protection LLC, "High-bandwidth Digital 2851 Content Protection System - Mapping HDCP to HDMI", 2852 February 2013, <http://www.digital- 2853 cp.com/sites/default/files/specifications/ 2854 HDCP%20on%20HDMI%20Specification%20Rev2_2_Final1.pdf>. 2856 [IMSC1] W3C, "TTML Profiles for Internet Media Subtitles and 2857 Captions 1.0 (IMSC1)", April 2016, 2858 <https://www.w3.org/TR/ttml-imsc1/>. 2860 [ISO_13818] 2861 International Organization for Standardization, "Generic 2862 coding of moving pictures and associated audio 2863 information", ISO/IEC International Standard 13818:2007, 2864 October 2007, 2865 <http://www.iso.org/iso/catalogue_detail?csnumber=44169>. 2867 [ISO_13818_3] 2868 International Organization for Standardization, "Generic 2869 coding of moving pictures and associated audio information 2870 -- Part 3: Audio", ISO/IEC International 2871 Standard 13818-3:1998, April 1998, 2872 <http://www.iso.org/iso/home/store/catalogue_tc/ 2873 catalogue_detail.htm?csnumber=26797>. 2875 [ISO_13818_7] 2876 International Organization for Standardization, "Generic 2877 coding of moving pictures and associated audio information 2878 -- Part 7: Advanced Audio Coding (AAC)", ISO/IEC 2879 International Standard 13818-7:2006, January 2006, 2880 <http://www.iso.org/iso/home/store/catalogue_tc/ 2881 catalogue_detail.htm?csnumber=43345>. 2883 [ISO_14496] 2884 International Organization for Standardization, 2885 "Information technology -- Coding of audio-visual objects 2886 -- Part 3: Audio", ISO/IEC International 2887 Standard 14496-3:2009, 2009, 2888 <http://www.iso.org/iso/catalogue_detail?csnumber=53943>. 2890 [ISO_8601] 2891 International Organization for Standardization, "Data 2892 elements and interchange formats -- Information 2893 interchange -- Representation of dates and times", ISO/IEC 2894 International Standard 8601:2004, December 2004, 2895 <http://www.iso.org/iso/catalogue_detail?csnumber=40874>. 2897 [ISOBMFF] International Organization for Standardization, 2898 "Information technology -- Coding of audio-visual objects 2899 -- Part 12: ISO base media file format", ISO/IEC 2900 International Standard 14496-12:2015, December 2015, 2901 <http://www.iso.org/iso/ 2902 catalogue_detail.htm?csnumber=68960>. 2904 [MP4_TIMED_TEXT] 2905 International Organization for Standardization, 2906 "Information technology -- Coding of audio-visual objects 2907 -- Part 30: Timed text and other visual overlays in ISO 2908 base media file format", ISO/IEC International 2909 Standard 14496-30:2014, March 2014, 2910 <https://www.iso.org/standard/63107.html>. 2912 [RFC2046] Freed, N. and N. Borenstein, "Multipurpose Internet Mail 2913 Extensions (MIME) Part Two: Media Types", RFC 2046, 2914 DOI 10.17487/RFC2046, November 1996, 2915 <https://www.rfc-editor.org/info/rfc2046>. 2917 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 2918 Requirement Levels", BCP 14, RFC 2119, 2919 DOI 10.17487/RFC2119, March 1997, 2920 <https://www.rfc-editor.org/info/rfc2119>. 2922 [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, 2923 DOI 10.17487/RFC2818, May 2000, 2924 <https://www.rfc-editor.org/info/rfc2818>. 2926 [RFC2964] Moore, K. and N. Freed, "Use of HTTP State Management", 2927 BCP 44, RFC 2964, DOI 10.17487/RFC2964, October 2000, 2928 <https://www.rfc-editor.org/info/rfc2964>. 2930 [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 2931 10646", STD 63, RFC 3629, DOI 10.17487/RFC3629, November 2932 2003, <https://www.rfc-editor.org/info/rfc3629>. 2934 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 2935 Resource Identifier (URI): Generic Syntax", STD 66, 2936 RFC 3986, DOI 10.17487/RFC3986, January 2005, 2937 <https://www.rfc-editor.org/info/rfc3986>. 2939 [RFC5646] Phillips, A., Ed. and M. Davis, Ed., "Tags for Identifying 2940 Languages", BCP 47, RFC 5646, DOI 10.17487/RFC5646, 2941 September 2009, <https://www.rfc-editor.org/info/rfc5646>. 2943 [RFC5652] Housley, R., "Cryptographic Message Syntax (CMS)", STD 70, 2944 RFC 5652, DOI 10.17487/RFC5652, September 2009, 2945 <https://www.rfc-editor.org/info/rfc5652>. 2947 [RFC6265] Barth, A., "HTTP State Management Mechanism", RFC 6265, 2948 DOI 10.17487/RFC6265, April 2011, 2949 <https://www.rfc-editor.org/info/rfc6265>. 2951 [RFC6381] Gellens, R., Singer, D., and P. Frojdh, "The 'Codecs' and 2952 'Profiles' Parameters for "Bucket" Media Types", RFC 6381, 2953 DOI 10.17487/RFC6381, August 2011, 2954 <https://www.rfc-editor.org/info/rfc6381>. 2956 [RFC7230] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 2957 Protocol (HTTP/1.1): Message Syntax and Routing", 2958 RFC 7230, DOI 10.17487/RFC7230, June 2014, 2959 <https://www.rfc-editor.org/info/rfc7230>. 2961 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2962 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 2963 May 2017, <https://www.rfc-editor.org/info/rfc8174>. 2965 [RFC8216] Pantos, R., Ed. and W. May, "HTTP Live Streaming", 2966 RFC 8216, DOI 10.17487/RFC8216, August 2017, 2967 <https://www.rfc-editor.org/info/rfc8216>. 2969 [RFC8259] Bray, T., Ed., "The JavaScript Object Notation (JSON) Data 2970 Interchange Format", STD 90, RFC 8259, 2971 DOI 10.17487/RFC8259, December 2017, 2972 <https://www.rfc-editor.org/info/rfc8259>. 2974 [SCTE35] Society of Cable Telecommunications Engineers, "Digital 2975 Program Insertion Cueing Message for Cable", ANSI/SCTE 35, 2976 August 2014, <http://www.scte.org/documents/pdf/Standards/ 2977 ANSI_SCTE%2035%202014.pdf>. 2979 [US_ASCII] 2980 American National Standards Institute, "Coded Character 2981 Sets - 7-Bit American National Standard Code for 2982 Information Interchange (7-Bit ASCII)", ANSI X3.4, 2983 December 1986. 2985 [WebVTT] World Wide Web Consortium (W3C), ""WebVTT: The Web Video 2986 Text Tracks Format", Draft Community Group Report", July 2987 2013, <http://dev.w3.org/html5/webvtt/>. 2989 12.2. Informative References 2991 [ID3] ID3.org, "The ID3 audio file data tagging format", 2992 <http://www.id3.org/Developer_Information>. 2994 [M3U] Nullsoft, Inc., "The M3U Playlist format, originally 2995 invented for the Winamp media player", 2996 <http://wikipedia.org/wiki/M3U>. 2998 [SampleEnc] 2999 Apple Inc., "MPEG-2 Stream Encryption Format for HTTP Live 3000 Streaming", 3001 <https://developer.apple.com/library/ios/documentation/ 3002 AudioVideo/Conceptual/HLS_Sample_Encryption/>. 3004 [UNICODE] The Unicode Consortium, "The Unicode Standard", 3005 <https://www.unicode.org/versions/latest/>. 3007 [UTI] Apple Inc., "Uniform Type Identifier", 3008 <http://developer.apple.com/library/ios/#documentation/ 3009 general/conceptual/DevPedia-CocoaCore/ 3010 UniformTypeIdentifier.html>. 3012 Appendix A. Changes from RFC 8216 3014 Several changes have been made since the publication of RFC 8216 3015 [RFC8216]. 3017 The following tags have been added: EXT-X-GAP, EXT-X-BITRATE, and 3018 EXT-X-DEFINE (including variable substitution). 3020 IMSC has been added to the set of recognized subtitle formats. 3022 The VIDEO-RANGE attribute has been added to the EXT-X-STREAM-INF and 3023 EXT-X-I-FRAME-STREAM-INF tags. 3025 The ALLOWED-CPC attribute has been added to the EXT-X-STREAM-INF and 3026 EXT-X-I-FRAME-STREAM-INF tags. 3028 TYPE-1 has been added as a defined value for the HDCP-LEVEL 3029 attribute. 3031 The minimum new segment publication latency has been removed from 3032 server timing model. 3034 The Availability Duration of a Media Segment now depends on the 3035 presence of an EXT-X-ENDLIST tag. 3037 The recommended playlist offset to join a live stream has changed. 3039 The minimum delay before reloading a Playlist file has changed. 3041 The definition of peak segment bit rate was changed to ensure every 3042 segment is included in at least one contiguous set. 3044 Media Metadata tags such as EXT-X-DATERANGE may be removed from 3045 playlists. 3047 There have been a number of minor editorial changes. 3049 Author's Address 3050 Roger Pantos (editor) 3051 Apple Inc. 3052 Cupertino, California 3053 United States 3055 Email: http-live-streaming-review@group.apple.com