idnits 2.17.1 draft-pantos-hls-rfc8216bis-03.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 1 instance of lines with non-RFC2606-compliant FQDNs in the document. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (September 21, 2018) is 2042 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. Checking references for intended status: Informational ---------------------------------------------------------------------------- ** Obsolete normative reference: RFC 2818 (Obsoleted by RFC 9110) ** Obsolete normative reference: RFC 7230 (Obsoleted by RFC 9110, RFC 9112) Summary: 2 errors (**), 0 flaws (~~), 2 warnings (==), 3 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Informational R. Pantos, Ed. 3 Internet-Draft Apple Inc. 4 Obsoletes: 8216 (if approved) September 21, 2018 5 Intended status: Informational 6 Expires: March 25, 2019 8 HTTP Live Streaming 2nd Edition 9 draft-pantos-hls-rfc8216bis-03 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 http://datatracker.ietf.org/drafts/current/. 29 Internet-Drafts are draft documents valid for a maximum of six months 30 and may be updated, replaced, or obsoleted by other documents at any 31 time. It is inappropriate to use Internet-Drafts as reference 32 material or to cite them other than as "work in progress." 34 This Internet-Draft will expire on March 25, 2019. 36 Copyright Notice 38 Copyright (c) 2018 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 (http://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 . . . . . . . . . . . . . 4 60 2. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . 4 61 3. Media Segments . . . . . . . . . . . . . . . . . . . . . . . 6 62 3.1. Supported Media Segment Formats . . . . . . . . . . . . . 6 63 3.2. MPEG-2 Transport Streams . . . . . . . . . . . . . . . . 7 64 3.3. Fragmented MPEG-4 . . . . . . . . . . . . . . . . . . . . 7 65 3.4. Packed Audio . . . . . . . . . . . . . . . . . . . . . . 8 66 3.5. WebVTT . . . . . . . . . . . . . . . . . . . . . . . . . 8 67 3.6. IMSC Subtitles . . . . . . . . . . . . . . . . . . . . . 9 68 4. Playlists . . . . . . . . . . . . . . . . . . . . . . . . . . 10 69 4.1. Definition of a Playlist . . . . . . . . . . . . . . . . 10 70 4.2. Attribute Lists . . . . . . . . . . . . . . . . . . . . . 11 71 4.3. Variable Substitution . . . . . . . . . . . . . . . . . . 12 72 4.4. Playlist Tags . . . . . . . . . . . . . . . . . . . . . . 13 73 4.4.1. Basic Tags . . . . . . . . . . . . . . . . . . . . . 13 74 4.4.1.1. EXTM3U . . . . . . . . . . . . . . . . . . . . . 13 75 4.4.1.2. EXT-X-VERSION . . . . . . . . . . . . . . . . . . 13 76 4.4.2. Media Segment Tags . . . . . . . . . . . . . . . . . 14 77 4.4.2.1. EXTINF . . . . . . . . . . . . . . . . . . . . . 14 78 4.4.2.2. EXT-X-BYTERANGE . . . . . . . . . . . . . . . . . 14 79 4.4.2.3. EXT-X-DISCONTINUITY . . . . . . . . . . . . . . . 15 80 4.4.2.4. EXT-X-KEY . . . . . . . . . . . . . . . . . . . . 15 81 4.4.2.5. EXT-X-MAP . . . . . . . . . . . . . . . . . . . . 17 82 4.4.2.6. EXT-X-PROGRAM-DATE-TIME . . . . . . . . . . . . . 18 83 4.4.2.7. EXT-X-DATERANGE . . . . . . . . . . . . . . . . . 19 84 4.4.2.7.1. Mapping SCTE-35 into EXT-X-DATERANGE . . . . 21 85 4.4.2.8. EXT-X-GAP . . . . . . . . . . . . . . . . . . . . 22 86 4.4.2.9. EXT-X-BITRATE . . . . . . . . . . . . . . . . . . 23 87 4.4.3. Media Playlist Tags . . . . . . . . . . . . . . . . . 23 88 4.4.3.1. EXT-X-TARGETDURATION . . . . . . . . . . . . . . 23 89 4.4.3.2. EXT-X-MEDIA-SEQUENCE . . . . . . . . . . . . . . 23 90 4.4.3.3. EXT-X-DISCONTINUITY-SEQUENCE . . . . . . . . . . 24 91 4.4.3.4. EXT-X-ENDLIST . . . . . . . . . . . . . . . . . . 24 92 4.4.3.5. EXT-X-PLAYLIST-TYPE . . . . . . . . . . . . . . . 25 93 4.4.3.6. EXT-X-I-FRAMES-ONLY . . . . . . . . . . . . . . . 25 94 4.4.4. Master Playlist Tags . . . . . . . . . . . . . . . . 26 95 4.4.4.1. EXT-X-MEDIA . . . . . . . . . . . . . . . . . . . 26 96 4.4.4.1.1. Rendition Groups . . . . . . . . . . . . . . 29 97 4.4.4.2. EXT-X-STREAM-INF . . . . . . . . . . . . . . . . 30 98 4.4.4.2.1. Alternative Renditions . . . . . . . . . . . 34 99 4.4.4.3. EXT-X-I-FRAME-STREAM-INF . . . . . . . . . . . . 35 100 4.4.4.4. EXT-X-SESSION-DATA . . . . . . . . . . . . . . . 35 101 4.4.4.5. EXT-X-SESSION-KEY . . . . . . . . . . . . . . . . 36 102 4.4.5. Media or Master Playlist Tags . . . . . . . . . . . . 37 103 4.4.5.1. EXT-X-INDEPENDENT-SEGMENTS . . . . . . . . . . . 37 104 4.4.5.2. EXT-X-START . . . . . . . . . . . . . . . . . . . 37 105 4.4.5.3. EXT-X-DEFINE . . . . . . . . . . . . . . . . . . 38 106 5. Key Files . . . . . . . . . . . . . . . . . . . . . . . . . . 39 107 5.1. Structure of Key Files . . . . . . . . . . . . . . . . . 39 108 5.2. IV for AES-128 . . . . . . . . . . . . . . . . . . . . . 39 109 6. Client/Server Responsibilities . . . . . . . . . . . . . . . 40 110 6.1. Introduction . . . . . . . . . . . . . . . . . . . . . . 40 111 6.2. Server Responsibilities . . . . . . . . . . . . . . . . . 40 112 6.2.1. General Server Responsibilities . . . . . . . . . . . 40 113 6.2.2. Live Playlists . . . . . . . . . . . . . . . . . . . 43 114 6.2.3. Encrypting Media Segments . . . . . . . . . . . . . . 44 115 6.2.4. Providing Variant Streams . . . . . . . . . . . . . . 45 116 6.3. Client Responsibilities . . . . . . . . . . . . . . . . . 46 117 6.3.1. General Client Responsibilities . . . . . . . . . . . 46 118 6.3.2. Loading the Media Playlist File . . . . . . . . . . . 47 119 6.3.3. Playing the Media Playlist File . . . . . . . . . . . 48 120 6.3.4. Reloading the Media Playlist File . . . . . . . . . . 49 121 6.3.5. Determining the Next Segment to Load . . . . . . . . 50 122 6.3.6. Decrypting Encrypted Media Segments . . . . . . . . . 50 123 7. Protocol Version Compatibility . . . . . . . . . . . . . . . 51 124 8. Playlist Examples . . . . . . . . . . . . . . . . . . . . . . 53 125 8.1. Simple Media Playlist . . . . . . . . . . . . . . . . . . 53 126 8.2. Live Media Playlist Using HTTPS . . . . . . . . . . . . . 53 127 8.3. Playlist with Encrypted Media Segments . . . . . . . . . 53 128 8.4. Master Playlist . . . . . . . . . . . . . . . . . . . . . 54 129 8.5. Master Playlist with I-Frames . . . . . . . . . . . . . . 54 130 8.6. Master Playlist with Alternative Audio . . . . . . . . . 55 131 8.7. Master Playlist with Alternative Video . . . . . . . . . 55 132 8.8. Session Data in a Master Playlist . . . . . . . . . . . . 56 133 8.9. CHARACTERISTICS Attribute Containing Multiple 134 Characteristics . . . . . . . . . . . . . . . . . . . . . 56 135 8.10. EXT-X-DATERANGE Carrying SCTE-35 Tags . . . . . . . . . . 57 136 9. Contributors . . . . . . . . . . . . . . . . . . . . . . . . 57 137 10. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 57 138 11. Security Considerations . . . . . . . . . . . . . . . . . . . 58 139 12. References . . . . . . . . . . . . . . . . . . . . . . . . . 59 140 12.1. Normative References . . . . . . . . . . . . . . . . . . 59 141 12.2. Informative References . . . . . . . . . . . . . . . . . 63 142 Appendix A. Changes from RFC 8216 . . . . . . . . . . . . . . . 63 143 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 64 145 1. Introduction to HTTP Live Streaming 147 HTTP Live Streaming provides a reliable, cost-effective means of 148 delivering continuous and long-form video over the Internet. It 149 allows a receiver to adapt the bit rate of the media to the current 150 network conditions in order to maintain uninterrupted playback at the 151 best possible quality. It supports interstitial content boundaries. 152 It provides a flexible framework for media encryption. It can 153 efficiently offer multiple renditions of the same content, such as 154 audio translations. It offers compatibility with large-scale HTTP 155 caching infrastructure to support delivery to large audiences. 157 Since its first draft publication in 2009, HTTP Live Streaming has 158 been implemented and deployed by a wide array of content producers, 159 tools vendors, distributors, and device manufacturers. In the 160 subsequent eight years the protocol has been refined by extensive 161 review and discussion with a variety of media streaming implementors. 163 The purpose of this document is to facilitate interoperability 164 between HTTP Live Streaming implementations by describing the media 165 transmission protocol. Using this protocol, a client can receive a 166 continuous stream of media from a server for concurrent presentation. 168 This document describes version 8 of the protocol. 170 2. Overview 172 A multimedia presentation is specified by a Uniform Resource 173 Identifier (URI) [RFC3986] to a Playlist. 175 A Playlist is either a Media Playlist or a Master Playlist. Both are 176 UTF-8 text files containing URIs and descriptive tags. 178 A Media Playlist contains a list of Media Segments, which, when 179 played sequentially, will play the multimedia presentation. 181 Here is an example of a Media Playlist: 183 #EXTM3U 184 #EXT-X-TARGETDURATION:10 186 #EXTINF:9.009, 187 http://media.example.com/first.ts 188 #EXTINF:9.009, 189 http://media.example.com/second.ts 190 #EXTINF:3.003, 191 http://media.example.com/third.ts 193 The first line is the format identifier tag #EXTM3U. The line 194 containing #EXT-X-TARGETDURATION says that all Media Segments will be 195 10 seconds long or less. Then, three Media Segments are declared. 196 The first and second are 9.009 seconds long; the third is 3.003 197 seconds. 199 To play this Playlist, the client first downloads it and then 200 downloads and plays each Media Segment declared within it. The 201 client reloads the Playlist as described in this document to discover 202 any added segments. Data SHOULD be carried over HTTP [RFC7230], but, 203 in general, a URI can specify any protocol that can reliably transfer 204 the specified resource on demand. 206 A more complex presentation can be described by a Master Playlist. A 207 Master Playlist provides a set of Variant Streams, each of which 208 describes a different version of the same content. 210 A Variant Stream includes a Media Playlist that specifies media 211 encoded at a particular bit rate, in a particular format, and at a 212 particular resolution for media containing video. 214 A Variant Stream can also specify a set of Renditions. Renditions 215 are alternate versions of the content, such as audio produced in 216 different languages or video recorded from different camera angles. 218 Clients should switch between different Variant Streams to adapt to 219 network conditions. Clients should choose Renditions based on user 220 preferences. 222 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 223 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 224 "OPTIONAL" in this document are to be interpreted as described in BCP 225 14 [RFC2119] [RFC8174] when, and only when, they appear in all 226 capitals, as shown here. 228 3. Media Segments 230 A Media Playlist contains a series of Media Segments that make up the 231 overall presentation. A Media Segment is specified by a URI and 232 optionally a byte range. 234 The duration of each Media Segment is indicated in the Media Playlist 235 by its EXTINF tag (Section 4.4.2.1). 237 Each segment in a Media Playlist has a unique integer Media Sequence 238 Number. The Media Sequence Number of the first segment in the Media 239 Playlist is either 0 or declared in the Playlist (Section 4.4.3.2). 240 The Media Sequence Number of every other segment is equal to the 241 Media Sequence Number of the segment that precedes it plus one. 243 Each Media Segment MUST carry the continuation of the encoded 244 bitstream from the end of the segment with the previous Media 245 Sequence Number, where values in a series such as timestamps and 246 Continuity Counters MUST continue uninterrupted. The only exceptions 247 are the first Media Segment ever to appear in a Media Playlist and 248 Media Segments that are explicitly signaled as discontinuities 249 (Section 4.4.2.3). Unmarked media discontinuities can trigger 250 playback errors. 252 Any Media Segment that contains video SHOULD include enough 253 information to initialize a video decoder and decode a continuous set 254 of frames that includes the final frame in the Segment; network 255 efficiency is optimized if there is enough information in the Segment 256 to decode all frames in the Segment. For example, any Media Segment 257 containing H.264 video SHOULD contain an Instantaneous Decoding 258 Refresh (IDR); frames prior to the first IDR will be downloaded but 259 possibly discarded. 261 3.1. Supported Media Segment Formats 263 All Media Segments MUST be in a format described in this section. 264 Transport of other media file formats is not defined. 266 Some media formats require a common sequence of bytes to initialize a 267 parser before a Media Segment can be parsed. This format-specific 268 sequence is called the Media Initialization Section. The Media 269 Initialization Section can be specified by an EXT-X-MAP tag 270 (Section 4.4.2.5). The Media Initialization Section MUST NOT contain 271 sample data. 273 3.2. MPEG-2 Transport Streams 275 MPEG-2 Transport Streams are specified by [ISO_13818]. 277 The Media Initialization Section of an MPEG-2 Transport Stream 278 Segment is a Program Association Table (PAT) followed by a Program 279 Map Table (PMT). 281 Transport Stream Segments MUST contain a single MPEG-2 Program; 282 playback of Multi-Program Transport Streams is not defined. Each 283 Transport Stream Segment MUST contain a PAT and a PMT, or have an 284 EXT-X-MAP tag (Section 4.4.2.5) applied to it. The first two 285 Transport Stream packets in a Segment without an EXT-X-MAP tag SHOULD 286 be a PAT and a PMT. 288 3.3. Fragmented MPEG-4 290 MPEG-4 Fragments are specified by the ISO Base Media File Format 291 [ISOBMFF]. Unlike regular MPEG-4 files that have a Movie Box 292 ('moov') that contains sample tables and a Media Data Box ('mdat') 293 containing the corresponding samples, an MPEG-4 Fragment consists of 294 a Movie Fragment Box ('moof') containing a subset of the sample table 295 and a Media Data Box containing those samples. Use of MPEG-4 296 Fragments does require a Movie Box for initialization, but that Movie 297 Box contains only non-sample-specific information such as track and 298 sample descriptions. 300 A Fragmented MPEG-4 (fMP4) Segment is a "segment" as defined by 301 Section 3 of [ISOBMFF], including the constraints on Media Data Boxes 302 in Section 8.16 of [ISOBMFF]. 304 The Media Initialization Section for an fMP4 Segment is an ISO Base 305 Media File that can initialize a parser for that Segment. 307 Broadly speaking, fMP4 Segments and Media Initialization Sections are 308 [ISOBMFF] files that also satisfy the constraints described in this 309 section. 311 The Media Initialization Section for an fMP4 Segment MUST contain a 312 File Type Box ('ftyp') containing a brand that is compatible with 313 'iso6' or higher. The File Type Box MUST be followed by a Movie Box. 314 The Movie Box MUST contain a Track Box ('trak') for every Track 315 Fragment Box ('traf') in the fMP4 Segment, with matching track_ID. 316 Each Track Box SHOULD contain a sample table, but its sample count 317 MUST be zero. Movie Header Boxes ('mvhd') and Track Header Boxes 318 ('tkhd') MUST have durations of zero. The Movie Box MUST contain a 319 Movie Extends Box ('mvex'); it SHOULD follow the last Track Box. 321 Note that a Common Media Application Format [CMAF] Header meets all 322 these requirements. 324 In an fMP4 Segment, every Track Fragment Box MUST contain a Track 325 Fragment Decode Time Box ('tfdt'). fMP4 Segments MUST use movie- 326 fragment-relative addressing. fMP4 Segments MUST NOT use external 327 data references. Note that a CMAF Segment meets these requirements. 329 An fMP4 Segment in a Playlist containing the EXT-X-I-FRAMES-ONLY tag 330 (Section 4.4.3.6) MAY omit the portion of the Media Data Box 331 following the intra-coded frame (I-frame) sample data. 333 Each fMP4 Segment in a Media Playlist MUST have an EXT-X-MAP tag 334 applied to it. 336 3.4. Packed Audio 338 A Packed Audio Segment contains encoded audio samples and ID3 tags 339 that are simply packed together with minimal framing and no per- 340 sample timestamps. Supported Packed Audio formats are Advanced Audio 341 Coding (AAC) with Audio Data Transport Stream (ADTS) framing 342 [ISO_13818_7], MP3 [ISO_13818_3], AC-3 [AC_3], and Enhanced AC-3 343 [AC_3]. 345 A Packed Audio Segment has no Media Initialization Section. 347 Each Packed Audio Segment MUST signal the timestamp of its first 348 sample with an ID3 Private frame (PRIV) tag [ID3] at the beginning of 349 the segment. The ID3 PRIV owner identifier MUST be 350 "com.apple.streaming.transportStreamTimestamp". The ID3 payload MUST 351 be a 33-bit MPEG-2 Program Elementary Stream timestamp expressed as a 352 big-endian eight-octet number, with the upper 31 bits set to zero. 353 Clients SHOULD NOT play Packed Audio Segments without this ID3 tag. 355 3.5. WebVTT 357 A WebVTT Segment is a section of a WebVTT [WebVTT] file. WebVTT 358 Segments carry subtitles. 360 The Media Initialization Section of a WebVTT Segment is the WebVTT 361 header. 363 Each WebVTT Segment MUST contain all subtitle cues that are intended 364 to be displayed during the period indicated by the segment EXTINF 365 duration. The start time offset and end time offset of each cue MUST 366 indicate the total display time for that cue, even if part of the cue 367 time range is outside the Segment period. A WebVTT Segment MAY 368 contain no cues; this indicates that no subtitles are to be displayed 369 during that period. 371 Each WebVTT Segment MUST either start with a WebVTT header or have an 372 EXT-X-MAP tag applied to it. 374 In order to synchronize timestamps between audio/video and subtitles, 375 an X-TIMESTAMP-MAP metadata header SHOULD be added to each WebVTT 376 header. This header maps WebVTT cue timestamps to media timestamps 377 in other Renditions of the Variant Stream. Its format is: 379 X-TIMESTAMP-MAP=LOCAL:,MPEGTS: 380 e.g., X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000 382 indicating the media time to which the cue time MUST be mapped. The 383 cue timestamp in the LOCAL attribute MAY fall outside the range of 384 time covered by the segment. 386 The MPEGTS media timestamp MUST use a 90KHz timescale, even when non- 387 WebVTT Media Segments use a different timescale. 389 If a WebVTT segment does not have the X-TIMESTAMP-MAP, the client 390 MUST assume that the WebVTT cue time of 0 maps to an media timestamp 391 of 0. 393 When synchronizing WebVTT with PES timestamps, clients SHOULD account 394 for cases where the 33-bit PES timestamps have wrapped and the WebVTT 395 cue times have not. 397 3.6. IMSC Subtitles 399 An IMSC Segment is a Fragmented MPEG-4 (Section 3.3) Media Segment 400 that carries subtitle media according to MPEG-4 Part 30 401 [MP4_TIMED_TEXT]. This subtitle media MUST comply with the Text 402 Profile of IMSC1 [IMSC1]. 404 The Media Initialization Section of an IMSC Segment is specified in 405 Section 3.3. 407 Each IMSC Segment MUST contain all subtitle samples that are intended 408 to be displayed during the period indicated by the segment EXTINF 409 duration. Each Segment MUST contain definitions for all styles which 410 are applied to any part of any sample in the Segment. 412 4. Playlists 414 This section describes the Playlist files used by HTTP Live 415 Streaming. In this section, "MUST" and "MUST NOT" specify the rules 416 for the syntax and structure of legal Playlist files. Playlists that 417 violate these rules are invalid; clients MUST fail to parse them. 418 See Section 6.3.2. 420 The format of the Playlist files is derived from the M3U [M3U] 421 playlist file format and inherits two tags from that earlier file 422 format: EXTM3U (Section 4.4.1.1) and EXTINF (Section 4.4.2.1). 424 In the specification of tag syntax, a string enclosed by <> 425 identifies a tag parameter; its specific format is described in its 426 tag definition. If a parameter is further surrounded by [], it is 427 optional; otherwise, it is required. 429 Each Playlist file MUST be identifiable either by the path component 430 of its URI or by HTTP Content-Type. In the first case, the path MUST 431 end with either .m3u8 or .m3u. In the second, the HTTP Content-Type 432 MUST be "application/vnd.apple.mpegurl" or "audio/mpegurl". Clients 433 SHOULD refuse to parse Playlists that are not so identified. 435 4.1. Definition of a Playlist 437 Playlist files MUST be encoded in UTF-8 [RFC3629]. They MUST NOT 438 contain any Byte Order Mark (BOM); clients SHOULD fail to parse 439 Playlists that contain a BOM or do not parse as UTF-8. Playlist 440 files MUST NOT contain UTF-8 control characters (U+0000 to U+001F and 441 U+007F to U+009F), with the exceptions of CR (U+000D) and LF 442 (U+000A). All character sequences MUST be normalized according to 443 Unicode normalization form "NFC" [UNICODE]. Note that US-ASCII 444 [US_ASCII] conforms to these rules. 446 Lines in a Playlist file are terminated by either a single line feed 447 character or a carriage return character followed by a line feed 448 character. Each line is a URI, is blank, or starts with the 449 character '#'. Blank lines are ignored. Whitespace MUST NOT be 450 present, except for elements in which it is explicitly specified. 452 Lines that start with the character '#' are either comments or tags. 453 Tags begin with #EXT. They are case sensitive. All other lines that 454 begin with '#' are comments and SHOULD be ignored. 456 A URI line identifies a Media Segment or a Playlist file (see 457 Section 4.4.4.2). Each Media Segment is specified by a URI and the 458 tags that apply to it. 460 A Playlist is a Media Playlist if all URI lines in the Playlist 461 identify Media Segments. A Playlist is a Master Playlist if all URI 462 lines in the Playlist identify Media Playlists. A Playlist MUST be 463 either a Media Playlist or a Master Playlist; all other Playlists are 464 invalid. 466 A URI in a Playlist, whether it is a URI line or part of a tag, MAY 467 be relative. Any relative URI is considered to be relative to the 468 URI of the Playlist that contains it. 470 The duration of a Media Playlist is the sum of the durations of the 471 Media Segments within it. 473 The segment bit rate of a Media Segment is the size of the Media 474 Segment divided by its EXTINF duration (Section 4.4.2.1). Note that 475 this includes container overhead but does not include overhead 476 imposed by the delivery system, such as HTTP, TCP, or IP headers. 478 The peak segment bit rate of a Media Playlist is the largest bit rate 479 of any contiguous set of segments whose total duration is between 0.5 480 and 1.5 times the target duration. The bit rate of a set is 481 calculated by dividing the sum of the segment sizes by the sum of the 482 segment durations. 484 The average segment bit rate of a Media Playlist is the sum of the 485 sizes (in bits) of every Media Segment in the Media Playlist, divided 486 by the Media Playlist duration. Note that this includes container 487 overhead, but not HTTP or other overhead imposed by the delivery 488 system. 490 4.2. Attribute Lists 492 Certain tags have values that are attribute-lists. An attribute-list 493 is a comma-separated list of attribute/value pairs with no 494 whitespace. 496 An attribute/value pair has the following syntax: 498 AttributeName=AttributeValue 500 An AttributeName is an unquoted string containing characters from the 501 set [A..Z], [0..9], and '-'. Therefore, AttributeNames contain only 502 uppercase letters, not lowercase. There MUST NOT be any whitespace 503 between the AttributeName and the '=' character, nor between the '=' 504 character and the AttributeValue. 506 An AttributeValue is one of the following: 508 o decimal-integer: an unquoted string of characters from the set 509 [0..9] expressing an integer in base-10 arithmetic in the range 510 from 0 to 2^64-1 (18446744073709551615). A decimal-integer may be 511 from 1 to 20 characters long. 513 o hexadecimal-sequence: an unquoted string of characters from the 514 set [0..9] and [A..F] that is prefixed with 0x or 0X. The maximum 515 length of a hexadecimal-sequence depends on its AttributeNames. 517 o decimal-floating-point: an unquoted string of characters from the 518 set [0..9] and '.' that expresses a non-negative floating-point 519 number in decimal positional notation. 521 o signed-decimal-floating-point: an unquoted string of characters 522 from the set [0..9], '-', and '.' that expresses a signed 523 floating-point number in decimal positional notation. 525 o quoted-string: a string of characters within a pair of double 526 quotes (0x22). The following characters MUST NOT appear in a 527 quoted-string: line feed (0xA), carriage return (0xD), or double 528 quote (0x22). Quoted-string AttributeValues SHOULD be constructed 529 so that byte-wise comparison is sufficient to test two quoted- 530 string AttributeValues for equality. Note that this implies case- 531 sensitive comparison. 533 o enumerated-string: an unquoted character string from a set that is 534 explicitly defined by the AttributeName. An enumerated-string 535 will never contain double quotes ("), commas (,), or whitespace. 537 o decimal-resolution: two decimal-integers separated by the "x" 538 character. The first integer is a horizontal pixel dimension 539 (width); the second is a vertical pixel dimension (height). 541 The type of the AttributeValue for a given AttributeName is specified 542 by the attribute definition. 544 A given AttributeName MUST NOT appear more than once in a given 545 attribute-list. Clients SHOULD refuse to parse such Playlists. 547 4.3. Variable Substitution 549 The following Playlist elements are subject to variable substitution: 551 o URI lines 553 o quoted-string AttributeValues 555 o hexadecimal-sequence AttributeValues 556 A Variable Reference is a string of the form "{$" (0x7B,0x24) 557 followed by a Variable Name followed by "}" (0x7D). Variable Names 558 are defined by the EXT-X-DEFINE tag (Section 4.4.5.3). 560 See Section 6.3.1 for more information about variable substitution. 562 4.4. Playlist Tags 564 Playlist tags specify either global parameters of the Playlist or 565 information about the Media Segments or Media Playlists that appear 566 after them. 568 4.4.1. Basic Tags 570 These tags are allowed in both Media Playlists and Master Playlists. 572 4.4.1.1. EXTM3U 574 The EXTM3U tag indicates that the file is an Extended M3U [M3U] 575 Playlist file. It MUST be the first line of every Media Playlist and 576 every Master Playlist. Its format is: 578 #EXTM3U 580 4.4.1.2. EXT-X-VERSION 582 The EXT-X-VERSION tag indicates the compatibility version of the 583 Playlist file, its associated media, and its server. 585 The EXT-X-VERSION tag applies to the entire Playlist file. Its 586 format is: 588 #EXT-X-VERSION: 590 where n is an integer indicating the protocol compatibility version 591 number. 593 It MUST appear in all Playlists containing tags or attributes that 594 are not compatible with protocol version 1 to support 595 interoperability with older clients. Section 7 specifies the minimum 596 value of the compatibility version number for any given Playlist 597 file. 599 A Playlist file MUST NOT contain more than one EXT-X-VERSION tag. If 600 a client encounters a Playlist with multiple EXT-X-VERSION tags, it 601 MUST fail to parse it. 603 4.4.2. Media Segment Tags 605 Each Media Segment is specified by a series of Media Segment tags 606 followed by a URI. Some Media Segment tags apply to just the next 607 segment; others apply to all subsequent segments until another 608 instance of the same tag. 610 A Media Segment tag MUST NOT appear in a Master Playlist. Clients 611 MUST fail to parse Playlists that contain both Media Segment tags and 612 Master Playlist tags (Section 4.4.4). 614 4.4.2.1. EXTINF 616 The EXTINF tag specifies the duration of a Media Segment. It applies 617 only to the next Media Segment. This tag is REQUIRED for each Media 618 Segment. Its format is: 620 #EXTINF:,[] 622 where duration is a decimal-floating-point or decimal-integer number 623 (as described in Section 4.2) that specifies the duration of the 624 Media Segment in seconds. Durations SHOULD be decimal-floating- 625 point, with enough accuracy to avoid perceptible error when segment 626 durations are accumulated. However, if the compatibility version 627 number is less than 3, durations MUST be integers. Durations that 628 are reported as integers SHOULD be rounded to the nearest integer. 629 The remainder of the line following the comma is an optional human- 630 readable informative title of the Media Segment expressed as UTF-8 631 text. 633 4.4.2.2. EXT-X-BYTERANGE 635 The EXT-X-BYTERANGE tag indicates that a Media Segment is a sub-range 636 of the resource identified by its URI. It applies only to the next 637 URI line that follows it in the Playlist. Its format is: 639 #EXT-X-BYTERANGE:<n>[@<o>] 641 where n is a decimal-integer indicating the length of the sub-range 642 in bytes. If present, o is a decimal-integer indicating the start of 643 the sub-range, as a byte offset from the beginning of the resource. 644 If o is not present, the sub-range begins at the next byte following 645 the sub-range of the previous Media Segment. 647 If o is not present, a previous Media Segment MUST appear in the 648 Playlist file and MUST be a sub-range of the same media resource, or 649 the Media Segment is undefined and the client MUST fail to parse the 650 Playlist. 652 A Media Segment without an EXT-X-BYTERANGE tag consists of the entire 653 resource identified by its URI. 655 Use of the EXT-X-BYTERANGE tag REQUIRES a compatibility version 656 number of 4 or greater. 658 4.4.2.3. EXT-X-DISCONTINUITY 660 The EXT-X-DISCONTINUITY tag indicates a discontinuity between the 661 Media Segment that follows it and the one that preceded it. 663 Its format is: 665 #EXT-X-DISCONTINUITY 667 The EXT-X-DISCONTINUITY tag MUST be present if there is a change in 668 any of the following characteristics: 670 o file format 672 o number, type, and identifiers of tracks 674 o timestamp sequence 676 The EXT-X-DISCONTINUITY tag SHOULD be present if there is a change in 677 any of the following characteristics: 679 o encoding parameters 681 o encoding sequence 683 See Section 3, Section 6.2.1, and Section 6.3.3 for more information 684 about the EXT-X-DISCONTINUITY tag. 686 4.4.2.4. EXT-X-KEY 688 Media Segments MAY be encrypted. The EXT-X-KEY tag specifies how to 689 decrypt them. It applies to every Media Segment and to every Media 690 Initialization Section declared by an EXT-X-MAP tag that appears 691 between it and the next EXT-X-KEY tag in the Playlist file with the 692 same KEYFORMAT attribute (or the end of the Playlist file). Two or 693 more EXT-X-KEY tags with different KEYFORMAT attributes MAY apply to 694 the same Media Segment if they ultimately produce the same decryption 695 key. The format is: 697 #EXT-X-KEY:<attribute-list> 699 The following attributes are defined: 701 METHOD 703 The value is an enumerated-string that specifies the encryption 704 method. This attribute is REQUIRED. 706 The methods defined are: NONE, AES-128, and SAMPLE-AES. 708 An encryption method of NONE means that Media Segments are not 709 encrypted. If the encryption method is NONE, other attributes 710 MUST NOT be present. 712 An encryption method of AES-128 signals that Media Segments are 713 completely encrypted using the Advanced Encryption Standard (AES) 714 [AES_128] with a 128-bit key, Cipher Block Chaining (CBC), and 715 Public-Key Cryptography Standards #7 (PKCS7) padding [RFC5652]. 716 CBC is restarted on each segment boundary, using either the 717 Initialization Vector (IV) attribute value or the Media Sequence 718 Number as the IV; see Section 5.2. 720 An alternative to whole-segment encryption is Sample Encryption. 721 With Sample Encryption, only media sample data - such as audio 722 packets or video frames - is encrypted. The rest of the Media 723 Segment is unencrypted. Sample Encryption allows parts of the 724 Segment to be processed without (or before) decrypting the media 725 itself. 727 An encryption method of SAMPLE-AES means that the Media Segments 728 are Sample Encrypted using the Advanced Encryption Standard 729 [AES_128]. How these media streams are encrypted and encapsulated 730 in a segment depends on the media encoding and the media format of 731 the segment. fMP4 Media Segments are encrypted using the 'cbcs' 732 scheme of Common Encryption [COMMON_ENC]. Encryption of other 733 Media Segment formats containing H.264 [H_264], AAC [ISO_14496], 734 AC-3 [AC_3], and Enhanced AC-3 [AC_3] media streams is described 735 in the HTTP Live Streaming (HLS) Sample Encryption specification 736 [SampleEnc]. The IV attribute MAY be present; see Section 5.2. 738 URI 740 The value is a quoted-string containing a URI that specifies how 741 to obtain the key. This attribute is REQUIRED unless the METHOD 742 is NONE. 744 IV 746 The value is a hexadecimal-sequence that specifies a 128-bit 747 unsigned integer Initialization Vector to be used with the key. 749 Use of the IV attribute REQUIRES a compatibility version number of 750 2 or greater. See Section 5.2 for when the IV attribute is used. 752 KEYFORMAT 754 The value is a quoted-string that specifies how the key is 755 represented in the resource identified by the URI; see Section 5 756 for more detail. This attribute is OPTIONAL; its absence 757 indicates an implicit value of "identity". Use of the KEYFORMAT 758 attribute REQUIRES a compatibility version number of 5 or greater. 760 KEYFORMATVERSIONS 762 The value is a quoted-string containing one or more positive 763 integers separated by the "/" character (for example, "1", "1/2", 764 or "1/2/5"). If more than one version of a particular KEYFORMAT 765 is defined, this attribute can be used to indicate which 766 version(s) this instance complies with. This attribute is 767 OPTIONAL; if it is not present, its value is considered to be "1". 768 Use of the KEYFORMATVERSIONS attribute REQUIRES a compatibility 769 version number of 5 or greater. 771 If the Media Playlist file does not contain an EXT-X-KEY tag, then 772 Media Segments are not encrypted. 774 See Section 5 for the format of the Key file, and Section 5.2, 775 Section 6.2.3, and Section 6.3.6 for additional information on Media 776 Segment encryption. 778 4.4.2.5. EXT-X-MAP 780 The EXT-X-MAP tag specifies how to obtain the Media Initialization 781 Section (Section 3) required to parse the applicable Media Segments. 782 It applies to every Media Segment that appears after it in the 783 Playlist until the next EXT-X-MAP tag or until the end of the 784 Playlist. 786 Its format is: 788 #EXT-X-MAP:<attribute-list> 790 The following attributes are defined: 792 URI 794 The value is a quoted-string containing a URI that identifies a 795 resource that contains the Media Initialization Section. This 796 attribute is REQUIRED. 798 BYTERANGE 800 The value is a quoted-string specifying a byte range into the 801 resource identified by the URI attribute. This range SHOULD 802 contain only the Media Initialization Section. The format of the 803 byte range is described in Section 4.4.2.2. This attribute is 804 OPTIONAL; if it is not present, the byte range is the entire 805 resource indicated by the URI. 807 An EXT-X-MAP tag SHOULD be supplied for Media Segments in Playlists 808 with the EXT-X-I-FRAMES-ONLY tag when the first Media Segment (i.e., 809 I-frame) in the Playlist (or the first segment following an 810 EXT-X-DISCONTINUITY tag) does not immediately follow the Media 811 Initialization Section at the beginning of its resource. 813 Use of the EXT-X-MAP tag in a Media Playlist that contains the 814 EXT-X-I-FRAMES-ONLY tag REQUIRES a compatibility version number of 5 815 or greater. Use of the EXT-X-MAP tag in a Media Playlist that DOES 816 NOT contain the EXT-X-I-FRAMES-ONLY tag REQUIRES a compatibility 817 version number of 6 or greater. 819 If the Media Initialization Section declared by an EXT-X-MAP tag is 820 encrypted with a METHOD of AES-128, the IV attribute of the EXT-X-KEY 821 tag that applies to the EXT-X-MAP is REQUIRED. 823 4.4.2.6. EXT-X-PROGRAM-DATE-TIME 825 The EXT-X-PROGRAM-DATE-TIME tag associates the first sample of a 826 Media Segment with an absolute date and/or time. It applies only to 827 the next Media Segment. Its format is: 829 #EXT-X-PROGRAM-DATE-TIME:<date-time-msec> 831 where date-time-msec is an ISO/IEC 8601:2004 [ISO_8601] date/time 832 representation, such as YYYY-MM-DDThh:mm:ss.SSSZ. It SHOULD indicate 833 a time zone and fractional parts of seconds, to millisecond accuracy. 835 For example: 837 #EXT-X-PROGRAM-DATE-TIME:2010-02-19T14:54:23.031+08:00 839 See Section 6.2.1 and Section 6.3.3 for more information on the EXT-X 840 -PROGRAM-DATE-TIME tag. 842 4.4.2.7. EXT-X-DATERANGE 844 The EXT-X-DATERANGE tag associates a Date Range (i.e., a range of 845 time defined by a starting and ending date) with a set of attribute/ 846 value pairs. Its format is: 848 #EXT-X-DATERANGE:<attribute-list> 850 where the defined attributes are: 852 ID 854 A quoted-string that uniquely identifies a Date Range in the 855 Playlist. This attribute is REQUIRED. 857 CLASS 859 A client-defined quoted-string that specifies some set of 860 attributes and their associated value semantics. All Date Ranges 861 with the same CLASS attribute value MUST adhere to these 862 semantics. This attribute is OPTIONAL. 864 START-DATE 866 A quoted-string containing the ISO-8601 date at which the Date 867 Range begins. This attribute is REQUIRED. 869 END-DATE 871 A quoted-string containing the ISO-8601 date at which the Date 872 Range ends. It MUST be equal to or later than the value of the 873 START-DATE attribute. This attribute is OPTIONAL. 875 DURATION 877 The duration of the Date Range expressed as a decimal-floating- 878 point number of seconds. It MUST NOT be negative. A single 879 instant in time (e.g., crossing a finish line) SHOULD be 880 represented with a duration of 0. This attribute is OPTIONAL. 882 PLANNED-DURATION 884 The expected duration of the Date Range expressed as a decimal- 885 floating-point number of seconds. It MUST NOT be negative. This 886 attribute SHOULD be used to indicate the expected duration of a 887 Date Range whose actual duration is not yet known. It is 888 OPTIONAL. 890 X-<client-attribute> 892 The "X-" prefix defines a namespace reserved for client-defined 893 attributes. The client-attribute MUST be a legal AttributeName. 894 Clients SHOULD use a reverse-DNS syntax when defining their own 895 attribute names to avoid collisions. The attribute value MUST be 896 a quoted-string, a hexadecimal-sequence, or a decimal-floating- 897 point. An example of a client-defined attribute is X-COM-EXAMPLE- 898 AD-ID="XYZ123". These attributes are OPTIONAL. 900 SCTE35-CMD, SCTE35-OUT, SCTE35-IN 902 Used to carry SCTE-35 data; see Section 4.4.2.7.1 for more 903 information. These attributes are OPTIONAL. 905 END-ON-NEXT 907 An enumerated-string whose value MUST be YES. This attribute 908 indicates that the end of the range containing it is equal to the 909 START-DATE of its Following Range. The Following Range is the 910 Date Range of the same CLASS that has the earliest START-DATE 911 after the START-DATE of the range in question. This attribute is 912 OPTIONAL. 914 An EXT-X-DATERANGE tag with an END-ON-NEXT=YES attribute MUST have a 915 CLASS attribute. Other EXT-X-DATERANGE tags with the same CLASS 916 attribute MUST NOT specify Date Ranges that overlap. 918 An EXT-X-DATERANGE tag with an END-ON-NEXT=YES attribute MUST NOT 919 contain DURATION or END-DATE attributes. 921 A Date Range with neither a DURATION, an END-DATE, nor an END-ON- 922 NEXT=YES attribute has an unknown duration, even if it has a PLANNED- 923 DURATION. 925 If a Playlist contains an EXT-X-DATERANGE tag, it MUST also contain 926 at least one EXT-X-PROGRAM-DATE-TIME tag. 928 If a Playlist contains two EXT-X-DATERANGE tags with the same ID 929 attribute value, then any AttributeName that appears in both tags 930 MUST have the same AttributeValue. 932 If a Date Range contains both a DURATION attribute and an END-DATE 933 attribute, the value of the END-DATE attribute MUST be equal to the 934 value of the START-DATE attribute plus the value of the DURATION 935 attribute. 937 Clients SHOULD ignore EXT-X-DATERANGE tags with illegal syntax. 939 4.4.2.7.1. Mapping SCTE-35 into EXT-X-DATERANGE 941 Splice information carried in source media according to the SCTE-35 942 specification [SCTE35] MAY be represented in a Media Playlist using 943 EXT-X-DATERANGE tags. 945 Each SCTE-35 splice_info_section() containing a splice_null(), 946 splice_schedule(), bandwidth_reservation(), or private_cmd() SHOULD 947 be represented by an EXT-X-DATERANGE tag with an SCTE35-CMD attribute 948 whose value is the big-endian binary representation of the 949 splice_info_section(), expressed as a hexadecimal-sequence. 951 An SCTE-35 splice out/in pair signaled by a pair of splice_insert() 952 commands SHOULD be represented by one or more EXT-X-DATERANGE tags 953 carrying the same ID attribute, which MUST be unique to that splice 954 out/in pair. The "out" splice_info_section() (with 955 out_of_network_indicator set to 1) MUST be placed in an SCTE35-OUT 956 attribute, with the same formatting as SCTE35-CMD. The "in" 957 splice_info_section() (with out_of_network_indicator set to 0) MUST 958 be placed in an SCTE35-IN attribute, with the same formatting as 959 SCTE35-CMD. 961 An SCTE-35 splice out/in pair signaled by a pair of time_signal() 962 commands, each carrying a single segmentation_descriptor(), SHOULD be 963 represented by one or more EXT-X-DATERANGE tags carrying the same ID 964 attribute, which MUST be unique to that splice out/in pair. The 965 "out" splice_info_section() MUST be placed in an SCTE35-OUT 966 attribute; the "in" splice_info_section() MUST be placed in an 967 SCTE35-IN attribute. 969 Different types of segmentation, as indicated by the 970 segmentation_type_id in the segmentation_descriptor(), SHOULD be 971 represented by separate EXT-X-DATERANGE tags, even if two or more 972 segmentation_descriptor()s arrive in the same splice_info_section(). 973 In that case, each EXT-X-DATERANGE tag will have an SCTE35-OUT, 974 SCTE35-IN, or SCTE35-CMD attribute whose value is the entire 975 splice_info_section(). 977 An SCTE-35 time_signal() command that does not signal a splice out or 978 in point SHOULD be represented by an EXT-X-DATERANGE tag with an 979 SCTE35-CMD attribute. 981 The START-DATE of an EXT-X-DATERANGE tag containing an SCTE35-OUT 982 attribute MUST be the date and time that corresponds to the program 983 time of that splice. 985 The START-DATE of an EXT-X-DATERANGE tag containing an SCTE35-CMD 986 MUST be the date and time specified by the splice_time() in the 987 command or the program time at which the command appeared in the 988 source stream if the command does not specify a splice_time(). 990 An EXT-X-DATERANGE tag containing an SCTE35-OUT attribute MAY contain 991 a PLANNED-DURATION attribute. Its value MUST be the planned duration 992 of the splice. 994 The DURATION of an EXT-X-DATERANGE tag containing an SCTE35-IN 995 attribute MUST be the actual (not planned) program duration between 996 the corresponding out-point and that in-point. 998 The END-DATE of an EXT-X-DATERANGE tag containing an SCTE35-IN 999 attribute MUST be the actual (not planned) program date and time of 1000 that in-point. 1002 If the actual end date and time is not known when an SCTE35-OUT 1003 attribute is added to the Playlist, the DURATION attribute and the 1004 END-TIME attribute MUST NOT be present; the actual end date of the 1005 splice SHOULD be signaled by another EXT-X-DATERANGE tag once it has 1006 been established. 1008 A canceled splice SHOULD NOT appear in the Playlist as an 1009 EXT-X-DATERANGE tag. 1011 An EXT-X-DATERANGE tag announcing a splice SHOULD be added to a 1012 Playlist at the same time as the last pre-splice Media Segment, or 1013 earlier if possible. 1015 The ID attribute of an EXT-X-DATERANGE tag MAY contain a 1016 splice_event_id and/or a segmentation_event_id, but it MUST be unique 1017 in the Playlist. If there is a possibility that an SCTE-35 id will 1018 be reused, the ID attribute value MUST include disambiguation, such 1019 as a date or sequence number. 1021 4.4.2.8. EXT-X-GAP 1023 The EXT-X-GAP tag indicates that the segment URL to which it applies 1024 does not contain media data and SHOULD NOT be loaded by clients. It 1025 applies only to the next Media Segment. 1027 Its format is: 1029 #EXT-X-GAP 1031 See Section 6.2.1 and Section 6.3.3 for more information on the 1032 EXT-X-GAP tag. 1034 4.4.2.9. EXT-X-BITRATE 1036 The EXT-X-BITRATE tag identifies the approximate segment bit rate of 1037 the Media Segment(s) to which it applies. It applies to every Media 1038 Segment between it and the next EXT-X-BITRATE tag in the Playlist 1039 file (or the end of the Playlist file) that does not have an 1040 EXT-X-BYTERANGE tag applied to it. Its format is: 1042 #EXT-X-BITRATE:<rate> 1044 where rate is a decimal-integer of kilobits per second. 1046 This tag is OPTIONAL. If it is present then its value MUST be no 1047 less than 90% of the segment bit rate of each Media Segment to which 1048 it is applied and no greater than 110% of the segment bit rate of 1049 each Media Segment to which it is applied. 1051 4.4.3. Media Playlist Tags 1053 Media Playlist tags describe global parameters of the Media Playlist. 1054 There MUST NOT be more than one Media Playlist tag of each type in 1055 any Media Playlist. 1057 A Media Playlist tag MUST NOT appear in a Master Playlist 1059 4.4.3.1. EXT-X-TARGETDURATION 1061 The EXT-X-TARGETDURATION tag specifies the maximum Media Segment 1062 duration. The EXTINF duration of each Media Segment in the Playlist 1063 file, when rounded to the nearest integer, MUST be less than or equal 1064 to the target duration; longer segments can trigger playback stalls 1065 or other errors. It applies to the entire Playlist file. Its format 1066 is: 1068 #EXT-X-TARGETDURATION:<s> 1070 where s is a decimal-integer indicating the target duration in 1071 seconds. The EXT-X-TARGETDURATION tag is REQUIRED. 1073 4.4.3.2. EXT-X-MEDIA-SEQUENCE 1075 The EXT-X-MEDIA-SEQUENCE tag indicates the Media Sequence Number of 1076 the first Media Segment that appears in a Playlist file. Its format 1077 is: 1079 #EXT-X-MEDIA-SEQUENCE:<number> 1081 where number is a decimal-integer. 1083 If the Media Playlist file does not contain an EXT-X-MEDIA-SEQUENCE 1084 tag, then the Media Sequence Number of the first Media Segment in the 1085 Media Playlist SHALL be considered to be 0. A client MUST NOT assume 1086 that segments with the same Media Sequence Number in different Media 1087 Playlists contain matching content (see Section 6.3.2). 1089 A URI for a Media Segment is not required to contain its Media 1090 Sequence Number. 1092 See Section 6.2.1 and Section 6.3.5 for more information on setting 1093 the EXT-X-MEDIA-SEQUENCE tag. 1095 The EXT-X-MEDIA-SEQUENCE tag MUST appear before the first Media 1096 Segment in the Playlist. 1098 4.4.3.3. EXT-X-DISCONTINUITY-SEQUENCE 1100 The EXT-X-DISCONTINUITY-SEQUENCE tag allows synchronization between 1101 different Renditions of the same Variant Stream or different Variant 1102 Streams that have EXT-X-DISCONTINUITY tags in their Media Playlists. 1104 Its format is: 1106 #EXT-X-DISCONTINUITY-SEQUENCE:<number> 1108 where number is a decimal-integer. 1110 If the Media Playlist does not contain an EXT-X-DISCONTINUITY- 1111 SEQUENCE tag, then the Discontinuity Sequence Number of the first 1112 Media Segment in the Playlist SHALL be considered to be 0. 1114 The EXT-X-DISCONTINUITY-SEQUENCE tag MUST appear before the first 1115 Media Segment in the Playlist. 1117 The EXT-X-DISCONTINUITY-SEQUENCE tag MUST appear before any 1118 EXT-X-DISCONTINUITY tag. 1120 See Section 6.2.1 and Section 6.2.2 for more information about 1121 setting the value of the EXT-X-DISCONTINUITY-SEQUENCE tag. 1123 4.4.3.4. EXT-X-ENDLIST 1125 The EXT-X-ENDLIST tag indicates that no more Media Segments will be 1126 added to the Media Playlist file. It MAY occur anywhere in the Media 1127 Playlist file. Its format is: 1129 #EXT-X-ENDLIST 1131 4.4.3.5. EXT-X-PLAYLIST-TYPE 1133 The EXT-X-PLAYLIST-TYPE tag provides mutability information about the 1134 Media Playlist file. It applies to the entire Media Playlist file. 1135 It is OPTIONAL. Its format is: 1137 #EXT-X-PLAYLIST-TYPE:<type-enum> 1139 where type-enum is either EVENT or VOD. 1141 Section 6.2.1 defines the implications of the EXT-X-PLAYLIST-TYPE 1142 tag. 1144 If the EXT-X-PLAYLIST-TYPE value is EVENT, Media Segments can only be 1145 added to the end of the Media Playlist. If the EXT-X-PLAYLIST-TYPE 1146 value is Video On Demand (VOD), the Media Playlist cannot change. 1148 If the EXT-X-PLAYLIST-TYPE tag is omitted from a Media Playlist, the 1149 Playlist can be updated according to the rules in Section 6.2.1 with 1150 no additional restrictions. For example, a live Playlist 1151 (Section 6.2.2) MAY be updated to remove Media Segments in the order 1152 that they appeared. 1154 4.4.3.6. EXT-X-I-FRAMES-ONLY 1156 The EXT-X-I-FRAMES-ONLY tag indicates that each Media Segment in the 1157 Playlist describes a single I-frame. I-frames are encoded video 1158 frames whose decoding does not depend on any other frame. I-frame 1159 Playlists can be used for trick play, such as fast forward, rapid 1160 reverse, and scrubbing. 1162 The EXT-X-I-FRAMES-ONLY tag applies to the entire Playlist. Its 1163 format is: 1165 #EXT-X-I-FRAMES-ONLY 1167 In a Playlist with the EXT-X-I-FRAMES-ONLY tag, the Media Segment 1168 duration (EXTINF tag value) is the time between the presentation time 1169 of the I-frame in the Media Segment and the presentation time of the 1170 next I-frame in the Playlist, or the end of the presentation if it is 1171 the last I-frame in the Playlist. 1173 Media resources containing I-frame segments MUST begin with either a 1174 Media Initialization Section (Section 3) or be accompanied by an 1175 EXT-X-MAP tag indicating the Media Initialization Section so that 1176 clients can load and decode I-frame segments in any order. The byte 1177 range of an I-frame segment with an EXT-X-BYTERANGE tag applied to it 1178 (Section 4.4.2.2) MUST NOT include its Media Initialization Section; 1179 clients can assume that the Media Initialization Section is defined 1180 by the EXT-X-MAP tag, or is located between the start of the resource 1181 and the offset of the first I-frame segment in that resource. 1183 Use of the EXT-X-I-FRAMES-ONLY REQUIRES a compatibility version 1184 number of 4 or greater. 1186 4.4.4. Master Playlist Tags 1188 Master Playlist tags define the Variant Streams, Renditions, and 1189 other global parameters of the presentation. 1191 Master Playlist tags MUST NOT appear in a Media Playlist; clients 1192 MUST fail to parse any Playlist that contains both a Master Playlist 1193 tag and either a Media Playlist tag or a Media Segment tag. 1195 4.4.4.1. EXT-X-MEDIA 1197 The EXT-X-MEDIA tag is used to relate Media Playlists that contain 1198 alternative Renditions (Section 4.4.4.2.1) of the same content. For 1199 example, three EXT-X-MEDIA tags can be used to identify audio-only 1200 Media Playlists that contain English, French, and Spanish Renditions 1201 of the same presentation. Or, two EXT-X-MEDIA tags can be used to 1202 identify video-only Media Playlists that show two different camera 1203 angles. 1205 Its format is: 1207 #EXT-X-MEDIA:<attribute-list> 1209 The following attributes are defined: 1211 TYPE 1213 The value is an enumerated-string; valid strings are AUDIO, VIDEO, 1214 SUBTITLES, and CLOSED-CAPTIONS. This attribute is REQUIRED. 1216 Typically, closed-caption [CEA608] media is carried in the video 1217 stream. Therefore, an EXT-X-MEDIA tag with TYPE of CLOSED- 1218 CAPTIONS does not specify a Rendition; the closed-caption media is 1219 present in the Media Segments of every video Rendition. 1221 URI 1223 The value is a quoted-string containing a URI that identifies the 1224 Media Playlist file. This attribute is OPTIONAL; see 1225 Section 4.4.4.2.1. If the TYPE is CLOSED-CAPTIONS, the URI 1226 attribute MUST NOT be present. 1228 GROUP-ID 1230 The value is a quoted-string that specifies the group to which the 1231 Rendition belongs. See Section 4.4.4.1.1. This attribute is 1232 REQUIRED. 1234 LANGUAGE 1236 The value is a quoted-string containing one of the standard Tags 1237 for Identifying Languages [RFC5646], which identifies the primary 1238 language used in the Rendition. This attribute is OPTIONAL. 1240 ASSOC-LANGUAGE 1242 The value is a quoted-string containing a language tag [RFC5646] 1243 that identifies a language that is associated with the Rendition. 1244 An associated language is often used in a different role than the 1245 language specified by the LANGUAGE attribute (e.g., written versus 1246 spoken, or a fallback dialect). This attribute is OPTIONAL. 1248 The LANGUAGE and ASSOC-LANGUAGE attributes can be used, for 1249 example, to link Norwegian Renditions that use different spoken 1250 and written languages. 1252 NAME 1254 The value is a quoted-string containing a human-readable 1255 description of the Rendition. If the LANGUAGE attribute is 1256 present, then this description SHOULD be in that language. This 1257 attribute is REQUIRED. 1259 DEFAULT 1261 The value is an enumerated-string; valid strings are YES and NO. 1262 If the value is YES, then the client SHOULD play this Rendition of 1263 the content in the absence of information from the user indicating 1264 a different choice. This attribute is OPTIONAL. Its absence 1265 indicates an implicit value of NO. 1267 AUTOSELECT 1269 The value is an enumerated-string; valid strings are YES and NO. 1270 This attribute is OPTIONAL. Its absence indicates an implicit 1271 value of NO. If the value is YES, then the client MAY choose to 1272 play this Rendition in the absence of explicit user preference 1273 because it matches the current playback environment, such as 1274 chosen system language. 1276 If the AUTOSELECT attribute is present, its value MUST be YES if 1277 the value of the DEFAULT attribute is YES. 1279 FORCED 1281 The value is an enumerated-string; valid strings are YES and NO. 1282 This attribute is OPTIONAL. Its absence indicates an implicit 1283 value of NO. The FORCED attribute MUST NOT be present unless the 1284 TYPE is SUBTITLES. 1286 A value of YES indicates that the Rendition contains content that 1287 is considered essential to play. When selecting a FORCED 1288 Rendition, a client SHOULD choose the one that best matches the 1289 current playback environment (e.g., language). 1291 A value of NO indicates that the Rendition contains content that 1292 is intended to be played in response to explicit user request. 1294 INSTREAM-ID 1296 The value is a quoted-string that specifies a Rendition within the 1297 segments in the Media Playlist. This attribute is REQUIRED if the 1298 TYPE attribute is CLOSED-CAPTIONS, in which case it MUST have one 1299 of the values: "CC1", "CC2", "CC3", "CC4", or "SERVICEn" where n 1300 MUST be an integer between 1 and 63 (e.g., "SERVICE9" or 1301 "SERVICE42"). 1303 The values "CC1", "CC2", "CC3", and "CC4" identify a Line 21 Data 1304 Services channel [CEA608]. The "SERVICE" values identify a 1305 Digital Television Closed Captioning [CEA708] service block 1306 number. 1308 For all other TYPE values, the INSTREAM-ID MUST NOT be specified. 1310 CHARACTERISTICS 1312 The value is a quoted-string containing one or more Uniform Type 1313 Identifiers [UTI] separated by comma (,) characters. This 1314 attribute is OPTIONAL. Each UTI indicates an individual 1315 characteristic of the Rendition. 1317 A SUBTITLES Rendition MAY include the following characteristics: 1318 "public.accessibility.transcribes-spoken-dialog", 1319 "public.accessibility.describes-music-and-sound", and "public 1320 .easy-to-read" (which indicates that the subtitles have been 1321 edited for ease of reading). 1323 An AUDIO Rendition MAY include the following characteristic: 1324 "public.accessibility.describes-video". 1326 The CHARACTERISTICS attribute MAY include private UTIs. 1328 CHANNELS 1330 The value is a quoted-string that specifies an ordered, slash- 1331 separated ("/") list of parameters. 1333 If the TYPE attribute is AUDIO, then the first parameter is a 1334 count of audio channels expressed as a decimal-integer, indicating 1335 the maximum number of independent, simultaneous audio channels 1336 present in any Media Segment in the Rendition. For example, an 1337 AC-3 5.1 Rendition would have a CHANNELS="6" attribute. 1339 If the TYPE attribute is AUDIO, then the second parameter 1340 identifies the encoding of object-based audio used by the 1341 Rendition. This parameter is a comma-separated list of Audio 1342 Object Coding Identifiers. It is optional. An Audio Object 1343 Coding Identifier is a string containing characters from the set 1344 [A..Z], [0..9], and '-'. They are codec-specific. A parameter 1345 value of consisting solely of the dash character (0x2D) indicates 1346 that the audio is not object-based. 1348 No other CHANNELS parameters are currently defined. 1350 All audio EXT-X-MEDIA tags SHOULD have a CHANNELS attribute. If a 1351 Master Playlist contains two Renditions with the same NAME encoded 1352 with the same codec but a different number of channels, then the 1353 CHANNELS attribute is REQUIRED; otherwise, it is OPTIONAL. 1355 4.4.4.1.1. Rendition Groups 1357 A set of one or more EXT-X-MEDIA tags with the same GROUP-ID value 1358 and the same TYPE value defines a Group of Renditions. Each member 1359 of the Group MUST be an alternative Rendition of the same content; 1360 otherwise, playback errors can occur. 1362 All EXT-X-MEDIA tags in a Playlist MUST meet the following 1363 constraints: 1365 o All EXT-X-MEDIA tags in the same Group MUST have different NAME 1366 attributes. 1368 o A Group MUST NOT have more than one member with a DEFAULT 1369 attribute of YES. 1371 o Each EXT-X-MEDIA tag with an AUTOSELECT=YES attribute SHOULD have 1372 a combination of LANGUAGE [RFC5646], ASSOC-LANGUAGE, FORCED, and 1373 CHARACTERISTICS attributes that is distinct from those of other 1374 AUTOSELECT=YES members of its Group. 1376 A Playlist MAY contain multiple Groups of the same TYPE in order to 1377 provide multiple encodings of that media type. If it does so, each 1378 Group of the same TYPE MUST have the same set of members, and each 1379 corresponding member MUST have identical attributes with the 1380 exception of the URI and CHANNELS attributes. 1382 Each member in a Group of Renditions MAY have a different sample 1383 format. For example, an English Rendition can be encoded with AC-3 1384 5.1 while a Spanish Rendition is encoded with AAC stereo. However, 1385 any EXT-X-STREAM-INF tag (Section 4.4.4.2) or EXT-X-I-FRAME-STREAM- 1386 INF tag (Section 4.4.4.3) that references such a Group MUST have a 1387 CODECS attribute that lists every sample format present in any 1388 Rendition in the Group, or client playback failures can occur. In 1389 the example above, the CODECS attribute would include 1390 "ac-3,mp4a.40.2". 1392 4.4.4.2. EXT-X-STREAM-INF 1394 The EXT-X-STREAM-INF tag specifies a Variant Stream, which is a set 1395 of Renditions that can be combined to play the presentation. The 1396 attributes of the tag provide information about the Variant Stream. 1398 The URI line that follows the EXT-X-STREAM-INF tag specifies a Media 1399 Playlist that carries a Rendition of the Variant Stream. The URI 1400 line is REQUIRED. Clients that do not support multiple video 1401 Renditions SHOULD play this Rendition. 1403 Its format is: 1405 #EXT-X-STREAM-INF:<attribute-list> 1406 <URI> 1408 The following attributes are defined: 1410 BANDWIDTH 1412 The value is a decimal-integer of bits per second. It represents 1413 the peak segment bit rate of the Variant Stream. 1415 If all the Media Segments in a Variant Stream have already been 1416 created, the BANDWIDTH value MUST be the largest sum of peak 1417 segment bit rates that is produced by any playable combination of 1418 Renditions. (For a Variant Stream with a single Media Playlist, 1419 this is just the peak segment bit rate of that Media Playlist.) 1420 An inaccurate value can cause playback stalls or prevent clients 1421 from playing the variant. 1423 If the Master Playlist is to be made available before all Media 1424 Segments in the presentation have been encoded, the BANDWIDTH 1425 value SHOULD be the BANDWIDTH value of a representative period of 1426 similar content, encoded using the same settings. 1428 Every EXT-X-STREAM-INF tag MUST include the BANDWIDTH attribute. 1430 AVERAGE-BANDWIDTH 1432 The value is a decimal-integer of bits per second. It represents 1433 the average segment bit rate of the Variant Stream. 1435 If all the Media Segments in a Variant Stream have already been 1436 created, the AVERAGE-BANDWIDTH value MUST be the largest sum of 1437 average segment bit rates that is produced by any playable 1438 combination of Renditions. (For a Variant Stream with a single 1439 Media Playlist, this is just the average segment bit rate of that 1440 Media Playlist.) An inaccurate value can cause playback stalls or 1441 prevent clients from playing the variant. 1443 If the Master Playlist is to be made available before all Media 1444 Segments in the presentation have been encoded, the AVERAGE- 1445 BANDWIDTH value SHOULD be the AVERAGE-BANDWIDTH value of a 1446 representative period of similar content, encoded using the same 1447 settings. 1449 The AVERAGE-BANDWIDTH attribute is OPTIONAL. 1451 CODECS 1453 The value is a quoted-string containing a comma-separated list of 1454 formats, where each format specifies a media sample type that is 1455 present in one or more Renditions specified by the Variant Stream. 1456 Valid format identifiers are those in the ISO Base Media File 1457 Format Name Space defined by "The 'Codecs' and 'Profiles' 1458 Parameters for "Bucket" Media Types" [RFC6381]. 1460 For example, a stream containing AAC low complexity (AAC-LC) audio 1461 and H.264 Main Profile Level 3.0 video would have a CODECS value 1462 of "mp4a.40.2,avc1.4d401e". 1464 Note that if a Variant Stream specifies one or more Renditions 1465 that include IMSC subtitles, the CODECS attribute MUST indicate 1466 this with a format identifier such as "stpp.ttml.im1t". 1468 Every EXT-X-STREAM-INF tag SHOULD include a CODECS attribute. 1470 RESOLUTION 1472 The value is a decimal-resolution describing the optimal pixel 1473 resolution at which to display all the video in the Variant 1474 Stream. 1476 The RESOLUTION attribute is OPTIONAL but is recommended if the 1477 Variant Stream includes video. 1479 FRAME-RATE 1481 The value is a decimal-floating-point describing the maximum frame 1482 rate for all the video in the Variant Stream, rounded to three 1483 decimal places. 1485 The FRAME-RATE attribute is OPTIONAL but is recommended if the 1486 Variant Stream includes video. The FRAME-RATE attribute SHOULD be 1487 included if any video in a Variant Stream exceeds 30 frames per 1488 second. 1490 HDCP-LEVEL 1492 The value is an enumerated-string; valid strings are TYPE-0, 1493 TYPE-1, and NONE. This attribute is advisory. A value of TYPE-0 1494 indicates that the Variant Stream could fail to play unless the 1495 output is protected by High-bandwidth Digital Content Protection 1496 (HDCP) Type 0 [HDCP] or equivalent. A value of TYPE-1 indicates 1497 that the Variant Stream could fail to play unless the output is 1498 protected by HDCP Type 1 or equivalent. A value of NONE indicates 1499 that the content does not require output copy protection. 1501 Encrypted Variant Streams with different HDCP levels SHOULD use 1502 different media encryption keys. 1504 The HDCP-LEVEL attribute is OPTIONAL. It SHOULD be present if any 1505 content in the Variant Stream will fail to play without HDCP. 1506 Clients without output copy protection SHOULD NOT load a Variant 1507 Stream with an HDCP-LEVEL attribute unless its value is NONE. 1509 VIDEO-RANGE 1511 The value is an enumerated-string; valid strings are SDR and PQ. 1513 The value MUST be SDR if all the video in the Variant Stream is 1514 encoded using a reference opto-electronic transfer characteristic 1515 function specified by the TransferCharacteristics code point 1 1516 [CICP]. 1518 The value MUST be PQ if video in the Variant Stream includes some 1519 content that is encoded using a reference opto-electronic transfer 1520 characteristic function specified by the TransferCharacteristics 1521 code point 16 or 18, and potentially other content qualifying as 1522 SDR (see above). Note that certain TransferCharacteristics code 1523 points use the same transfer function. 1525 Otherwise the attribute MUST NOT be present. 1527 AUDIO 1529 The value is a quoted-string. It MUST match the value of the 1530 GROUP-ID attribute of an EXT-X-MEDIA tag elsewhere in the Master 1531 Playlist whose TYPE attribute is AUDIO. It indicates the set of 1532 audio Renditions that SHOULD be used when playing the 1533 presentation. See Section 4.4.4.2.1. 1535 The AUDIO attribute is OPTIONAL. 1537 VIDEO 1539 The value is a quoted-string. It MUST match the value of the 1540 GROUP-ID attribute of an EXT-X-MEDIA tag elsewhere in the Master 1541 Playlist whose TYPE attribute is VIDEO. It indicates the set of 1542 video Renditions that SHOULD be used when playing the 1543 presentation. See Section 4.4.4.2.1. 1545 The VIDEO attribute is OPTIONAL. 1547 SUBTITLES 1549 The value is a quoted-string. It MUST match the value of the 1550 GROUP-ID attribute of an EXT-X-MEDIA tag elsewhere in the Master 1551 Playlist whose TYPE attribute is SUBTITLES. It indicates the set 1552 of subtitle Renditions that can be used when playing the 1553 presentation. See Section 4.4.4.2.1. 1555 The SUBTITLES attribute is OPTIONAL. 1557 CLOSED-CAPTIONS 1559 The value can be either a quoted-string or an enumerated-string 1560 with the value NONE. If the value is a quoted-string, it MUST 1561 match the value of the GROUP-ID attribute of an EXT-X-MEDIA tag 1562 elsewhere in the Playlist whose TYPE attribute is CLOSED-CAPTIONS, 1563 and it indicates the set of closed-caption Renditions that can be 1564 used when playing the presentation. See Section 4.4.4.2.1. 1566 If the value is the enumerated-string value NONE, all EXT-X 1567 -STREAM-INF tags MUST have this attribute with a value of NONE, 1568 indicating that there are no closed captions in any Variant Stream 1569 in the Master Playlist. Having closed captions in one Variant 1570 Stream but not another can trigger playback inconsistencies. 1572 The CLOSED-CAPTIONS attribute is OPTIONAL. 1574 4.4.4.2.1. Alternative Renditions 1576 When an EXT-X-STREAM-INF tag contains an AUDIO, VIDEO, SUBTITLES, or 1577 CLOSED-CAPTIONS attribute, it indicates that alternative Renditions 1578 of the content are available for playback of that Variant Stream. 1580 When defining alternative Renditions, the following constraints MUST 1581 be met to prevent client playback errors: 1583 o All playable combinations of Renditions associated with an EXT-X 1584 -STREAM-INF tag MUST have an aggregate bandwidth less than or 1585 equal to the BANDWIDTH attribute of the EXT-X-STREAM-INF tag. 1587 o If an EXT-X-STREAM-INF tag contains a RESOLUTION attribute and a 1588 VIDEO attribute, then every alternative video Rendition MUST have 1589 an optimal display resolution matching the value of the RESOLUTION 1590 attribute. 1592 o Every alternative Rendition associated with an EXT-X-STREAM-INF 1593 tag MUST meet the constraints for a Variant Stream described in 1594 Section 6.2.4. 1596 The URI attribute of the EXT-X-MEDIA tag is REQUIRED if the media 1597 type is SUBTITLES, but OPTIONAL if the media type is VIDEO or AUDIO. 1598 If the media type is VIDEO or AUDIO, a missing URI attribute 1599 indicates that the media data for this Rendition is included in the 1600 Media Playlist of any EXT-X-STREAM-INF tag referencing this 1601 EXT-X-MEDIA tag. If the media TYPE is AUDIO and the URI attribute is 1602 missing, clients MUST assume that the audio data for this Rendition 1603 is present in every video Rendition specified by the EXT-X-STREAM-INF 1604 tag. 1606 The URI attribute of the EXT-X-MEDIA tag MUST NOT be included if the 1607 media type is CLOSED-CAPTIONS. 1609 4.4.4.3. EXT-X-I-FRAME-STREAM-INF 1611 The EXT-X-I-FRAME-STREAM-INF tag identifies a Media Playlist file 1612 containing the I-frames of a multimedia presentation. It stands 1613 alone, in that it does not apply to a particular URI in the Master 1614 Playlist. Its format is: 1616 #EXT-X-I-FRAME-STREAM-INF:<attribute-list> 1618 All attributes defined for the EXT-X-STREAM-INF tag (Section 4.4.4.2) 1619 are also defined for the EXT-X-I-FRAME-STREAM-INF tag, except for the 1620 FRAME-RATE, AUDIO, SUBTITLES, and CLOSED-CAPTIONS attributes. In 1621 addition, the following attribute is defined: 1623 URI 1625 The value is a quoted-string containing a URI that identifies the 1626 I-frame Media Playlist file. That Playlist file MUST contain an 1627 EXT-X-I-FRAMES-ONLY tag. 1629 Every EXT-X-I-FRAME-STREAM-INF tag MUST include a BANDWIDTH attribute 1630 and a URI attribute. 1632 The provisions in Section 4.4.4.2.1 also apply to EXT-X-I-FRAME- 1633 STREAM-INF tags with a VIDEO attribute. 1635 A Master Playlist that specifies alternative VIDEO Renditions and 1636 I-frame Playlists SHOULD include an alternative I-frame VIDEO 1637 Rendition for each regular VIDEO Rendition, with the same NAME and 1638 LANGUAGE attributes. 1640 4.4.4.4. EXT-X-SESSION-DATA 1642 The EXT-X-SESSION-DATA tag allows arbitrary session data to be 1643 carried in a Master Playlist. 1645 Its format is: 1647 #EXT-X-SESSION-DATA:<attribute-list> 1649 The following attributes are defined: 1651 DATA-ID 1653 The value of DATA-ID is a quoted-string that identifies a 1654 particular data value. The DATA-ID SHOULD conform to a reverse 1655 DNS naming convention, such as "com.example.movie.title"; however, 1656 there is no central registration authority, so Playlist authors 1657 SHOULD take care to choose a value that is unlikely to collide 1658 with others. This attribute is REQUIRED. 1660 VALUE 1662 VALUE is a quoted-string. It contains the data identified by 1663 DATA-ID. If the LANGUAGE is specified, VALUE SHOULD contain a 1664 human-readable string written in the specified language. 1666 URI 1668 The value is a quoted-string containing a URI. The resource 1669 identified by the URI MUST be formatted as JSON [RFC8259]; 1670 otherwise, clients may fail to interpret the resource. 1672 LANGUAGE 1674 The value is a quoted-string containing a language tag [RFC5646] 1675 that identifies the language of the VALUE. This attribute is 1676 OPTIONAL. 1678 Each EXT-X-SESSION-DATA tag MUST contain either a VALUE or URI 1679 attribute, but not both. 1681 A Playlist MAY contain multiple EXT-X-SESSION-DATA tags with the same 1682 DATA-ID attribute. A Playlist MUST NOT contain more than one EXT-X 1683 -SESSION-DATA tag with the same DATA-ID attribute and the same 1684 LANGUAGE attribute. 1686 4.4.4.5. EXT-X-SESSION-KEY 1688 The EXT-X-SESSION-KEY tag allows encryption keys from Media Playlists 1689 to be specified in a Master Playlist. This allows the client to 1690 preload these keys without having to read the Media Playlist(s) 1691 first. 1693 Its format is: 1695 #EXT-X-SESSION-KEY:<attribute-list> 1697 All attributes defined for the EXT-X-KEY tag (Section 4.4.2.4) are 1698 also defined for the EXT-X-SESSION-KEY, except that the value of the 1699 METHOD attribute MUST NOT be NONE. If an EXT-X-SESSION-KEY is used, 1700 the values of the METHOD, KEYFORMAT, and KEYFORMATVERSIONS attributes 1701 MUST match any EXT-X-KEY with the same URI value. 1703 EXT-X-SESSION-KEY tags SHOULD be added if multiple Variant Streams or 1704 Renditions use the same encryption keys and formats. An EXT-X 1705 -SESSION-KEY tag is not associated with any particular Media 1706 Playlist. 1708 A Master Playlist MUST NOT contain more than one EXT-X-SESSION-KEY 1709 tag with the same METHOD, URI, IV, KEYFORMAT, and KEYFORMATVERSIONS 1710 attribute values. 1712 The EXT-X-SESSION-KEY tag is optional. 1714 4.4.5. Media or Master Playlist Tags 1716 The tags in this section can appear in either Master Playlists or 1717 Media Playlists. If one of these tags appears in a Master Playlist, 1718 it SHOULD NOT appear in any Media Playlist referenced by that Master 1719 Playlist. A tag that appears in both MUST have the same value; 1720 otherwise, clients SHOULD ignore the value in the Media Playlist(s). 1722 These tags MUST NOT appear more than once in a Playlist. If a tag 1723 appears more than once, clients MUST fail to parse the Playlist. 1725 4.4.5.1. EXT-X-INDEPENDENT-SEGMENTS 1727 The EXT-X-INDEPENDENT-SEGMENTS tag indicates that all media samples 1728 in a Media Segment can be decoded without information from other 1729 segments. It applies to every Media Segment in the Playlist. 1731 Its format is: 1733 #EXT-X-INDEPENDENT-SEGMENTS 1735 If the EXT-X-INDEPENDENT-SEGMENTS tag appears in a Master Playlist, 1736 it applies to every Media Segment in every Media Playlist in the 1737 Master Playlist. 1739 4.4.5.2. EXT-X-START 1741 The EXT-X-START tag indicates a preferred point at which to start 1742 playing a Playlist. By default, clients SHOULD start playback at 1743 this point when beginning a playback session. This tag is OPTIONAL. 1745 Its format is: 1747 #EXT-X-START:<attribute-list> 1749 The following attributes are defined: 1751 TIME-OFFSET 1752 The value of TIME-OFFSET is a signed-decimal-floating-point number 1753 of seconds. A positive number indicates a time offset from the 1754 beginning of the Playlist. A negative number indicates a negative 1755 time offset from the end of the last Media Segment in the 1756 Playlist. This attribute is REQUIRED. 1758 The absolute value of TIME-OFFSET SHOULD NOT be larger than the 1759 Playlist duration. If the absolute value of TIME-OFFSET exceeds 1760 the duration of the Playlist, it indicates either the end of the 1761 Playlist (if positive) or the beginning of the Playlist (if 1762 negative). 1764 If the Playlist does not contain the EXT-X-ENDLIST tag, the TIME- 1765 OFFSET SHOULD NOT be within three target durations of the end of 1766 the Playlist file. 1768 PRECISE 1770 The value is an enumerated-string; valid strings are YES and NO. 1771 If the value is YES, clients SHOULD start playback at the Media 1772 Segment containing the TIME-OFFSET, but SHOULD NOT render media 1773 samples in that segment whose presentation times are prior to the 1774 TIME-OFFSET. If the value is NO, clients SHOULD attempt to render 1775 every media sample in that segment. This attribute is OPTIONAL. 1776 If it is missing, its value should be treated as NO. 1778 4.4.5.3. EXT-X-DEFINE 1780 The EXT-X-DEFINE tag provides a Playlist variable definition or 1781 declaration. This tag is OPTIONAL. 1783 Its format is: 1785 #EXT-X-DEFINE:<attribute-list> 1787 The following attributes are defined: 1789 NAME 1791 The value is a quoted-string which specifies the Variable Name. 1792 All characters in the quoted-string MUST be from the following 1793 set: [a..z], [A..Z], [0..9], '-', and '_'. 1795 VALUE 1797 The value is a quoted-string which specifies the Variable Value. 1798 This attribute is REQUIRED if the EXT-X-DEFINE tag has a NAME 1799 attribute. 1801 IMPORT 1803 The value is a quoted-string which specifies the Variable Name and 1804 indicates that its value is that of the variable of the same name 1805 in the Master Playlist. EXT-X-DEFINE tags containing the IMPORT 1806 attribute MUST NOT occur in Master Playlists; they are only 1807 allowed in Media Playlists. 1809 If the IMPORT attribute value does not match any Variable Name 1810 declared in the Master Playlist, or if the Media Playlist was not 1811 loaded from a Master Playlist, the parser MUST fail to parse the 1812 Playlist. 1814 An EXT-X-DEFINE tag MUST contain either a NAME or an IMPORT 1815 attribute, but not both. 1817 An EXT-X-DEFINE tag MUST NOT specify the same Variable Name as any 1818 other EXT-X-DEFINE tag in the same Playlist. Parsers that encounter 1819 duplicate Variable Name declarations MUST fail to parse the Playlist. 1821 EXT-X-DEFINE tags do NOT implicitly persist across Playlist reloads. 1823 5. Key Files 1825 5.1. Structure of Key Files 1827 An EXT-X-KEY tag with a URI attribute identifies a Key file. A Key 1828 file contains a cipher key that can decrypt Media Segments in the 1829 Playlist. 1831 [AES_128] encryption uses 16-octet keys. If the KEYFORMAT of an 1832 EXT-X-KEY tag is "identity", the Key file is a single packed array of 1833 16 octets in binary format. 1835 5.2. IV for AES-128 1837 [AES_128] REQUIRES the same 16-octet IV to be supplied when 1838 encrypting and decrypting. Varying this IV increases the strength of 1839 the cipher. 1841 An IV attribute on an EXT-X-KEY tag with a KEYFORMAT of "identity" 1842 specifies an IV that can be used when decrypting Media Segments 1843 encrypted with that Key file. IV values for AES-128 are 128-bit 1844 numbers. 1846 An EXT-X-KEY tag with a KEYFORMAT of "identity" that does not have an 1847 IV attribute indicates that the Media Sequence Number is to be used 1848 as the IV when decrypting a Media Segment, by putting its big-endian 1849 binary representation into a 16-octet (128-bit) buffer and padding 1850 (on the left) with zeros. 1852 6. Client/Server Responsibilities 1854 6.1. Introduction 1856 This section describes how the server generates the Playlist and 1857 Media Segments and how the client should download them for playback. 1859 6.2. Server Responsibilities 1861 6.2.1. General Server Responsibilities 1863 The production of the source media is outside the scope of this 1864 document, which simply presumes a source of continuous encoded media 1865 containing the presentation. 1867 The server MUST divide the source media into individual Media 1868 Segments whose duration is less than or equal to a constant target 1869 duration. Segments that are longer than the planned target duration 1870 can trigger playback stalls and other errors. 1872 The server SHOULD attempt to divide the source media at points that 1873 support effective decode of individual Media Segments, e.g., on 1874 packet and key frame boundaries. 1876 The server MUST create a URI for every Media Segment that enables its 1877 clients to obtain the segment data. If a server supports partial 1878 loading of resources (e.g., via HTTP Range requests), it MAY specify 1879 segments as sub-ranges of larger resources using the EXT-X-BYTERANGE 1880 tag. 1882 The absence of media data (due to, for example, the temporary 1883 unavailability of an encoder) SHOULD be signaled by adding one or 1884 more Media Segments to the Playlist whose Segment durations add up to 1885 the duration of absent media; these Media Segments MUST have 1886 EXT-X-GAP tags applied to them. Attempting to download these 1887 segments MAY produce an error, such as HTTP 404 or 410. 1889 Any Media Segment that is specified in a Playlist loaded by a client 1890 MUST be available for immediate download unless it has been marked 1891 with an EXT-X-GAP tag; otherwise playback errors can occur. Once 1892 download starts, its transfer rate SHOULD NOT be constrained by the 1893 segment production process. 1895 HTTP servers SHOULD transfer text files -- such as Playlists and 1896 WebVTT segments -- using the "gzip" Content-Encoding if the client 1897 indicates that it is prepared to accept it. 1899 The server must create a Media Playlist file (Section 4) that 1900 contains a URI for each Media Segment that the server wishes to make 1901 available, in the order in which they are to be played. 1903 The value of the EXT-X-VERSION tag (Section 4.4.1.2) SHOULD NOT be 1904 greater than what is required for the tags and attributes in the 1905 Playlist (see Section 7). 1907 Changes to the Playlist file MUST be made atomically from the point 1908 of view of the clients, or playback errors MAY occur. 1910 The server MUST NOT change the Media Playlist file, except to: 1912 Append lines to it (Section 6.2.1). 1914 Remove Media Segment URIs from the Playlist in the order that they 1915 appear, along with any tags that apply only to those segments 1916 (Section 6.2.2). 1918 Increment the value of the EXT-X-MEDIA-SEQUENCE or EXT-X 1919 -DISCONTINUITY-SEQUENCE tags (Section 6.2.2). 1921 Add an EXT-X-ENDLIST tag to the Playlist (Section 6.2.1). 1923 A Media Playlist has further constraints on its updates if it 1924 contains an EXT-X-PLAYLIST-TYPE tag. An EXT-X-PLAYLIST-TYPE tag with 1925 a value of VOD indicates that the Playlist file MUST NOT change. An 1926 EXT-X-PLAYLIST-TYPE tag with a value of EVENT indicates that the 1927 server MUST NOT change or delete any part of the Playlist file; it 1928 MAY append lines to it. 1930 The value of the EXT-X-TARGETDURATION tag in the Media Playlist MUST 1931 NOT change. A typical target duration is 10 seconds. 1933 Playlist changes other than those allowed here can trigger playback 1934 errors and inconsistent client behavior. 1936 Each Media Segment in a Media Playlist has an integer Discontinuity 1937 Sequence Number. The Discontinuity Sequence Number can be used in 1938 addition to the timestamps within the media to synchronize Media 1939 Segments across different Renditions. 1941 A segment's Discontinuity Sequence Number is the value of the EXT-X 1942 -DISCONTINUITY-SEQUENCE tag (or zero if none) plus the number of 1943 EXT-X-DISCONTINUITY tags in the Playlist preceding the URI line of 1944 the segment. 1946 The server MAY associate an absolute date and time with a Media 1947 Segment by applying an EXT-X-PROGRAM-DATE-TIME tag to it. This 1948 defines an informative mapping of the (wall-clock) date and time 1949 specified by the tag to the first media timestamp in the segment, 1950 which may be used as a basis for seeking, for display, or for other 1951 purposes. If a server provides this mapping, it SHOULD apply an 1952 EXT-X-PROGRAM-DATE-TIME tag to every segment that has an 1953 EXT-X-DISCONTINUITY tag applied to it. 1955 The Server MUST NOT add any EXT-X-PROGRAM-DATE-TIME tag to a Playlist 1956 that would cause the mapping between program date and Media Segment 1957 to become ambiguous. 1959 The server MUST NOT remove an EXT-X-DATERANGE tag from a Playlist if 1960 any date in the range maps to a Media Segment in the Playlist. 1962 The server MUST NOT reuse the ID attribute value of an 1963 EXT-X-DATERANGE tag for any new Date Range in the same Playlist. 1965 Once the Following Range of a Date Range with an END-ON-NEXT=YES 1966 attribute is added to a Playlist, the Server MUST NOT subsequently 1967 add a Date Range with the same CLASS attribute whose START-DATE is 1968 between that of the END-ON-NEXT=YES range and its Following Range. 1970 For Date Ranges with a PLANNED-DURATION attribute, the Server SHOULD 1971 signal the actual end of the range once it has been established. It 1972 can do so by adding another EXT-X-DATERANGE tag with the same ID 1973 attribute value and either a DURATION or an END-DATE attribute or, if 1974 the Date Range has an END-ON-NEXT=YES attribute, by adding a 1975 Following Range. 1977 If the Media Playlist contains the final Media Segment of the 1978 presentation, then the Playlist file MUST contain the EXT-X-ENDLIST 1979 tag; this allows clients to minimize unproductive Playlist reloads. 1981 If a Media Playlist does not contain the EXT-X-ENDLIST tag, the 1982 server MUST make a new version of the Playlist file available that 1983 contains at least one new Media Segment. It MUST be made available 1984 no later than 1.5 times the target duration after the previous time 1985 the Playlist was updated with a Media Segment. This allows clients 1986 to utilize the network efficiently. 1988 If the server wishes to remove an entire presentation, it SHOULD 1989 provide a clear indication to clients that the Playlist file is no 1990 longer available (e.g., with an HTTP 404 or 410 response). It MUST 1991 ensure that all Media Segments in the Playlist file remain available 1992 to clients for at least the duration of the Playlist file at the time 1993 of removal to prevent interruption of in-progress playback. 1995 6.2.2. Live Playlists 1997 The server MAY limit the availability of Media Segments by removing 1998 Media Segments from the Playlist file (Section 6.2.1). If Media 1999 Segments are to be removed, the Playlist file MUST contain an EXT-X 2000 -MEDIA-SEQUENCE tag. Its value MUST be incremented by 1 for every 2001 Media Segment that is removed from the Playlist file; it MUST NOT 2002 decrease or wrap. Clients can malfunction if each Media Segment does 2003 not have a consistent, unique Media Sequence Number. 2005 Media Segments MUST be removed from the Playlist file in the order 2006 that they appear in the Playlist; otherwise, client playback can 2007 malfunction. 2009 The server MUST NOT remove a Media Segment from a Playlist file 2010 without an EXT-X-ENDLIST tag if that would produce a Playlist whose 2011 duration is less than three times the target duration. Doing so can 2012 trigger playback stalls. 2014 The Availability Duration of a Media Segment is the duration of the 2015 segment plus the duration of the longest-duration Playlist 2016 distributed by the server containing that segment. If the server 2017 removes a Media Segment URI from a Playlist that contains an 2018 EXT-X-ENDLIST tag, clients MUST be able to download the corresponding 2019 Media Segment until the time of removal plus the segment's 2020 Availability Duration. If the server removes a Media Segment URI 2021 from a Playlist that does not contain an EXT-X-ENDLIST tag, clients 2022 MUST be able to download the segment until the time at which it first 2023 appeared in the Playlist plus the segment's Availability Duration. 2025 If the server wishes to remove segments from a Media Playlist 2026 containing an EXT-X-DISCONTINUITY tag, the Media Playlist MUST 2027 contain an EXT-X-DISCONTINUITY-SEQUENCE tag. Without the EXT-X 2028 -DISCONTINUITY-SEQUENCE tag, it can be impossible for a client to 2029 locate corresponding segments between Renditions. 2031 If the server removes an EXT-X-DISCONTINUITY tag from the Media 2032 Playlist, it MUST increment the value of the EXT-X-DISCONTINUITY- 2033 SEQUENCE tag so that the Discontinuity Sequence Numbers of the 2034 segments still in the Media Playlist remain unchanged. The value of 2035 the EXT-X-DISCONTINUITY-SEQUENCE tag MUST NOT decrease or wrap. 2036 Clients can malfunction if each Media Segment does not have a 2037 consistent Discontinuity Sequence Number. 2039 If a server plans to remove a Media Segment after it is delivered to 2040 clients over HTTP, it SHOULD ensure that the HTTP response contains 2041 an Expires header that reflects the planned time-to-live. 2043 A Live Playlist MUST NOT contain the EXT-X-PLAYLIST-TYPE tag, as no 2044 value of that tag allows Media Segments to be removed. 2046 6.2.3. Encrypting Media Segments 2048 Media Segments MAY be encrypted. Every encrypted Media Segment MUST 2049 have an EXT-X-KEY tag (Section 4.4.2.4) applied to it with a URI that 2050 the client can use to obtain a Key file (Section 5) containing the 2051 decryption key. 2053 A Media Segment can only be encrypted with one encryption METHOD, 2054 using one encryption key and IV. However, a server MAY offer 2055 multiple ways to retrieve that key by providing multiple EXT-X-KEY 2056 tags, each with a different KEYFORMAT attribute value. 2058 The server MAY set the HTTP Expires header in the key response to 2059 indicate the duration for which the key can be cached. 2061 Any unencrypted Media Segment in a Playlist that is preceded by an 2062 encrypted Media Segment MUST have an EXT-X-KEY tag applied to it with 2063 a METHOD attribute of NONE. Otherwise, the client will misinterpret 2064 those segments as encrypted. 2066 If the encryption METHOD is AES-128 and the Playlist does not contain 2067 the EXT-X-I-FRAMES-ONLY tag, AES encryption as described in 2068 Section 4.4.2.4 SHALL be applied to individual Media Segments. 2070 If the encryption METHOD is AES-128 and the Playlist contains an 2071 EXT-X-I-FRAMES-ONLY tag, the entire resource MUST be encrypted using 2072 AES-128 CBC with PKCS7 padding [RFC5652]. Encryption MAY be 2073 restarted on 16-byte block boundaries, unless the first block 2074 contains an I-frame. The IV used for encryption MUST be either the 2075 Media Sequence Number of the Media Segment or the value of the IV 2076 attribute of the EXT-X-KEY tag, as described in Section 5.2. These 2077 constraints allow a client to load and decrypt individual I-frames 2078 specified as sub-ranges of regular encrypted Media Segments, and 2079 their Media Initialization Sections. 2081 If the encryption METHOD indicates Sample Encryption, media samples 2082 MAY be encrypted prior to encapsulation in a Media Segment. 2084 The server MUST NOT remove an EXT-X-KEY tag from the Playlist file if 2085 it applies to any Media Segment in the Playlist file, or clients who 2086 subsequently load that Playlist will be unable to decrypt those Media 2087 Segments. 2089 6.2.4. Providing Variant Streams 2091 A server MAY offer multiple Media Playlist files to provide different 2092 encodings of the same presentation. If it does so, it SHOULD provide 2093 a Master Playlist file that lists each Variant Stream to allow 2094 clients to switch between encodings dynamically. 2096 Master Playlists describe regular Variant Streams with EXT-X-STREAM- 2097 INF tags and I-frame Variant Streams with EXT-X-I-FRAME-STREAM-INF 2098 tags. 2100 If an EXT-X-STREAM-INF tag or EXT-X-I-FRAME-STREAM-INF tag contains 2101 the CODECS attribute, the attribute value MUST include every media 2102 format [RFC6381] present in any Media Segment in any of the 2103 Renditions specified by the Variant Stream. 2105 The server MUST meet the following constraints when producing Variant 2106 Streams in order to allow clients to switch between them seamlessly: 2108 Each Variant Stream MUST present the same content. 2110 Matching content in Variant Streams MUST have matching timestamps. 2111 This allows clients to synchronize the media. 2113 Matching content in Variant Streams MUST have matching 2114 Discontinuity Sequence Numbers (see Section 4.4.3.3). 2116 Each Media Playlist in each Variant Stream MUST have the same 2117 target duration. The only exceptions are SUBTITLES Renditions and 2118 Media Playlists containing an EXT-X-I-FRAMES-ONLY tag, which MAY 2119 have different target durations if they have an EXT-X-PLAYLIST- 2120 TYPE of VOD. 2122 Content that appears in a Media Playlist of one Variant Stream but 2123 not in another MUST appear either at the beginning or at the end 2124 of the Media Playlist file and MUST NOT be longer than the target 2125 duration. 2127 If any Media Playlists have an EXT-X-PLAYLIST-TYPE tag, all Media 2128 Playlists MUST have an EXT-X-PLAYLIST-TYPE tag with the same 2129 value. 2131 If the Playlist contains an EXT-X-PLAYLIST-TYPE tag with the value 2132 of VOD, the first segment of every Media Playlist in every Variant 2133 Stream MUST start at the same media timestamp. 2135 If any Media Playlist in a Master Playlist contains an EXT-X 2136 -PROGRAM-DATE-TIME tag, then all Media Playlists in that Master 2137 Playlist MUST contain EXT-X-PROGRAM-DATE-TIME tags with consistent 2138 mappings of date and time to media timestamps. 2140 Each Variant Stream MUST contain the same set of Date Ranges. The 2141 EXT-X-DATERANGE tags of corresponding Date Ranges MUST have the 2142 same ID attribute value and contain the same set of attribute/ 2143 value pairs. 2145 In addition, for broadest compatibility, Variant Streams SHOULD 2146 contain the same encoded audio bitstream. This allows clients to 2147 switch between Variant Streams without audible glitching. 2149 The rules for Variant Streams also apply to alternative Renditions 2150 (see Section 4.4.4.2.1). 2152 6.3. Client Responsibilities 2154 6.3.1. General Client Responsibilities 2156 How the client obtains the URI to the Playlist file is outside the 2157 scope of this document; it is presumed to have done so. 2159 The client obtains the Playlist file from the URI. If the Playlist 2160 file so obtained is a Master Playlist, the client can select a 2161 Variant Stream to load from the Master Playlist. 2163 Clients MUST ensure that loaded Playlists comply with Section 4 and 2164 that the EXT-X-VERSION tag, if present, specifies a protocol version 2165 supported by the client; if either check fails, the client MUST NOT 2166 attempt to use the Playlist, or unintended behavior could occur. 2168 When parsing Playlist elements that are subject to variable 2169 substitution, a Variable Reference whose Variable Name has been 2170 provided by an EXT-X-DEFINE tag that precedes the Variable Reference 2171 MUST be replaced by the corresponding Variable Value. Such 2172 replacements themselves are NOT subject to variable substitution. 2174 When parsing Playlist elements that are subject to variable 2175 substitution, a Variable Reference whose Variable Name has NOT been 2176 provided by an EXT-X-DEFINE tag preceding the Variable Reference MUST 2177 trigger a parsing error. 2179 If any URI element in a Playlist contains an URI scheme that the 2180 client cannot handle, the client MUST stop playback. All clients 2181 MUST support HTTP schemes. 2183 To support forward compatibility, when parsing Playlists, clients 2184 MUST: 2186 o ignore any unrecognized tags. 2188 o ignore any attribute/value pair with an unrecognized 2189 AttributeName. 2191 o ignore any tag containing an attribute/value pair of type 2192 enumerated-string whose AttributeName is recognized but whose 2193 AttributeValue is not recognized, unless the definition of the 2194 attribute says otherwise. 2196 When identifying playable Renditions, Clients SHOULD consider an 2197 audio Rendition having unrecognized CHANNELS parameters to be 2198 playable if its associated CODECS attribute is supported. However, 2199 an equivalent Rendition with the same audio codec and recognized 2200 CHANNELS parameters SHOULD be preferred if it is present in the 2201 Master Playlist. 2203 Algorithms used by the client to switch between Variant Streams are 2204 beyond the scope of this document. 2206 6.3.2. Loading the Media Playlist File 2208 Every time a Media Playlist is loaded or reloaded from a Playlist 2209 URI, the client MUST determine the next Media Segment to load, as 2210 described in Section 6.3.5, if it intends to play the presentation 2211 normally (i.e., in Playlist order at the nominal playback rate). 2213 If the Media Playlist contains the EXT-X-MEDIA-SEQUENCE tag, the 2214 client SHOULD assume that each Media Segment in it will become 2215 unavailable at the time that the Playlist file was loaded plus the 2216 duration of the Playlist file. 2218 A client MAY use the segment Media Sequence Number to track the 2219 location of a Media Segment within a Playlist when the Playlist is 2220 reloaded. 2222 A client MUST NOT assume that segments with the same Media Sequence 2223 Number in different Variant Streams or Renditions have the same 2224 position in the presentation; Playlists MAY have independent Media 2225 Sequence Numbers. Instead, a client MUST use the relative position 2226 of each segment on the Playlist timeline and its Discontinuity 2227 Sequence Number to locate corresponding segments. 2229 A client MUST load the Media Playlist file of every Rendition 2230 selected for playback in order to locate the media specific to that 2231 Rendition. But, to prevent unnecessary load on the server, it SHOULD 2232 NOT load the Playlist file of any other Rendition. 2234 For some Variant Streams, it is possible to select Renditions that do 2235 not include the Rendition specified by the EXT-X-STREAM-INF tag. As 2236 noted above, the client SHOULD NOT load that Rendition in those 2237 cases. 2239 6.3.3. Playing the Media Playlist File 2241 The client SHALL choose which Media Segment to play first from the 2242 Media Playlist when playback starts. If the EXT-X-ENDLIST tag is not 2243 present and the client intends to play the media normally, the client 2244 SHOULD NOT choose a segment that starts less than the duration of the 2245 last segment in the Playlist plus two target durations from the end 2246 of the Playlist file. Doing so can trigger playback stalls. 2248 Normal playback can be achieved by playing the Media Segments in the 2249 order that they appear in the Playlist. The client MAY present the 2250 available media in any way it wishes, including normal playback, 2251 random access, and trick modes. 2253 The client SHOULD NOT attempt to load Media Segments that have been 2254 marked with an EXT-X-GAP tag. Instead, clients are encouraged to 2255 look for another Variant Stream of the same Rendition which does not 2256 have the same gap, and play that instead. 2258 The encoding parameters for samples in a Media Segment and across 2259 multiple Media Segments in a Media Playlist SHOULD remain consistent. 2260 However, clients SHOULD deal with encoding changes as they are 2261 encountered, for example, by scaling video content to accommodate a 2262 resolution change. If the Variant Stream includes a RESOLUTION 2263 attribute, clients SHOULD display all video within a rectangle with 2264 the same proportions as that resolution. 2266 Clients SHOULD be prepared to handle multiple tracks of a particular 2267 type (e.g., audio or video). A client with no other preference 2268 SHOULD choose the track with the lowest numerical track identifier 2269 that it can play. 2271 Clients SHOULD ignore private streams inside Transport Streams that 2272 they do not recognize. Private streams can be used to support 2273 different devices with the same stream, although stream authors 2274 SHOULD be sensitive to the additional network load that this imposes. 2276 The client MUST be prepared to reset its parser(s) and decoder(s) 2277 before playing a Media Segment that has an EXT-X-DISCONTINUITY tag 2278 applied to it; otherwise, playback errors can occur. 2280 The client SHOULD attempt to load Media Segments in advance of when 2281 they will be required for uninterrupted playback to compensate for 2282 temporary variations in latency and throughput. 2284 The client MAY use the value of the EXT-X-PROGRAM-DATE-TIME tag to 2285 display the program origination time to the user. If the value 2286 includes time zone information, the client SHALL take it into 2287 account; if it does not, the client MAY assume the time to be local. 2289 Note that dates in Playlists can refer to when the content was 2290 produced (or to other times), which have no relation to the time of 2291 playback. 2293 If the first EXT-X-PROGRAM-DATE-TIME tag in a Playlist appears after 2294 one or more Media Segment URIs, the client SHOULD extrapolate 2295 backward from that tag (using EXTINF durations and/or media 2296 timestamps) to associate dates with those segments. To associate a 2297 date with any other Media Segment that does not have an EXT-X 2298 -PROGRAM-DATE-TIME tag applied to it directly, the client SHOULD 2299 extrapolate forward from the last EXT-X-PROGRAM-DATE-TIME tag 2300 appearing before that segment in the Playlist. 2302 6.3.4. Reloading the Media Playlist File 2304 The client MUST periodically reload a Media Playlist file to learn 2305 what media is currently available, unless it contains an EXT-X 2306 -PLAYLIST-TYPE tag with a value of VOD, or a value of EVENT and the 2307 EXT-X-ENDLIST tag is also present. 2309 However, the client MUST NOT attempt to reload the Playlist file more 2310 frequently than specified by this section, in order to limit the 2311 collective load on the server. 2313 When a client loads a Playlist file for the first time or reloads a 2314 Playlist file and finds that it has changed since the last time it 2315 was loaded, the client MUST wait for at least the duration of the 2316 last segment in the Playlist before attempting to reload the Playlist 2317 file again, measured from the last time the client began loading the 2318 Playlist file. 2320 If the client reloads a Playlist file and finds that it has not 2321 changed, then it MUST wait for a period of one-half the target 2322 duration before retrying. 2324 After reloading a Media Playlist, the client SHOULD verify that each 2325 Media Segment in it has the same URI (and byte range, if specified) 2326 as the Media Segment with the same Media Sequence Number in the 2327 previous Media Playlist. It SHOULD halt playback if it does not, as 2328 this normally indicates a server error. 2330 In order to reduce server load, the client SHOULD NOT reload the 2331 Playlist files of Variant Streams or alternate Renditions that are 2332 not currently being played. If it decides to switch playback to a 2333 different Variant Stream, it SHOULD stop reloading the Playlist of 2334 the old Variant Stream and begin loading the Playlist of the new 2335 Variant Stream. It can use the EXTINF durations and the constraints 2336 in Section 6.2.4 to determine the approximate location of 2337 corresponding media. Once media from the new Variant Stream has been 2338 loaded, the timestamps in the Media Segments can be used to 2339 synchronize the old and new timelines precisely. 2341 A client MUST NOT attempt to use the Media Sequence Number to 2342 synchronize between streams (see Section 6.3.2). 2344 6.3.5. Determining the Next Segment to Load 2346 The client MUST examine the Media Playlist file every time it is 2347 loaded or reloaded to determine the next Media Segment to load, as 2348 the set of available media MAY have changed. 2350 The first segment to load is generally the segment that the client 2351 has chosen to play first (see Section 6.3.3). 2353 In order to play the presentation normally, the next Media Segment to 2354 load is the one with the lowest Media Sequence Number that is greater 2355 than the Media Sequence Number of the last Media Segment loaded. 2357 6.3.6. Decrypting Encrypted Media Segments 2359 If a Media Playlist file contains an EXT-X-KEY tag that specifies a 2360 Key file URI, the client can obtain that Key file and use the key 2361 inside it to decrypt all Media Segments to which that EXT-X-KEY tag 2362 applies. 2364 A client MUST ignore any EXT-X-KEY tag with an unsupported or 2365 unrecognized KEYFORMAT attribute, to allow for cross-device 2366 addressability. If the Playlist contains a Media Segment to which 2367 only EXT-X-KEY tags with unrecognized or unsupported KEYFORMAT 2368 attributes are applied, playback SHOULD fail. 2370 A client MUST NOT attempt to decrypt any segments whose EXT-X-KEY tag 2371 has a METHOD attribute that it does not recognize. 2373 If the encryption METHOD is AES-128, AES-128 CBC decryption SHALL be 2374 applied to individual Media Segments, whose encryption format is 2375 described in Section 4.4.2.4. 2377 If the encryption METHOD is AES-128 and the Media Segment is part of 2378 an I-frame Playlist (Section 4.4.3.6) and it has an EXT-X-BYTERANGE 2379 tag applied to it, special care needs to be taken in loading and 2380 decrypting the segment, because the resource identified by the URI is 2381 encrypted in 16-byte blocks from the start of the resource. 2383 The decrypted I-frame can be recovered by first widening its byte 2384 range, as specified by the EXT-X-BYTERANGE tag, so that it starts and 2385 ends on 16-byte boundaries from the start of the resource. 2387 Next, the byte range is widened further to include a 16-byte block at 2388 the beginning of the range. This 16-byte block allows the correct IV 2389 for the following block to be calculated. 2391 The widened byte range can then be loaded and decrypted with AES-128 2392 CBC using an arbitrary IV. The number of bytes added to the 2393 beginning and the end of the original byte range are discarded from 2394 the decrypted bytes; what remains is the decrypted I-frame. 2396 If the encryption METHOD indicates Sample Encryption, decryption 2397 SHALL be applied to encrypted media samples within the Media Segment. 2399 An EXT-X-KEY tag with a METHOD of NONE indicates that the Media 2400 Segments it applies to are not encrypted. 2402 7. Protocol Version Compatibility 2404 Protocol compatibility is specified by the EXT-X-VERSION tag. A 2405 Playlist that contains tags or attributes that are not compatible 2406 with protocol version 1 MUST include an EXT-X-VERSION tag. 2408 A client MUST NOT attempt playback if it does not support the 2409 protocol version specified by the EXT-X-VERSION tag, or unintended 2410 behavior could occur. 2412 A Media Playlist MUST indicate an EXT-X-VERSION of 2 or higher if it 2413 contains: 2415 o The IV attribute of the EXT-X-KEY tag. 2417 A Media Playlist MUST indicate an EXT-X-VERSION of 3 or higher if it 2418 contains: 2420 o Floating-point EXTINF duration values. 2422 A Media Playlist MUST indicate an EXT-X-VERSION of 4 or higher if it 2423 contains: 2425 o The EXT-X-BYTERANGE tag. 2427 o The EXT-X-I-FRAMES-ONLY tag. 2429 A Media Playlist MUST indicate an EXT-X-VERSION of 5 or higher if it 2430 contains: 2432 o An EXT-X-KEY tag with a METHOD of SAMPLE-AES. 2434 o The KEYFORMAT and KEYFORMATVERSIONS attributes of the EXT-X-KEY 2435 tag. 2437 o The EXT-X-MAP tag. 2439 A Media Playlist MUST indicate an EXT-X-VERSION of 6 or higher if it 2440 contains: 2442 o The EXT-X-MAP tag in a Media Playlist that does not contain 2443 EXT-X-I-FRAMES-ONLY. 2445 Note that in protocol version 6, the semantics of the 2446 EXT-X-TARGETDURATION tag changed slightly. In protocol version 5 and 2447 earlier it indicated the maximum segment duration; in protocol 2448 version 6 and later it indicates the the maximum segment duration 2449 rounded to the nearest integer number of seconds. 2451 A Master Playlist MUST indicate an EXT-X-VERSION of 7 or higher if it 2452 contains: 2454 o "SERVICE" values for the INSTREAM-ID attribute of the EXT-X-MEDIA 2455 tag. 2457 A Playlist MUST indicate an EXT-X-VERSION of 8 or higher if it 2458 contains: 2460 o Variable substitution. 2462 The EXT-X-MEDIA tag and the AUDIO, VIDEO, and SUBTITLES attributes of 2463 the EXT-X-STREAM-INF tag are backward compatible to protocol version 2464 1, but playback on older clients may not be desirable. A server MAY 2465 consider indicating an EXT-X-VERSION of 4 or higher in the Master 2466 Playlist but is not required to do so. 2468 The PROGRAM-ID attribute of the EXT-X-STREAM-INF and the EXT-X-I 2469 -FRAME-STREAM-INF tags was removed in protocol version 6. 2471 The EXT-X-ALLOW-CACHE tag was removed in protocol version 7. 2473 8. Playlist Examples 2475 8.1. Simple Media Playlist 2477 #EXTM3U 2478 #EXT-X-TARGETDURATION:10 2479 #EXT-X-VERSION:3 2480 #EXTINF:9.009, 2481 http://media.example.com/first.ts 2482 #EXTINF:9.009, 2483 http://media.example.com/second.ts 2484 #EXTINF:3.003, 2485 http://media.example.com/third.ts 2486 #EXT-X-ENDLIST 2488 8.2. Live Media Playlist Using HTTPS 2490 #EXTM3U 2491 #EXT-X-VERSION:3 2492 #EXT-X-TARGETDURATION:8 2493 #EXT-X-MEDIA-SEQUENCE:2680 2495 #EXTINF:7.975, 2496 https://priv.example.com/fileSequence2680.ts 2497 #EXTINF:7.941, 2498 https://priv.example.com/fileSequence2681.ts 2499 #EXTINF:7.975, 2500 https://priv.example.com/fileSequence2682.ts 2502 8.3. Playlist with Encrypted Media Segments 2503 #EXTM3U 2504 #EXT-X-VERSION:3 2505 #EXT-X-MEDIA-SEQUENCE:7794 2506 #EXT-X-TARGETDURATION:15 2508 #EXT-X-KEY:METHOD=AES-128,URI="https://priv.example.com/key.php?r=52" 2510 #EXTINF:2.833, 2511 http://media.example.com/fileSequence52-A.ts 2512 #EXTINF:15.0, 2513 http://media.example.com/fileSequence52-B.ts 2514 #EXTINF:13.333, 2515 http://media.example.com/fileSequence52-C.ts 2517 #EXT-X-KEY:METHOD=AES-128,URI="https://priv.example.com/key.php?r=53" 2519 #EXTINF:15.0, 2520 http://media.example.com/fileSequence53-A.ts 2522 8.4. Master Playlist 2524 #EXTM3U 2525 #EXT-X-STREAM-INF:BANDWIDTH=1280000,AVERAGE-BANDWIDTH=1000000 2526 http://example.com/low.m3u8 2527 #EXT-X-STREAM-INF:BANDWIDTH=2560000,AVERAGE-BANDWIDTH=2000000 2528 http://example.com/mid.m3u8 2529 #EXT-X-STREAM-INF:BANDWIDTH=7680000,AVERAGE-BANDWIDTH=6000000 2530 http://example.com/hi.m3u8 2531 #EXT-X-STREAM-INF:BANDWIDTH=65000,CODECS="mp4a.40.5" 2532 http://example.com/audio-only.m3u8 2534 8.5. Master Playlist with I-Frames 2536 #EXTM3U 2537 #EXT-X-STREAM-INF:BANDWIDTH=1280000 2538 low/audio-video.m3u8 2539 #EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=86000,URI="low/iframe.m3u8" 2540 #EXT-X-STREAM-INF:BANDWIDTH=2560000 2541 mid/audio-video.m3u8 2542 #EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=150000,URI="mid/iframe.m3u8" 2543 #EXT-X-STREAM-INF:BANDWIDTH=7680000 2544 hi/audio-video.m3u8 2545 #EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=550000,URI="hi/iframe.m3u8" 2546 #EXT-X-STREAM-INF:BANDWIDTH=65000,CODECS="mp4a.40.5" 2547 audio-only.m3u8 2549 8.6. Master Playlist with Alternative Audio 2551 In this example, the CODECS attributes have been condensed for space. 2552 A '\' is used to indicate that the tag continues on the following 2553 line with whitespace removed: 2555 #EXTM3U 2556 #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="aac",NAME="English", \ 2557 DEFAULT=YES,AUTOSELECT=YES,LANGUAGE="en", \ 2558 URI="main/english-audio.m3u8" 2559 #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="aac",NAME="Deutsch", \ 2560 DEFAULT=NO,AUTOSELECT=YES,LANGUAGE="de", \ 2561 URI="main/german-audio.m3u8" 2562 #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="aac",NAME="Commentary", \ 2563 DEFAULT=NO,AUTOSELECT=NO,LANGUAGE="en", \ 2564 URI="commentary/audio-only.m3u8" 2565 #EXT-X-STREAM-INF:BANDWIDTH=1280000,CODECS="...",AUDIO="aac" 2566 low/video-only.m3u8 2567 #EXT-X-STREAM-INF:BANDWIDTH=2560000,CODECS="...",AUDIO="aac" 2568 mid/video-only.m3u8 2569 #EXT-X-STREAM-INF:BANDWIDTH=7680000,CODECS="...",AUDIO="aac" 2570 hi/video-only.m3u8 2571 #EXT-X-STREAM-INF:BANDWIDTH=65000,CODECS="mp4a.40.5",AUDIO="aac" 2572 main/english-audio.m3u8 2574 8.7. Master Playlist with Alternative Video 2576 This example shows three different video Renditions (Main, 2577 Centerfield, and Dugout) and three different Variant Streams (low, 2578 mid, and high). In this example, clients that did not support the 2579 EXT-X-MEDIA tag and the VIDEO attribute of the EXT-X-STREAM-INF tag 2580 would only be able to play the video Rendition "Main". 2582 Since the EXT-X-STREAM-INF tag has no AUDIO attribute, all video 2583 Renditions would be required to contain the audio. 2585 In this example, the CODECS attributes have been condensed for space. 2586 A '\' is used to indicate that the tag continues on the following 2587 line with whitespace removed: 2589 #EXTM3U 2590 #EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="low",NAME="Main", \ 2591 DEFAULT=YES,URI="low/main/audio-video.m3u8" 2592 #EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="low",NAME="Centerfield", \ 2593 DEFAULT=NO,URI="low/centerfield/audio-video.m3u8" 2594 #EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="low",NAME="Dugout", \ 2595 DEFAULT=NO,URI="low/dugout/audio-video.m3u8" 2597 #EXT-X-STREAM-INF:BANDWIDTH=1280000,CODECS="...",VIDEO="low" 2598 low/main/audio-video.m3u8 2600 #EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="mid",NAME="Main", \ 2601 DEFAULT=YES,URI="mid/main/audio-video.m3u8" 2602 #EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="mid",NAME="Centerfield", \ 2603 DEFAULT=NO,URI="mid/centerfield/audio-video.m3u8" 2604 #EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="mid",NAME="Dugout", \ 2605 DEFAULT=NO,URI="mid/dugout/audio-video.m3u8" 2607 #EXT-X-STREAM-INF:BANDWIDTH=2560000,CODECS="...",VIDEO="mid" 2608 mid/main/audio-video.m3u8 2610 #EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="hi",NAME="Main", \ 2611 DEFAULT=YES,URI="hi/main/audio-video.m3u8" 2612 #EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="hi",NAME="Centerfield", \ 2613 DEFAULT=NO,URI="hi/centerfield/audio-video.m3u8" 2614 #EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="hi",NAME="Dugout", \ 2615 DEFAULT=NO,URI="hi/dugout/audio-video.m3u8" 2617 #EXT-X-STREAM-INF:BANDWIDTH=7680000,CODECS="...",VIDEO="hi" 2618 hi/main/audio-video.m3u8 2620 8.8. Session Data in a Master Playlist 2622 In this example, only the EXT-X-SESSION-DATA is shown: 2624 #EXT-X-SESSION-DATA:DATA-ID="com.example.lyrics",URI="lyrics.json" 2626 #EXT-X-SESSION-DATA:DATA-ID="com.example.title",LANGUAGE="en", \ 2627 VALUE="This is an example" 2628 #EXT-X-SESSION-DATA:DATA-ID="com.example.title",LANGUAGE="es", \ 2629 VALUE="Este es un ejemplo" 2631 8.9. CHARACTERISTICS Attribute Containing Multiple Characteristics 2633 Certain characteristics are valid in combination, as in: 2635 CHARACTERISTICS= 2636 "public.accessibility.transcribes-spoken-dialog,public.easy-to-read" 2638 8.10. EXT-X-DATERANGE Carrying SCTE-35 Tags 2640 This example shows two EXT-X-DATERANGE tags that describe a single 2641 Date Range, with an SCTE-35 "out" splice_insert() command that is 2642 subsequently updated with an SCTE-35 "in" splice_insert() command. 2644 #EXTM3U 2645 ... 2646 #EXT-X-DATERANGE:ID="splice-6FFFFFF0",START-DATE="2014-03-05T11: 2647 15:00Z",PLANNED-DURATION=59.993,SCTE35-OUT=0xFC002F0000000000FF0 2648 00014056FFFFFF000E011622DCAFF000052636200000000000A0008029896F50 2649 000008700000000 2651 ... Media Segment declarations for 60s worth of media 2653 #EXT-X-DATERANGE:ID="splice-6FFFFFF0",DURATION=59.993,SCTE35-IN= 2654 0xFC002A0000000000FF00000F056FFFFFF000401162802E6100000000000A00 2655 08029896F50000008700000000 2656 ... 2658 9. Contributors 2660 Significant contributions to the design of this protocol were made by 2661 Jim Batson, David Biderman, Bill May, Roger Pantos, Alan Tseng, and 2662 Eryk Vershen. Stuart Cheshire helped edit the specification. 2664 Significant contributions to the update of this protocol were made by 2665 Bill May and Eryk Vershen. 2667 In particular, Bill May co-authored the first edition of HTTP Live 2668 Streaming, [RFC8216], and continues to provide valuable guidance and 2669 input. 2671 10. IANA Considerations 2673 IANA has registered the following media type [RFC2046]: 2675 Type name: application 2677 Subtype name: vnd.apple.mpegurl 2679 Required parameters: none 2681 Optional parameters: none 2682 Encoding considerations: encoded as UTF-8, which is 8-bit text. This 2683 media type may require encoding on transports not capable of handling 2684 8-bit text. See Section 4 for more information. 2686 Security considerations: See Section 11. 2688 Compression: this media type does not employ compression. 2690 Interoperability considerations: There are no byte-ordering issues, 2691 since files are 8-bit text. Applications could encounter 2692 unrecognized tags, which SHOULD be ignored. 2694 Published specification: see Section 4. 2696 Applications that use this media type: Multimedia applications such 2697 as the iPhone media player in iOS 3.0 and later and QuickTime Player 2698 in Mac OS X version 10.6 and later. 2700 Fragment identifier considerations: no Fragment Identifiers are 2701 defined for this media type. 2703 Additional information: 2705 Deprecated alias names for this type: none 2706 Magic number(s): #EXTM3U 2707 File extension(s): .m3u8, .m3u (see Section 4) 2708 Macintosh file type code(s): none 2710 Person & email address to contact for further information: David 2711 Singer, singer AT apple.com. 2713 Intended usage: LIMITED USE 2715 Restrictions on usage: none 2717 Author: Roger Pantos 2719 Change Controller: David Singer 2721 11. Security Considerations 2723 Since the protocol generally uses HTTP to transfer data, most of the 2724 same security considerations apply. See Section 15 of HTTP 2725 [RFC7230]. 2727 Media file parsers are typically subject to "fuzzing" attacks. 2728 Implementors SHOULD pay particular attention to code that will parse 2729 data received from a server and ensure that all possible inputs are 2730 handled correctly. 2732 Playlist files contain URIs, which clients will use to make network 2733 requests of arbitrary entities. Clients SHOULD range-check responses 2734 to prevent buffer overflows. See also the Security Considerations 2735 section of "Uniform Resource Identifier (URI): Generic Syntax" 2736 [RFC3986]. 2738 Apart from URL resolution, this format does not employ any form of 2739 active content. 2741 Clients SHOULD limit each playback session to a reasonable number of 2742 concurrent downloads (for example, four) to avoid contributing to 2743 denial-of-service attacks. 2745 HTTP requests often include session state ("cookies"), which may 2746 contain private user data. Implementations MUST follow cookie 2747 restriction and expiry rules specified by "HTTP State Management 2748 Mechanism" [RFC6265] to protect themselves from attack. See also the 2749 Security Considerations section of that document, and "Use of HTTP 2750 State Management" [RFC2964]. 2752 Encryption keys are specified by URI. The delivery of these keys 2753 SHOULD be secured by a mechanism such as HTTP Over TLS [RFC2818] 2754 (formerly SSL) in conjunction with a secure realm or a session token. 2756 12. References 2758 12.1. Normative References 2760 [AC_3] Advanced Television Systems Committee, "Digital Audio 2761 Compression (AC-3) (E-AC-3)", ATSC Standard A/52:2010, 2762 November 2010, <http://atsc.org/wp-content/uploads/2015 2763 /03/A52-201212-17.pdf>. 2765 [AES_128] National Institute of Standards and Technology, "Advanced 2766 Encryption Standard (AES)", FIPS PUB 197, DOI 10.6028/ 2767 NIST.FIPS.197, November 2001, 2768 <http://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.197.pdf>. 2770 [CEA608] Consumer Technology Association, "Line 21 Data Services", 2771 ANSI/CTA Standard 608-E, April 2008, 2772 <https://standards.cta.tech/kwspub/published_docs/ANSI- 2773 CTA-608-E-R-2014-Preview.pdf>. 2775 [CEA708] Consumer Technology Association, "Digital Television (DTV) 2776 Closed Captioning", ANSI/CTA Standard CEA-708-E, August 2777 2013, <https://standards.cta.tech/kwspub/published_docs/ 2778 ANSI-CTA-708-E-Preview.pdf>. 2780 [CICP] International Organization for Standardization, 2781 "Information technology - MPEG systems technologies - Part 2782 8: Coding-independent code points", ISO/IEC International 2783 Standard 23001-8:2016, 2016, <https://www.iso.org/obp/ 2784 ui/#iso:std:iso-iec:23001:-8:ed-2:v1:en>. 2786 [CMAF] International Organization for Standardization, 2787 "Information technology -- Multimedia application format 2788 (MPEG-A) -- Part 19: Common media application format 2789 (CMAF) for segmented media", ISO/IEC International 2790 Standard 23000-19:2017, December 2017, <https://www.iso 2791 .org/standard/71975.html>. 2793 [COMMON_ENC] 2794 International Organization for Standardization, 2795 "Information technology -- MPEG systems technologies -- 2796 Part 7: Common encryption in ISO base media file format 2797 files", ISO/IEC International Standard 23001-7:2016, 2798 February 2016, <http://www.iso.org/iso/ 2799 catalogue_detail.htm?csnumber=68042>. 2801 [HDCP] Digital Content Protection LLC, "High-bandwidth Digital 2802 Content Protection System - Mapping HDCP to HDMI", 2803 February 2013, <http://www.digital-cp.com/sites/default/ 2804 files/specifications/ 2805 HDCP%20on%20HDMI%20Specification%20Rev2_2_Final1.pdf>. 2807 [H_264] International Telecommunications Union, "Advanced video 2808 coding for generic audiovisual services", January 2012, 2809 <http://www.itu.int/rec/T-REC-H.264>. 2811 [IMSC1] W3C, "TTML Profiles for Internet Media Subtitles and 2812 Captions 1.0 (IMSC1)", April 2016, <https://www.w3.org/TR/ 2813 ttml-imsc1/>. 2815 [ISOBMFF] International Organization for Standardization, 2816 "Information technology -- Coding of audio-visual objects 2817 -- Part 12: ISO base media file format", ISO/IEC 2818 International Standard 14496-12:2015, December 2015, 2819 <http://www.iso.org/iso/ 2820 catalogue_detail.htm?csnumber=68960>. 2822 [ISO_13818] 2823 International Organization for Standardization, "Generic 2824 coding of moving pictures and associated audio 2825 information", ISO/IEC International Standard 13818:2007, 2826 October 2007, 2827 <http://www.iso.org/iso/catalogue_detail?csnumber=44169>. 2829 [ISO_13818_3] 2830 International Organization for Standardization, "Generic 2831 coding of moving pictures and associated audio information 2832 -- Part 3: Audio", ISO/IEC International Standard 2833 13818-3:1998, April 1998, <http://www.iso.org/iso/home/ 2834 store/catalogue_tc/catalogue_detail.htm?csnumber=26797>. 2836 [ISO_13818_7] 2837 International Organization for Standardization, "Generic 2838 coding of moving pictures and associated audio information 2839 -- Part 7: Advanced Audio Coding (AAC)", ISO/IEC 2840 International Standard 13818-7:2006, January 2006, 2841 <http://www.iso.org/iso/home/store/catalogue_tc/ 2842 catalogue_detail.htm?csnumber=43345>. 2844 [ISO_14496] 2845 International Organization for Standardization, 2846 "Information technology -- Coding of audio-visual objects 2847 -- Part 3: Audio", ISO/IEC International Standard 2848 14496-3:2009, 2009, 2849 <http://www.iso.org/iso/catalogue_detail?csnumber=53943>. 2851 [ISO_8601] 2852 International Organization for Standardization, "Data 2853 elements and interchange formats -- Information 2854 interchange -- Representation of dates and times", ISO/IEC 2855 International Standard 8601:2004, December 2004, 2856 <http://www.iso.org/iso/catalogue_detail?csnumber=40874>. 2858 [MP4_TIMED_TEXT] 2859 International Organization for Standardization, 2860 "Information technology -- Coding of audio-visual objects 2861 -- Part 30: Timed text and other visual overlays in ISO 2862 base media file format", ISO/IEC International Standard 2863 14496-30:2014, March 2014, <https://www.iso.org/ 2864 standard/63107.html>. 2866 [RFC2046] Freed, N. and N. Borenstein, "Multipurpose Internet Mail 2867 Extensions (MIME) Part Two: Media Types", RFC 2046, 2868 November 1996. 2870 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 2871 Requirement Levels", BCP 14, RFC 2119, March 1997. 2873 [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, May 2000. 2875 [RFC2964] Moore, K. and N. Freed, "Use of HTTP State Management", 2876 BCP 44, RFC 2964, October 2000. 2878 [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 2879 10646", STD 63, RFC 3629, November 2003. 2881 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 2882 Resource Identifier (URI): Generic Syntax", STD 66, RFC 2883 3986, January 2005. 2885 [RFC5646] Phillips, A. and M. Davis, "Tags for Identifying 2886 Languages", BCP 47, RFC 5646, September 2009. 2888 [RFC5652] Housley, R., "Cryptographic Message Syntax (CMS)", STD 70, 2889 RFC 5652, September 2009. 2891 [RFC6265] Barth, A., "HTTP State Management Mechanism", RFC 6265, 2892 April 2011. 2894 [RFC6381] Gellens, R., Singer, D., and P. Frojdh, "The 'Codecs' and 2895 'Profiles' Parameters for "Bucket" Media Types", RFC 6381, 2896 August 2011. 2898 [RFC7230] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 2899 Protocol (HTTP/1.1): Message Syntax and Routing", RFC 2900 7230, DOI 10.17487/RFC7230, June 2014, 2901 <http://www.rfc-editor.org/info/rfc7230>. 2903 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2904 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 2905 May 2017, <https://www.rfc-editor.org/info/rfc8174>. 2907 [RFC8216] Pantos, R., Ed. and W. May, "HTTP Live Streaming", RFC 2908 8216, DOI 10.17487/RFC8216, August 2017, <https://www.rfc- 2909 editor.org/info/rfc8216>. 2911 [RFC8259] Bray, T., Ed., "The JavaScript Object Notation (JSON) Data 2912 Interchange Format", STD 90, RFC 8259, DOI 10.17487/ 2913 RFC8259, December 2017, <https://www.rfc-editor.org/info/ 2914 rfc8259>. 2916 [SCTE35] Society of Cable Telecommunications Engineers, "Digital 2917 Program Insertion Cueing Message for Cable", ANSI/SCTE 35, 2918 August 2014, <http://www.scte.org/documents/pdf/Standards/ 2919 ANSI_SCTE%2035%202014.pdf>. 2921 [US_ASCII] 2922 American National Standards Institute, "Coded Character 2923 Sets - 7-Bit American National Standard Code for 2924 Information Interchange (7-Bit ASCII)", ANSI X3.4, 2925 December 1986. 2927 [WebVTT] World Wide Web Consortium (W3C), ""WebVTT: The Web Video 2928 Text Tracks Format", Draft Community Group Report", July 2929 2013, <http://dev.w3.org/html5/webvtt/>. 2931 12.2. Informative References 2933 [ID3] ID3.org, "The ID3 audio file data tagging format", 2934 <http://www.id3.org/Developer_Information>. 2936 [M3U] Nullsoft, Inc., "The M3U Playlist format, originally 2937 invented for the Winamp media player", 2938 <http://wikipedia.org/wiki/M3U>. 2940 [SampleEnc] 2941 Apple Inc., "MPEG-2 Stream Encryption Format for HTTP Live 2942 Streaming", <https://developer.apple.com/library/ios/ 2943 documentation/AudioVideo/Conceptual/ 2944 HLS_Sample_Encryption/>. 2946 [UNICODE] The Unicode Consortium, "The Unicode Standard", 2947 <https://www.unicode.org/versions/latest/>. 2949 [UTI] Apple Inc., "Uniform Type Identifier", 2950 <http://developer.apple.com/library/ios/#documentation/ 2951 general/conceptual/DevPedia-CocoaCore/ 2952 UniformTypeIdentifier.html>. 2954 Appendix A. Changes from RFC 8216 2956 Several changes have been made since the publication of RFC 8216 2957 [RFC8216]. 2959 The following tags have been added: EXT-X-GAP and EXT-X-DEFINE 2960 (including variable substitution). 2962 IMSC has been added to the set of recognized subtitle formats. 2964 The VIDEO-RANGE attribute has been added to the EXT-X-STREAM-INF and 2965 EXT-X-I-FRAME-STREAM-INF tags. 2967 TYPE-1 has been added as a defined value for the HDCP-LEVEL 2968 attribute. 2970 The minimum new segment publication latency has been removed from 2971 server timing model. 2973 The Availability Duration of a Media Segment now depends on the 2974 presence of an EXT-X-ENDLIST tag. 2976 The recommended playlist offset to join a live stream has changed. 2978 The minimum delay before reloading a Playlist file has changed. 2980 There have been a number of minor editorial changes. 2982 Author's Address 2984 Roger Pantos (editor) 2985 Apple Inc. 2986 Cupertino, California 2987 United States 2989 Email: http-live-streaming-review@group.apple.com