idnits 2.17.1 draft-pantos-hls-rfc8216bis-04.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 (March 24, 2019) is 1859 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. Checking references for intended status: Informational ---------------------------------------------------------------------------- ** Obsolete normative reference: RFC 2818 (Obsoleted by RFC 9110) ** Obsolete normative reference: RFC 7230 (Obsoleted by RFC 9110, RFC 9112) Summary: 2 errors (**), 0 flaws (~~), 2 warnings (==), 3 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Informational R. Pantos, Ed. 3 Internet-Draft Apple Inc. 4 Obsoletes: 8216 (if approved) March 24, 2019 5 Intended status: Informational 6 Expires: September 25, 2019 8 HTTP Live Streaming 2nd Edition 9 draft-pantos-hls-rfc8216bis-04 11 Abstract 13 This document obsoletes RFC 8216. It describes a protocol for 14 transferring unbounded streams of multimedia data. It specifies the 15 data format of the files and the actions to be taken by the server 16 (sender) and the clients (receivers) of the streams. It describes 17 version 8 of this protocol. 19 Status of This Memo 21 This Internet-Draft is submitted in full conformance with the 22 provisions of BCP 78 and BCP 79. 24 Internet-Drafts are working documents of the Internet Engineering 25 Task Force (IETF). Note that other groups may also distribute 26 working documents as Internet-Drafts. The list of current Internet- 27 Drafts is at https://datatracker.ietf.org/drafts/current/. 29 Internet-Drafts are draft documents valid for a maximum of six months 30 and may be updated, replaced, or obsoleted by other documents at any 31 time. It is inappropriate to use Internet-Drafts as reference 32 material or to cite them other than as "work in progress." 34 This Internet-Draft will expire on September 25, 2019. 36 Copyright Notice 38 Copyright (c) 2019 IETF Trust and the persons identified as the 39 document authors. All rights reserved. 41 This document is subject to BCP 78 and the IETF Trust's Legal 42 Provisions Relating to IETF Documents 43 (https://trustee.ietf.org/license-info) in effect on the date of 44 publication of this document. Please review these documents 45 carefully, as they describe your rights and restrictions with respect 46 to this document. 48 This document may not be modified, and derivative works of it may not 49 be created, except to format it for publication as an RFC or to 50 translate it into languages other than English. 52 This Informational Internet Draft is submitted as an RFC Editor 53 Contribution and/or non-IETF Document (not as a Contribution, IETF 54 Contribution, nor IETF Document) in accordance with BCP 78 and BCP 55 79. 57 Table of Contents 59 1. Introduction to HTTP Live Streaming . . . . . . . . . . . . . 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 . . . . . . . . . . . . . . . 64 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. When the PES timestamp wraps, the WebVTT segment 396 SHOULD have a X-TIMESTAMP-MAP header that maps the current WebVTT 397 time to the new (low valued) PES timestamp. 399 3.6. IMSC Subtitles 401 An IMSC Segment is a Fragmented MPEG-4 (Section 3.3) Media Segment 402 that carries subtitle media according to MPEG-4 Part 30 403 [MP4_TIMED_TEXT]. This subtitle media MUST comply with the Text 404 Profile of IMSC1 [IMSC1]. 406 The Media Initialization Section of an IMSC Segment is specified in 407 Section 3.3. 409 Each IMSC Segment MUST contain all subtitle samples that are intended 410 to be displayed during the period indicated by the segment EXTINF 411 duration. Each Segment MUST contain definitions for all styles which 412 are applied to any part of any sample in the Segment. 414 4. Playlists 416 This section describes the Playlist files used by HTTP Live 417 Streaming. In this section, "MUST" and "MUST NOT" specify the rules 418 for the syntax and structure of legal Playlist files. Playlists that 419 violate these rules are invalid; clients MUST fail to parse them. 420 See Section 6.3.2. 422 The format of the Playlist files is derived from the M3U [M3U] 423 playlist file format and inherits two tags from that earlier file 424 format: EXTM3U (Section 4.4.1.1) and EXTINF (Section 4.4.2.1). 426 In the specification of tag syntax, a string enclosed by <> 427 identifies a tag parameter; its specific format is described in its 428 tag definition. If a parameter is further surrounded by [], it is 429 optional; otherwise, it is required. 431 Each Playlist file MUST be identifiable either by the path component 432 of its URI or by HTTP Content-Type. In the first case, the path MUST 433 end with either .m3u8 or .m3u. In the second, the HTTP Content-Type 434 MUST be "application/vnd.apple.mpegurl" or "audio/mpegurl". Clients 435 SHOULD refuse to parse Playlists that are not so identified. 437 4.1. Definition of a Playlist 439 Playlist files MUST be encoded in UTF-8 [RFC3629]. They MUST NOT 440 contain any Byte Order Mark (BOM); clients SHOULD fail to parse 441 Playlists that contain a BOM or do not parse as UTF-8. Playlist 442 files MUST NOT contain UTF-8 control characters (U+0000 to U+001F and 443 U+007F to U+009F), with the exceptions of CR (U+000D) and LF 444 (U+000A). All character sequences MUST be normalized according to 445 Unicode normalization form "NFC" [UNICODE]. Note that US-ASCII 446 [US_ASCII] conforms to these rules. 448 Lines in a Playlist file are terminated by either a single line feed 449 character or a carriage return character followed by a line feed 450 character. Each line is a URI, is blank, or starts with the 451 character '#'. Blank lines are ignored. Whitespace MUST NOT be 452 present, except for elements in which it is explicitly specified. 454 Lines that start with the character '#' are either comments or tags. 455 Tags begin with #EXT. They are case sensitive. All other lines that 456 begin with '#' are comments and SHOULD be ignored. 458 A URI line identifies a Media Segment or a Playlist file (see 459 Section 4.4.4.2). Each Media Segment is specified by a URI and the 460 tags that apply to it. 462 A Playlist is a Media Playlist if all URI lines in the Playlist 463 identify Media Segments. A Playlist is a Master Playlist if all URI 464 lines in the Playlist identify Media Playlists. A Playlist MUST be 465 either a Media Playlist or a Master Playlist; all other Playlists are 466 invalid. 468 A URI in a Playlist, whether it is a URI line or part of a tag, MAY 469 be relative. Any relative URI is considered to be relative to the 470 URI of the Playlist that contains it. 472 The duration of a Media Playlist is the sum of the durations of the 473 Media Segments within it. 475 The segment bit rate of a Media Segment is the size of the Media 476 Segment divided by its EXTINF duration (Section 4.4.2.1). Note that 477 this includes container overhead but does not include overhead 478 imposed by the delivery system, such as HTTP, TCP, or IP headers. 480 The peak segment bit rate of a Media Playlist is the largest bit rate 481 of any contiguous set of segments whose total duration is between 0.5 482 and 1.5 times the target duration. The bit rate of a set is 483 calculated by dividing the sum of the segment sizes by the sum of the 484 segment durations. 486 The average segment bit rate of a Media Playlist is the sum of the 487 sizes (in bits) of every Media Segment in the Media Playlist, divided 488 by the Media Playlist duration. Note that this includes container 489 overhead, but not HTTP or other overhead imposed by the delivery 490 system. 492 4.2. Attribute Lists 494 Certain tags have values that are attribute-lists. An attribute-list 495 is a comma-separated list of attribute/value pairs with no 496 whitespace. 498 An attribute/value pair has the following syntax: 500 AttributeName=AttributeValue 502 An AttributeName is an unquoted string containing characters from the 503 set [A..Z], [0..9], and '-'. Therefore, AttributeNames contain only 504 uppercase letters, not lowercase. There MUST NOT be any whitespace 505 between the AttributeName and the '=' character, nor between the '=' 506 character and the AttributeValue. 508 An AttributeValue is one of the following: 510 o decimal-integer: an unquoted string of characters from the set 511 [0..9] expressing an integer in base-10 arithmetic in the range 512 from 0 to 2^64-1 (18446744073709551615). A decimal-integer may be 513 from 1 to 20 characters long. 515 o hexadecimal-sequence: an unquoted string of characters from the 516 set [0..9] and [A..F] that is prefixed with 0x or 0X. The maximum 517 length of a hexadecimal-sequence depends on its AttributeNames. 519 o decimal-floating-point: an unquoted string of characters from the 520 set [0..9] and '.' that expresses a non-negative floating-point 521 number in decimal positional notation. 523 o signed-decimal-floating-point: an unquoted string of characters 524 from the set [0..9], '-', and '.' that expresses a signed 525 floating-point number in decimal positional notation. 527 o quoted-string: a string of characters within a pair of double 528 quotes (0x22). The following characters MUST NOT appear in a 529 quoted-string: line feed (0xA), carriage return (0xD), or double 530 quote (0x22). Quoted-string AttributeValues SHOULD be constructed 531 so that byte-wise comparison is sufficient to test two quoted- 532 string AttributeValues for equality. Note that this implies case- 533 sensitive comparison. 535 o enumerated-string: an unquoted character string from a set that is 536 explicitly defined by the AttributeName. An enumerated-string 537 will never contain double quotes ("), commas (,), or whitespace. 539 o decimal-resolution: two decimal-integers separated by the "x" 540 character. The first integer is a horizontal pixel dimension 541 (width); the second is a vertical pixel dimension (height). 543 The type of the AttributeValue for a given AttributeName is specified 544 by the attribute definition. 546 A given AttributeName MUST NOT appear more than once in a given 547 attribute-list. Clients SHOULD refuse to parse such Playlists. 549 4.3. Variable Substitution 551 The following Playlist elements are subject to variable substitution: 553 o URI lines 555 o quoted-string AttributeValues 557 o hexadecimal-sequence AttributeValues 558 A Variable Reference is a string of the form "{$" (0x7B,0x24) 559 followed by a Variable Name followed by "}" (0x7D). Variable Names 560 are defined by the EXT-X-DEFINE tag (Section 4.4.5.3). 562 See Section 6.3.1 for more information about variable substitution. 564 4.4. Playlist Tags 566 Playlist tags specify either global parameters of the Playlist or 567 information about the Media Segments or Media Playlists that appear 568 after them. 570 4.4.1. Basic Tags 572 These tags are allowed in both Media Playlists and Master Playlists. 574 4.4.1.1. EXTM3U 576 The EXTM3U tag indicates that the file is an Extended M3U [M3U] 577 Playlist file. It MUST be the first line of every Media Playlist and 578 every Master Playlist. Its format is: 580 #EXTM3U 582 4.4.1.2. EXT-X-VERSION 584 The EXT-X-VERSION tag indicates the compatibility version of the 585 Playlist file, its associated media, and its server. 587 The EXT-X-VERSION tag applies to the entire Playlist file. Its 588 format is: 590 #EXT-X-VERSION: 592 where n is an integer indicating the protocol compatibility version 593 number. 595 It MUST appear in all Playlists containing tags or attributes that 596 are not compatible with protocol version 1 to support 597 interoperability with older clients. Section 7 specifies the minimum 598 value of the compatibility version number for any given Playlist 599 file. 601 A Playlist file MUST NOT contain more than one EXT-X-VERSION tag. If 602 a client encounters a Playlist with multiple EXT-X-VERSION tags, it 603 MUST fail to parse it. 605 4.4.2. Media Segment Tags 607 Each Media Segment is specified by a series of Media Segment tags 608 followed by a URI. Some Media Segment tags apply to just the next 609 segment; others apply to all subsequent segments until another 610 instance of the same tag. 612 A Media Segment tag MUST NOT appear in a Master Playlist. Clients 613 MUST fail to parse Playlists that contain both Media Segment tags and 614 Master Playlist tags (Section 4.4.4). 616 4.4.2.1. EXTINF 618 The EXTINF tag specifies the duration of a Media Segment. It applies 619 only to the next Media Segment. This tag is REQUIRED for each Media 620 Segment. Its format is: 622 #EXTINF:,[] 624 where duration is a decimal-floating-point or decimal-integer number 625 (as described in Section 4.2) that specifies the duration of the 626 Media Segment in seconds. Durations SHOULD be decimal-floating- 627 point, with enough accuracy to avoid perceptible error when segment 628 durations are accumulated. However, if the compatibility version 629 number is less than 3, durations MUST be integers. Durations that 630 are reported as integers SHOULD be rounded to the nearest integer. 631 The remainder of the line following the comma is an optional human- 632 readable informative title of the Media Segment expressed as UTF-8 633 text. 635 4.4.2.2. EXT-X-BYTERANGE 637 The EXT-X-BYTERANGE tag indicates that a Media Segment is a sub-range 638 of the resource identified by its URI. It applies only to the next 639 URI line that follows it in the Playlist. Its format is: 641 #EXT-X-BYTERANGE:<n>[@<o>] 643 where n is a decimal-integer indicating the length of the sub-range 644 in bytes. If present, o is a decimal-integer indicating the start of 645 the sub-range, as a byte offset from the beginning of the resource. 646 If o is not present, the sub-range begins at the next byte following 647 the sub-range of the previous Media Segment. 649 If o is not present, a previous Media Segment MUST appear in the 650 Playlist file and MUST be a sub-range of the same media resource, or 651 the Media Segment is undefined and the client MUST fail to parse the 652 Playlist. 654 A Media Segment without an EXT-X-BYTERANGE tag consists of the entire 655 resource identified by its URI. 657 Use of the EXT-X-BYTERANGE tag REQUIRES a compatibility version 658 number of 4 or greater. 660 4.4.2.3. EXT-X-DISCONTINUITY 662 The EXT-X-DISCONTINUITY tag indicates a discontinuity between the 663 Media Segment that follows it and the one that preceded it. 665 Its format is: 667 #EXT-X-DISCONTINUITY 669 The EXT-X-DISCONTINUITY tag MUST be present if there is a change in 670 any of the following characteristics: 672 o file format 674 o number, type, and identifiers of tracks 676 o timestamp sequence 678 The EXT-X-DISCONTINUITY tag SHOULD be present if there is a change in 679 any of the following characteristics: 681 o encoding parameters 683 o encoding sequence 685 See Section 3, Section 6.2.1, and Section 6.3.3 for more information 686 about the EXT-X-DISCONTINUITY tag. 688 4.4.2.4. EXT-X-KEY 690 Media Segments MAY be encrypted. The EXT-X-KEY tag specifies how to 691 decrypt them. It applies to every Media Segment and to every Media 692 Initialization Section declared by an EXT-X-MAP tag that appears 693 between it and the next EXT-X-KEY tag in the Playlist file with the 694 same KEYFORMAT attribute (or the end of the Playlist file). Two or 695 more EXT-X-KEY tags with different KEYFORMAT attributes MAY apply to 696 the same Media Segment if they ultimately produce the same decryption 697 key. The format is: 699 #EXT-X-KEY:<attribute-list> 701 The following attributes are defined: 703 METHOD 705 The value is an enumerated-string that specifies the encryption 706 method. This attribute is REQUIRED. 708 The methods defined are: NONE, AES-128, and SAMPLE-AES. 710 An encryption method of NONE means that Media Segments are not 711 encrypted. If the encryption method is NONE, other attributes 712 MUST NOT be present. 714 An encryption method of AES-128 signals that Media Segments are 715 completely encrypted using the Advanced Encryption Standard (AES) 716 [AES_128] with a 128-bit key, Cipher Block Chaining (CBC), and 717 Public-Key Cryptography Standards #7 (PKCS7) padding [RFC5652]. 718 CBC is restarted on each segment boundary, using either the 719 Initialization Vector (IV) attribute value or the Media Sequence 720 Number as the IV; see Section 5.2. 722 An alternative to whole-segment encryption is Sample Encryption. 723 With Sample Encryption, only media sample data - such as audio 724 packets or video frames - is encrypted. The rest of the Media 725 Segment is unencrypted. Sample Encryption allows parts of the 726 Segment to be processed without (or before) decrypting the media 727 itself. 729 An encryption method of SAMPLE-AES means that the Media Segments 730 are Sample Encrypted using the Advanced Encryption Standard 731 [AES_128]. How these media streams are encrypted and encapsulated 732 in a segment depends on the media encoding and the media format of 733 the segment. fMP4 Media Segments are encrypted using the 'cbcs' 734 scheme of Common Encryption [COMMON_ENC]. Encryption of other 735 Media Segment formats containing H.264 [H_264], AAC [ISO_14496], 736 AC-3 [AC_3], and Enhanced AC-3 [AC_3] media streams is described 737 in the HTTP Live Streaming (HLS) Sample Encryption specification 738 [SampleEnc]. The IV attribute MAY be present; see Section 5.2. 740 URI 742 The value is a quoted-string containing a URI that specifies how 743 to obtain the key. This attribute is REQUIRED unless the METHOD 744 is NONE. 746 IV 748 The value is a hexadecimal-sequence that specifies a 128-bit 749 unsigned integer Initialization Vector to be used with the key. 751 Use of the IV attribute REQUIRES a compatibility version number of 752 2 or greater. See Section 5.2 for when the IV attribute is used. 754 KEYFORMAT 756 The value is a quoted-string that specifies how the key is 757 represented in the resource identified by the URI; see Section 5 758 for more detail. This attribute is OPTIONAL; its absence 759 indicates an implicit value of "identity". Use of the KEYFORMAT 760 attribute REQUIRES a compatibility version number of 5 or greater. 762 KEYFORMATVERSIONS 764 The value is a quoted-string containing one or more positive 765 integers separated by the "/" character (for example, "1", "1/2", 766 or "1/2/5"). If more than one version of a particular KEYFORMAT 767 is defined, this attribute can be used to indicate which 768 version(s) this instance complies with. This attribute is 769 OPTIONAL; if it is not present, its value is considered to be "1". 770 Use of the KEYFORMATVERSIONS attribute REQUIRES a compatibility 771 version number of 5 or greater. 773 If the Media Playlist file does not contain an EXT-X-KEY tag, then 774 Media Segments are not encrypted. 776 See Section 5 for the format of the Key file, and Section 5.2, 777 Section 6.2.3, and Section 6.3.6 for additional information on Media 778 Segment encryption. 780 4.4.2.5. EXT-X-MAP 782 The EXT-X-MAP tag specifies how to obtain the Media Initialization 783 Section (Section 3) required to parse the applicable Media Segments. 784 It applies to every Media Segment that appears after it in the 785 Playlist until the next EXT-X-MAP tag or until the end of the 786 Playlist. 788 Its format is: 790 #EXT-X-MAP:<attribute-list> 792 The following attributes are defined: 794 URI 796 The value is a quoted-string containing a URI that identifies a 797 resource that contains the Media Initialization Section. This 798 attribute is REQUIRED. 800 BYTERANGE 802 The value is a quoted-string specifying a byte range into the 803 resource identified by the URI attribute. This range SHOULD 804 contain only the Media Initialization Section. The format of the 805 byte range is described in Section 4.4.2.2. This attribute is 806 OPTIONAL; if it is not present, the byte range is the entire 807 resource indicated by the URI. 809 An EXT-X-MAP tag SHOULD be supplied for Media Segments in Playlists 810 with the EXT-X-I-FRAMES-ONLY tag when the first Media Segment (i.e., 811 I-frame) in the Playlist (or the first segment following an EXT- 812 X-DISCONTINUITY tag) does not immediately follow the Media 813 Initialization Section at the beginning of its resource. 815 Use of the EXT-X-MAP tag in a Media Playlist that contains the EXT- 816 X-I-FRAMES-ONLY tag REQUIRES a compatibility version number of 5 or 817 greater. Use of the EXT-X-MAP tag in a Media Playlist that DOES NOT 818 contain the EXT-X-I-FRAMES-ONLY tag REQUIRES a compatibility version 819 number of 6 or greater. 821 If the Media Initialization Section declared by an EXT-X-MAP tag is 822 encrypted with a METHOD of AES-128, the IV attribute of the EXT-X-KEY 823 tag that applies to the EXT-X-MAP is REQUIRED. 825 4.4.2.6. EXT-X-PROGRAM-DATE-TIME 827 The EXT-X-PROGRAM-DATE-TIME tag associates the first sample of a 828 Media Segment with an absolute date and/or time. It applies only to 829 the next Media Segment. Its format is: 831 #EXT-X-PROGRAM-DATE-TIME:<date-time-msec> 833 where date-time-msec is an ISO/IEC 8601:2004 [ISO_8601] date/time 834 representation, such as YYYY-MM-DDThh:mm:ss.SSSZ. It SHOULD indicate 835 a time zone and fractional parts of seconds, to millisecond accuracy. 837 For example: 839 #EXT-X-PROGRAM-DATE-TIME:2010-02-19T14:54:23.031+08:00 841 See Section 6.2.1 and Section 6.3.3 for more information on the EXT- 842 X-PROGRAM-DATE-TIME tag. 844 4.4.2.7. EXT-X-DATERANGE 846 The EXT-X-DATERANGE tag associates a Date Range (i.e., a range of 847 time defined by a starting and ending date) with a set of attribute/ 848 value pairs. Its format is: 850 #EXT-X-DATERANGE:<attribute-list> 852 where the defined attributes are: 854 ID 856 A quoted-string that uniquely identifies a Date Range in the 857 Playlist. This attribute is REQUIRED. 859 CLASS 861 A client-defined quoted-string that specifies some set of 862 attributes and their associated value semantics. All Date Ranges 863 with the same CLASS attribute value MUST adhere to these 864 semantics. This attribute is OPTIONAL. 866 START-DATE 868 A quoted-string containing the ISO-8601 date at which the Date 869 Range begins. This attribute is REQUIRED. 871 END-DATE 873 A quoted-string containing the ISO-8601 date at which the Date 874 Range ends. It MUST be equal to or later than the value of the 875 START-DATE attribute. This attribute is OPTIONAL. 877 DURATION 879 The duration of the Date Range expressed as a decimal-floating- 880 point number of seconds. It MUST NOT be negative. A single 881 instant in time (e.g., crossing a finish line) SHOULD be 882 represented with a duration of 0. This attribute is OPTIONAL. 884 PLANNED-DURATION 886 The expected duration of the Date Range expressed as a decimal- 887 floating-point number of seconds. It MUST NOT be negative. This 888 attribute SHOULD be used to indicate the expected duration of a 889 Date Range whose actual duration is not yet known. It is 890 OPTIONAL. 892 X-<client-attribute> 894 The "X-" prefix defines a namespace reserved for client-defined 895 attributes. The client-attribute MUST be a legal AttributeName. 896 Clients SHOULD use a reverse-DNS syntax when defining their own 897 attribute names to avoid collisions. The attribute value MUST be 898 a quoted-string, a hexadecimal-sequence, or a decimal-floating- 899 point. An example of a client-defined attribute is X-COM-EXAMPLE- 900 AD-ID="XYZ123". These attributes are OPTIONAL. 902 SCTE35-CMD, SCTE35-OUT, SCTE35-IN 904 Used to carry SCTE-35 data; see Section 4.4.2.7.1 for more 905 information. These attributes are OPTIONAL. 907 END-ON-NEXT 909 An enumerated-string whose value MUST be YES. This attribute 910 indicates that the end of the range containing it is equal to the 911 START-DATE of its Following Range. The Following Range is the 912 Date Range of the same CLASS that has the earliest START-DATE 913 after the START-DATE of the range in question. This attribute is 914 OPTIONAL. 916 An EXT-X-DATERANGE tag with an END-ON-NEXT=YES attribute MUST have a 917 CLASS attribute. Other EXT-X-DATERANGE tags with the same CLASS 918 attribute MUST NOT specify Date Ranges that overlap. 920 An EXT-X-DATERANGE tag with an END-ON-NEXT=YES attribute MUST NOT 921 contain DURATION or END-DATE attributes. 923 A Date Range with neither a DURATION, an END-DATE, nor an END-ON- 924 NEXT=YES attribute has an unknown duration, even if it has a PLANNED- 925 DURATION. 927 If a Playlist contains an EXT-X-DATERANGE tag, it MUST also contain 928 at least one EXT-X-PROGRAM-DATE-TIME tag. 930 If a Playlist contains two EXT-X-DATERANGE tags with the same ID 931 attribute value, then any AttributeName that appears in both tags 932 MUST have the same AttributeValue. 934 If a Date Range contains both a DURATION attribute and an END-DATE 935 attribute, the value of the END-DATE attribute MUST be equal to the 936 value of the START-DATE attribute plus the value of the DURATION 937 attribute. 939 Clients SHOULD ignore EXT-X-DATERANGE tags with illegal syntax. 941 4.4.2.7.1. Mapping SCTE-35 into EXT-X-DATERANGE 943 Splice information carried in source media according to the SCTE-35 944 specification [SCTE35] MAY be represented in a Media Playlist using 945 EXT-X-DATERANGE tags. 947 Each SCTE-35 splice_info_section() containing a splice_null(), 948 splice_schedule(), bandwidth_reservation(), or private_cmd() SHOULD 949 be represented by an EXT-X-DATERANGE tag with an SCTE35-CMD attribute 950 whose value is the big-endian binary representation of the 951 splice_info_section(), expressed as a hexadecimal-sequence. 953 An SCTE-35 splice out/in pair signaled by a pair of splice_insert() 954 commands SHOULD be represented by one or more EXT-X-DATERANGE tags 955 carrying the same ID attribute, which MUST be unique to that splice 956 out/in pair. The "out" splice_info_section() (with 957 out_of_network_indicator set to 1) MUST be placed in an SCTE35-OUT 958 attribute, with the same formatting as SCTE35-CMD. The "in" 959 splice_info_section() (with out_of_network_indicator set to 0) MUST 960 be placed in an SCTE35-IN attribute, with the same formatting as 961 SCTE35-CMD. 963 An SCTE-35 splice out/in pair signaled by a pair of time_signal() 964 commands, each carrying a single segmentation_descriptor(), SHOULD be 965 represented by one or more EXT-X-DATERANGE tags carrying the same ID 966 attribute, which MUST be unique to that splice out/in pair. The 967 "out" splice_info_section() MUST be placed in an SCTE35-OUT 968 attribute; the "in" splice_info_section() MUST be placed in an 969 SCTE35-IN attribute. 971 Different types of segmentation, as indicated by the 972 segmentation_type_id in the segmentation_descriptor(), SHOULD be 973 represented by separate EXT-X-DATERANGE tags, even if two or more 974 segmentation_descriptor()s arrive in the same splice_info_section(). 975 In that case, each EXT-X-DATERANGE tag will have an SCTE35-OUT, 976 SCTE35-IN, or SCTE35-CMD attribute whose value is the entire 977 splice_info_section(). 979 An SCTE-35 time_signal() command that does not signal a splice out or 980 in point SHOULD be represented by an EXT-X-DATERANGE tag with an 981 SCTE35-CMD attribute. 983 The START-DATE of an EXT-X-DATERANGE tag containing an SCTE35-OUT 984 attribute MUST be the date and time that corresponds to the program 985 time of that splice. 987 The START-DATE of an EXT-X-DATERANGE tag containing an SCTE35-CMD 988 MUST be the date and time specified by the splice_time() in the 989 command or the program time at which the command appeared in the 990 source stream if the command does not specify a splice_time(). 992 An EXT-X-DATERANGE tag containing an SCTE35-OUT attribute MAY contain 993 a PLANNED-DURATION attribute. Its value MUST be the planned duration 994 of the splice. 996 The DURATION of an EXT-X-DATERANGE tag containing an SCTE35-IN 997 attribute MUST be the actual (not planned) program duration between 998 the corresponding out-point and that in-point. 1000 The END-DATE of an EXT-X-DATERANGE tag containing an SCTE35-IN 1001 attribute MUST be the actual (not planned) program date and time of 1002 that in-point. 1004 If the actual end date and time is not known when an SCTE35-OUT 1005 attribute is added to the Playlist, the DURATION attribute and the 1006 END-TIME attribute MUST NOT be present; the actual end date of the 1007 splice SHOULD be signaled by another EXT-X-DATERANGE tag once it has 1008 been established. 1010 A canceled splice SHOULD NOT appear in the Playlist as an EXT- 1011 X-DATERANGE tag. 1013 An EXT-X-DATERANGE tag announcing a splice SHOULD be added to a 1014 Playlist at the same time as the last pre-splice Media Segment, or 1015 earlier if possible. 1017 The ID attribute of an EXT-X-DATERANGE tag MAY contain a 1018 splice_event_id and/or a segmentation_event_id, but it MUST be unique 1019 in the Playlist. If there is a possibility that an SCTE-35 id will 1020 be reused, the ID attribute value MUST include disambiguation, such 1021 as a date or sequence number. 1023 4.4.2.8. EXT-X-GAP 1025 The EXT-X-GAP tag indicates that the segment URL to which it applies 1026 does not contain media data and SHOULD NOT be loaded by clients. It 1027 applies only to the next Media Segment. 1029 Its format is: 1031 #EXT-X-GAP 1033 See Section 6.2.1 and Section 6.3.3 for more information on the EXT- 1034 X-GAP tag. 1036 4.4.2.9. EXT-X-BITRATE 1038 The EXT-X-BITRATE tag identifies the approximate segment bit rate of 1039 the Media Segment(s) to which it applies. It applies to every Media 1040 Segment between it and the next EXT-X-BITRATE tag in the Playlist 1041 file (or the end of the Playlist file) that does not have an EXT- 1042 X-BYTERANGE tag applied to it. Its format is: 1044 #EXT-X-BITRATE:<rate> 1046 where rate is a decimal-integer of kilobits per second. 1048 This tag is OPTIONAL. If it is present then its value MUST be no 1049 less than 90% of the segment bit rate of each Media Segment to which 1050 it is applied and no greater than 110% of the segment bit rate of 1051 each Media Segment to which it is applied. 1053 4.4.3. Media Playlist Tags 1055 Media Playlist tags describe global parameters of the Media Playlist. 1056 There MUST NOT be more than one Media Playlist tag of each type in 1057 any Media Playlist. 1059 A Media Playlist tag MUST NOT appear in a Master Playlist 1061 4.4.3.1. EXT-X-TARGETDURATION 1063 The EXT-X-TARGETDURATION tag specifies the maximum Media Segment 1064 duration. The EXTINF duration of each Media Segment in the Playlist 1065 file, when rounded to the nearest integer, MUST be less than or equal 1066 to the target duration; longer segments can trigger playback stalls 1067 or other errors. It applies to the entire Playlist file. Its format 1068 is: 1070 #EXT-X-TARGETDURATION:<s> 1072 where s is a decimal-integer indicating the target duration in 1073 seconds. The EXT-X-TARGETDURATION tag is REQUIRED. 1075 4.4.3.2. EXT-X-MEDIA-SEQUENCE 1077 The EXT-X-MEDIA-SEQUENCE tag indicates the Media Sequence Number of 1078 the first Media Segment that appears in a Playlist file. Its format 1079 is: 1081 #EXT-X-MEDIA-SEQUENCE:<number> 1083 where number is a decimal-integer. 1085 If the Media Playlist file does not contain an EXT-X-MEDIA-SEQUENCE 1086 tag, then the Media Sequence Number of the first Media Segment in the 1087 Media Playlist SHALL be considered to be 0. A client MUST NOT assume 1088 that segments with the same Media Sequence Number in different Media 1089 Playlists contain matching content (see Section 6.3.2). 1091 A URI for a Media Segment is not required to contain its Media 1092 Sequence Number. 1094 See Section 6.2.1 and Section 6.3.5 for more information on setting 1095 the EXT-X-MEDIA-SEQUENCE tag. 1097 The EXT-X-MEDIA-SEQUENCE tag MUST appear before the first Media 1098 Segment in the Playlist. 1100 4.4.3.3. EXT-X-DISCONTINUITY-SEQUENCE 1102 The EXT-X-DISCONTINUITY-SEQUENCE tag allows synchronization between 1103 different Renditions of the same Variant Stream or different Variant 1104 Streams that have EXT-X-DISCONTINUITY tags in their Media Playlists. 1106 Its format is: 1108 #EXT-X-DISCONTINUITY-SEQUENCE:<number> 1110 where number is a decimal-integer. 1112 If the Media Playlist does not contain an EXT-X-DISCONTINUITY- 1113 SEQUENCE tag, then the Discontinuity Sequence Number of the first 1114 Media Segment in the Playlist SHALL be considered to be 0. 1116 The EXT-X-DISCONTINUITY-SEQUENCE tag MUST appear before the first 1117 Media Segment in the Playlist. 1119 The EXT-X-DISCONTINUITY-SEQUENCE tag MUST appear before any EXT- 1120 X-DISCONTINUITY tag. 1122 See Section 6.2.1 and Section 6.2.2 for more information about 1123 setting the value of the EXT-X-DISCONTINUITY-SEQUENCE tag. 1125 4.4.3.4. EXT-X-ENDLIST 1127 The EXT-X-ENDLIST tag indicates that no more Media Segments will be 1128 added to the Media Playlist file. It MAY occur anywhere in the Media 1129 Playlist file. Its format is: 1131 #EXT-X-ENDLIST 1133 4.4.3.5. EXT-X-PLAYLIST-TYPE 1135 The EXT-X-PLAYLIST-TYPE tag provides mutability information about the 1136 Media Playlist file. It applies to the entire Media Playlist file. 1137 It is OPTIONAL. Its format is: 1139 #EXT-X-PLAYLIST-TYPE:<type-enum> 1141 where type-enum is either EVENT or VOD. 1143 Section 6.2.1 defines the implications of the EXT-X-PLAYLIST-TYPE 1144 tag. 1146 If the EXT-X-PLAYLIST-TYPE value is EVENT, Media Segments can only be 1147 added to the end of the Media Playlist. If the EXT-X-PLAYLIST-TYPE 1148 value is Video On Demand (VOD), the Media Playlist cannot change. 1150 If the EXT-X-PLAYLIST-TYPE tag is omitted from a Media Playlist, the 1151 Playlist can be updated according to the rules in Section 6.2.1 with 1152 no additional restrictions. For example, a live Playlist 1153 (Section 6.2.2) MAY be updated to remove Media Segments in the order 1154 that they appeared. 1156 4.4.3.6. EXT-X-I-FRAMES-ONLY 1158 The EXT-X-I-FRAMES-ONLY tag indicates that each Media Segment in the 1159 Playlist describes a single I-frame. I-frames are encoded video 1160 frames whose decoding does not depend on any other frame. I-frame 1161 Playlists can be used for trick play, such as fast forward, rapid 1162 reverse, and scrubbing. 1164 The EXT-X-I-FRAMES-ONLY tag applies to the entire Playlist. Its 1165 format is: 1167 #EXT-X-I-FRAMES-ONLY 1169 In a Playlist with the EXT-X-I-FRAMES-ONLY tag, the Media Segment 1170 duration (EXTINF tag value) is the time between the presentation time 1171 of the I-frame in the Media Segment and the presentation time of the 1172 next I-frame in the Playlist, or the end of the presentation if it is 1173 the last I-frame in the Playlist. 1175 Media resources containing I-frame segments MUST begin with either a 1176 Media Initialization Section (Section 3) or be accompanied by an EXT- 1177 X-MAP tag indicating the Media Initialization Section so that clients 1178 can load and decode I-frame segments in any order. The byte range of 1179 an I-frame segment with an EXT-X-BYTERANGE tag applied to it 1180 (Section 4.4.2.2) MUST NOT include its Media Initialization Section; 1181 clients can assume that the Media Initialization Section is defined 1182 by the EXT-X-MAP tag, or is located between the start of the resource 1183 and the offset of the first I-frame segment in that resource. 1185 Use of the EXT-X-I-FRAMES-ONLY REQUIRES a compatibility version 1186 number of 4 or greater. 1188 4.4.4. Master Playlist Tags 1190 Master Playlist tags define the Variant Streams, Renditions, and 1191 other global parameters of the presentation. 1193 Master Playlist tags MUST NOT appear in a Media Playlist; clients 1194 MUST fail to parse any Playlist that contains both a Master Playlist 1195 tag and either a Media Playlist tag or a Media Segment tag. 1197 4.4.4.1. EXT-X-MEDIA 1199 The EXT-X-MEDIA tag is used to relate Media Playlists that contain 1200 alternative Renditions (Section 4.4.4.2.1) of the same content. For 1201 example, three EXT-X-MEDIA tags can be used to identify audio-only 1202 Media Playlists that contain English, French, and Spanish Renditions 1203 of the same presentation. Or, two EXT-X-MEDIA tags can be used to 1204 identify video-only Media Playlists that show two different camera 1205 angles. 1207 Its format is: 1209 #EXT-X-MEDIA:<attribute-list> 1211 The following attributes are defined: 1213 TYPE 1215 The value is an enumerated-string; valid strings are AUDIO, VIDEO, 1216 SUBTITLES, and CLOSED-CAPTIONS. This attribute is REQUIRED. 1218 Typically, closed-caption [CEA608] media is carried in the video 1219 stream. Therefore, an EXT-X-MEDIA tag with TYPE of CLOSED- 1220 CAPTIONS does not specify a Rendition; the closed-caption media is 1221 present in the Media Segments of every video Rendition. 1223 URI 1225 The value is a quoted-string containing a URI that identifies the 1226 Media Playlist file. This attribute is OPTIONAL; see 1227 Section 4.4.4.2.1. If the TYPE is CLOSED-CAPTIONS, the URI 1228 attribute MUST NOT be present. 1230 GROUP-ID 1232 The value is a quoted-string that specifies the group to which the 1233 Rendition belongs. See Section 4.4.4.1.1. This attribute is 1234 REQUIRED. 1236 LANGUAGE 1238 The value is a quoted-string containing one of the standard Tags 1239 for Identifying Languages [RFC5646], which identifies the primary 1240 language used in the Rendition. This attribute is OPTIONAL. 1242 ASSOC-LANGUAGE 1244 The value is a quoted-string containing a language tag [RFC5646] 1245 that identifies a language that is associated with the Rendition. 1246 An associated language is often used in a different role than the 1247 language specified by the LANGUAGE attribute (e.g., written versus 1248 spoken, or a fallback dialect). This attribute is OPTIONAL. 1250 The LANGUAGE and ASSOC-LANGUAGE attributes can be used, for 1251 example, to link Norwegian Renditions that use different spoken 1252 and written languages. 1254 NAME 1256 The value is a quoted-string containing a human-readable 1257 description of the Rendition. If the LANGUAGE attribute is 1258 present, then this description SHOULD be in that language. This 1259 attribute is REQUIRED. 1261 DEFAULT 1263 The value is an enumerated-string; valid strings are YES and NO. 1264 If the value is YES, then the client SHOULD play this Rendition of 1265 the content in the absence of information from the user indicating 1266 a different choice. This attribute is OPTIONAL. Its absence 1267 indicates an implicit value of NO. 1269 AUTOSELECT 1271 The value is an enumerated-string; valid strings are YES and NO. 1272 This attribute is OPTIONAL. Its absence indicates an implicit 1273 value of NO. If the value is YES, then the client MAY choose to 1274 play this Rendition in the absence of explicit user preference 1275 because it matches the current playback environment, such as 1276 chosen system language. 1278 If the AUTOSELECT attribute is present, its value MUST be YES if 1279 the value of the DEFAULT attribute is YES. 1281 FORCED 1283 The value is an enumerated-string; valid strings are YES and NO. 1284 This attribute is OPTIONAL. Its absence indicates an implicit 1285 value of NO. The FORCED attribute MUST NOT be present unless the 1286 TYPE is SUBTITLES. 1288 A value of YES indicates that the Rendition contains content that 1289 is considered essential to play. When selecting a FORCED 1290 Rendition, a client SHOULD choose the one that best matches the 1291 current playback environment (e.g., language). 1293 A value of NO indicates that the Rendition contains content that 1294 is intended to be played in response to explicit user request. 1296 INSTREAM-ID 1298 The value is a quoted-string that specifies a Rendition within the 1299 segments in the Media Playlist. This attribute is REQUIRED if the 1300 TYPE attribute is CLOSED-CAPTIONS, in which case it MUST have one 1301 of the values: "CC1", "CC2", "CC3", "CC4", or "SERVICEn" where n 1302 MUST be an integer between 1 and 63 (e.g., "SERVICE9" or 1303 "SERVICE42"). 1305 The values "CC1", "CC2", "CC3", and "CC4" identify a Line 21 Data 1306 Services channel [CEA608]. The "SERVICE" values identify a 1307 Digital Television Closed Captioning [CEA708] service block 1308 number. 1310 For all other TYPE values, the INSTREAM-ID MUST NOT be specified. 1312 CHARACTERISTICS 1314 The value is a quoted-string containing one or more Uniform Type 1315 Identifiers [UTI] separated by comma (,) characters. This 1316 attribute is OPTIONAL. Each UTI indicates an individual 1317 characteristic of the Rendition. 1319 A SUBTITLES Rendition MAY include the following characteristics: 1320 "public.accessibility.transcribes-spoken-dialog", 1321 "public.accessibility.describes-music-and-sound", and 1322 "public.easy-to-read" (which indicates that the subtitles have 1323 been edited for ease of reading). 1325 An AUDIO Rendition MAY include the following characteristic: 1326 "public.accessibility.describes-video". 1328 The CHARACTERISTICS attribute MAY include private UTIs. 1330 CHANNELS 1332 The value is a quoted-string that specifies an ordered, slash- 1333 separated ("/") list of parameters. 1335 If the TYPE attribute is AUDIO, then the first parameter is a 1336 count of audio channels expressed as a decimal-integer, indicating 1337 the maximum number of independent, simultaneous audio channels 1338 present in any Media Segment in the Rendition. For example, an 1339 AC-3 5.1 Rendition would have a CHANNELS="6" attribute. 1341 If the TYPE attribute is AUDIO, then the second parameter 1342 identifies the encoding of object-based audio used by the 1343 Rendition. This parameter is a comma-separated list of Audio 1344 Object Coding Identifiers. It is optional. An Audio Object 1345 Coding Identifier is a string containing characters from the set 1346 [A..Z], [0..9], and '-'. They are codec-specific. A parameter 1347 value of consisting solely of the dash character (0x2D) indicates 1348 that the audio is not object-based. 1350 No other CHANNELS parameters are currently defined. 1352 All audio EXT-X-MEDIA tags SHOULD have a CHANNELS attribute. If a 1353 Master Playlist contains two Renditions with the same NAME encoded 1354 with the same codec but a different number of channels, then the 1355 CHANNELS attribute is REQUIRED; otherwise, it is OPTIONAL. 1357 4.4.4.1.1. Rendition Groups 1359 A set of one or more EXT-X-MEDIA tags with the same GROUP-ID value 1360 and the same TYPE value defines a Group of Renditions. Each member 1361 of the Group MUST be an alternative Rendition of the same content; 1362 otherwise, playback errors can occur. 1364 All EXT-X-MEDIA tags in a Playlist MUST meet the following 1365 constraints: 1367 o All EXT-X-MEDIA tags in the same Group MUST have different NAME 1368 attributes. 1370 o A Group MUST NOT have more than one member with a DEFAULT 1371 attribute of YES. 1373 o Each EXT-X-MEDIA tag with an AUTOSELECT=YES attribute SHOULD have 1374 a combination of LANGUAGE [RFC5646], ASSOC-LANGUAGE, FORCED, and 1375 CHARACTERISTICS attributes that is distinct from those of other 1376 AUTOSELECT=YES members of its Group. 1378 A Playlist MAY contain multiple Groups of the same TYPE in order to 1379 provide multiple encodings of that media type. If it does so, each 1380 Group of the same TYPE MUST have the same set of members, and each 1381 corresponding member MUST have identical attributes with the 1382 exception of the URI and CHANNELS attributes. 1384 Each member in a Group of Renditions MAY have a different sample 1385 format. For example, an English Rendition can be encoded with AC-3 1386 5.1 while a Spanish Rendition is encoded with AAC stereo. However, 1387 any EXT-X-STREAM-INF tag (Section 4.4.4.2) or EXT-X-I-FRAME-STREAM- 1388 INF tag (Section 4.4.4.3) that references such a Group MUST have a 1389 CODECS attribute that lists every sample format present in any 1390 Rendition in the Group, or client playback failures can occur. In 1391 the example above, the CODECS attribute would include 1392 "ac-3,mp4a.40.2". 1394 4.4.4.2. EXT-X-STREAM-INF 1396 The EXT-X-STREAM-INF tag specifies a Variant Stream, which is a set 1397 of Renditions that can be combined to play the presentation. The 1398 attributes of the tag provide information about the Variant Stream. 1400 The URI line that follows the EXT-X-STREAM-INF tag specifies a Media 1401 Playlist that carries a Rendition of the Variant Stream. The URI 1402 line is REQUIRED. Clients that do not support multiple video 1403 Renditions SHOULD play this Rendition. 1405 Its format is: 1407 #EXT-X-STREAM-INF:<attribute-list> 1408 <URI> 1410 The following attributes are defined: 1412 BANDWIDTH 1414 The value is a decimal-integer of bits per second. It represents 1415 the peak segment bit rate of the Variant Stream. 1417 If all the Media Segments in a Variant Stream have already been 1418 created, the BANDWIDTH value MUST be the largest sum of peak 1419 segment bit rates that is produced by any playable combination of 1420 Renditions. (For a Variant Stream with a single Media Playlist, 1421 this is just the peak segment bit rate of that Media Playlist.) 1422 An inaccurate value can cause playback stalls or prevent clients 1423 from playing the variant. 1425 If the Master Playlist is to be made available before all Media 1426 Segments in the presentation have been encoded, the BANDWIDTH 1427 value SHOULD be the BANDWIDTH value of a representative period of 1428 similar content, encoded using the same settings. 1430 Every EXT-X-STREAM-INF tag MUST include the BANDWIDTH attribute. 1432 AVERAGE-BANDWIDTH 1434 The value is a decimal-integer of bits per second. It represents 1435 the average segment bit rate of the Variant Stream. 1437 If all the Media Segments in a Variant Stream have already been 1438 created, the AVERAGE-BANDWIDTH value MUST be the largest sum of 1439 average segment bit rates that is produced by any playable 1440 combination of Renditions. (For a Variant Stream with a single 1441 Media Playlist, this is just the average segment bit rate of that 1442 Media Playlist.) An inaccurate value can cause playback stalls or 1443 prevent clients from playing the variant. 1445 If the Master Playlist is to be made available before all Media 1446 Segments in the presentation have been encoded, the AVERAGE- 1447 BANDWIDTH value SHOULD be the AVERAGE-BANDWIDTH value of a 1448 representative period of similar content, encoded using the same 1449 settings. 1451 The AVERAGE-BANDWIDTH attribute is OPTIONAL. 1453 CODECS 1455 The value is a quoted-string containing a comma-separated list of 1456 formats, where each format specifies a media sample type that is 1457 present in one or more Renditions specified by the Variant Stream. 1458 Valid format identifiers are those in the ISO Base Media File 1459 Format Name Space defined by "The 'Codecs' and 'Profiles' 1460 Parameters for "Bucket" Media Types" [RFC6381]. 1462 For example, a stream containing AAC low complexity (AAC-LC) audio 1463 and H.264 Main Profile Level 3.0 video would have a CODECS value 1464 of "mp4a.40.2,avc1.4d401e". 1466 Note that if a Variant Stream specifies one or more Renditions 1467 that include IMSC subtitles, the CODECS attribute MUST indicate 1468 this with a format identifier such as "stpp.ttml.im1t". 1470 Every EXT-X-STREAM-INF tag SHOULD include a CODECS attribute. 1472 RESOLUTION 1474 The value is a decimal-resolution describing the optimal pixel 1475 resolution at which to display all the video in the Variant 1476 Stream. 1478 The RESOLUTION attribute is OPTIONAL but is recommended if the 1479 Variant Stream includes video. 1481 FRAME-RATE 1483 The value is a decimal-floating-point describing the maximum frame 1484 rate for all the video in the Variant Stream, rounded to three 1485 decimal places. 1487 The FRAME-RATE attribute is OPTIONAL but is recommended if the 1488 Variant Stream includes video. The FRAME-RATE attribute SHOULD be 1489 included if any video in a Variant Stream exceeds 30 frames per 1490 second. 1492 HDCP-LEVEL 1494 The value is an enumerated-string; valid strings are TYPE-0, TYPE- 1495 1, and NONE. This attribute is advisory. A value of TYPE-0 1496 indicates that the Variant Stream could fail to play unless the 1497 output is protected by High-bandwidth Digital Content Protection 1498 (HDCP) Type 0 [HDCP] or equivalent. A value of TYPE-1 indicates 1499 that the Variant Stream could fail to play unless the output is 1500 protected by HDCP Type 1 or equivalent. A value of NONE indicates 1501 that the content does not require output copy protection. 1503 Encrypted Variant Streams with different HDCP levels SHOULD use 1504 different media encryption keys. 1506 The HDCP-LEVEL attribute is OPTIONAL. It SHOULD be present if any 1507 content in the Variant Stream will fail to play without HDCP. 1508 Clients without output copy protection SHOULD NOT load a Variant 1509 Stream with an HDCP-LEVEL attribute unless its value is NONE. 1511 VIDEO-RANGE 1513 The value is an enumerated-string; valid strings are SDR and PQ. 1515 The value MUST be SDR if all the video in the Variant Stream is 1516 encoded using a reference opto-electronic transfer characteristic 1517 function specified by the TransferCharacteristics code point 1 1518 [CICP]. 1520 The value MUST be PQ if video in the Variant Stream includes some 1521 content that is encoded using a reference opto-electronic transfer 1522 characteristic function specified by the TransferCharacteristics 1523 code point 16 or 18, and potentially other content qualifying as 1524 SDR (see above). Note that certain TransferCharacteristics code 1525 points use the same transfer function. 1527 Otherwise the attribute MUST NOT be present. 1529 AUDIO 1531 The value is a quoted-string. It MUST match the value of the 1532 GROUP-ID attribute of an EXT-X-MEDIA tag elsewhere in the Master 1533 Playlist whose TYPE attribute is AUDIO. It indicates the set of 1534 audio Renditions that SHOULD be used when playing the 1535 presentation. See Section 4.4.4.2.1. 1537 The AUDIO attribute is OPTIONAL. 1539 VIDEO 1541 The value is a quoted-string. It MUST match the value of the 1542 GROUP-ID attribute of an EXT-X-MEDIA tag elsewhere in the Master 1543 Playlist whose TYPE attribute is VIDEO. It indicates the set of 1544 video Renditions that SHOULD be used when playing the 1545 presentation. See Section 4.4.4.2.1. 1547 The VIDEO attribute is OPTIONAL. 1549 SUBTITLES 1551 The value is a quoted-string. It MUST match the value of the 1552 GROUP-ID attribute of an EXT-X-MEDIA tag elsewhere in the Master 1553 Playlist whose TYPE attribute is SUBTITLES. It indicates the set 1554 of subtitle Renditions that can be used when playing the 1555 presentation. See Section 4.4.4.2.1. 1557 The SUBTITLES attribute is OPTIONAL. 1559 CLOSED-CAPTIONS 1561 The value can be either a quoted-string or an enumerated-string 1562 with the value NONE. If the value is a quoted-string, it MUST 1563 match the value of the GROUP-ID attribute of an EXT-X-MEDIA tag 1564 elsewhere in the Playlist whose TYPE attribute is CLOSED-CAPTIONS, 1565 and it indicates the set of closed-caption Renditions that can be 1566 used when playing the presentation. See Section 4.4.4.2.1. 1568 If the value is the enumerated-string value NONE, all EXT-X- 1569 STREAM-INF tags MUST have this attribute with a value of NONE, 1570 indicating that there are no closed captions in any Variant Stream 1571 in the Master Playlist. Having closed captions in one Variant 1572 Stream but not another can trigger playback inconsistencies. 1574 The CLOSED-CAPTIONS attribute is OPTIONAL. 1576 4.4.4.2.1. Alternative Renditions 1578 When an EXT-X-STREAM-INF tag contains an AUDIO, VIDEO, SUBTITLES, or 1579 CLOSED-CAPTIONS attribute, it indicates that alternative Renditions 1580 of the content are available for playback of that Variant Stream. 1582 When defining alternative Renditions, the following constraints MUST 1583 be met to prevent client playback errors: 1585 o All playable combinations of Renditions associated with an EXT-X- 1586 STREAM-INF tag MUST have an aggregate bandwidth less than or equal 1587 to the BANDWIDTH attribute of the EXT-X-STREAM-INF tag. 1589 o If an EXT-X-STREAM-INF tag contains a RESOLUTION attribute and a 1590 VIDEO attribute, then every alternative video Rendition MUST have 1591 an optimal display resolution matching the value of the RESOLUTION 1592 attribute. 1594 o Every alternative Rendition associated with an EXT-X-STREAM-INF 1595 tag MUST meet the constraints for a Variant Stream described in 1596 Section 6.2.4. 1598 The URI attribute of the EXT-X-MEDIA tag is REQUIRED if the media 1599 type is SUBTITLES, but OPTIONAL if the media type is VIDEO or AUDIO. 1600 If the media type is VIDEO or AUDIO, a missing URI attribute 1601 indicates that the media data for this Rendition is included in the 1602 Media Playlist of any EXT-X-STREAM-INF tag referencing this EXT- 1603 X-MEDIA tag. If the media TYPE is AUDIO and the URI attribute is 1604 missing, clients MUST assume that the audio data for this Rendition 1605 is present in every video Rendition specified by the EXT-X-STREAM-INF 1606 tag. 1608 The URI attribute of the EXT-X-MEDIA tag MUST NOT be included if the 1609 media type is CLOSED-CAPTIONS. 1611 4.4.4.3. EXT-X-I-FRAME-STREAM-INF 1613 The EXT-X-I-FRAME-STREAM-INF tag identifies a Media Playlist file 1614 containing the I-frames of a multimedia presentation. It stands 1615 alone, in that it does not apply to a particular URI in the Master 1616 Playlist. Its format is: 1618 #EXT-X-I-FRAME-STREAM-INF:<attribute-list> 1620 All attributes defined for the EXT-X-STREAM-INF tag (Section 4.4.4.2) 1621 are also defined for the EXT-X-I-FRAME-STREAM-INF tag, except for the 1622 FRAME-RATE, AUDIO, SUBTITLES, and CLOSED-CAPTIONS attributes. In 1623 addition, the following attribute is defined: 1625 URI 1627 The value is a quoted-string containing a URI that identifies the 1628 I-frame Media Playlist file. That Playlist file MUST contain an 1629 EXT-X-I-FRAMES-ONLY tag. 1631 Every EXT-X-I-FRAME-STREAM-INF tag MUST include a BANDWIDTH attribute 1632 and a URI attribute. 1634 The provisions in Section 4.4.4.2.1 also apply to EXT-X-I-FRAME- 1635 STREAM-INF tags with a VIDEO attribute. 1637 A Master Playlist that specifies alternative VIDEO Renditions and 1638 I-frame Playlists SHOULD include an alternative I-frame VIDEO 1639 Rendition for each regular VIDEO Rendition, with the same NAME and 1640 LANGUAGE attributes. 1642 4.4.4.4. EXT-X-SESSION-DATA 1644 The EXT-X-SESSION-DATA tag allows arbitrary session data to be 1645 carried in a Master Playlist. 1647 Its format is: 1649 #EXT-X-SESSION-DATA:<attribute-list> 1651 The following attributes are defined: 1653 DATA-ID 1655 The value of DATA-ID is a quoted-string that identifies a 1656 particular data value. The DATA-ID SHOULD conform to a reverse 1657 DNS naming convention, such as "com.example.movie.title"; however, 1658 there is no central registration authority, so Playlist authors 1659 SHOULD take care to choose a value that is unlikely to collide 1660 with others. This attribute is REQUIRED. 1662 VALUE 1664 VALUE is a quoted-string. It contains the data identified by 1665 DATA-ID. If the LANGUAGE is specified, VALUE SHOULD contain a 1666 human-readable string written in the specified language. 1668 URI 1670 The value is a quoted-string containing a URI. The resource 1671 identified by the URI MUST be formatted as JSON [RFC8259]; 1672 otherwise, clients may fail to interpret the resource. 1674 LANGUAGE 1676 The value is a quoted-string containing a language tag [RFC5646] 1677 that identifies the language of the VALUE. This attribute is 1678 OPTIONAL. 1680 Each EXT-X-SESSION-DATA tag MUST contain either a VALUE or URI 1681 attribute, but not both. 1683 A Playlist MAY contain multiple EXT-X-SESSION-DATA tags with the same 1684 DATA-ID attribute. A Playlist MUST NOT contain more than one EXT-X- 1685 SESSION-DATA tag with the same DATA-ID attribute and the same 1686 LANGUAGE attribute. 1688 4.4.4.5. EXT-X-SESSION-KEY 1690 The EXT-X-SESSION-KEY tag allows encryption keys from Media Playlists 1691 to be specified in a Master Playlist. This allows the client to 1692 preload these keys without having to read the Media Playlist(s) 1693 first. 1695 Its format is: 1697 #EXT-X-SESSION-KEY:<attribute-list> 1699 All attributes defined for the EXT-X-KEY tag (Section 4.4.2.4) are 1700 also defined for the EXT-X-SESSION-KEY, except that the value of the 1701 METHOD attribute MUST NOT be NONE. If an EXT-X-SESSION-KEY is used, 1702 the values of the METHOD, KEYFORMAT, and KEYFORMATVERSIONS attributes 1703 MUST match any EXT-X-KEY with the same URI value. 1705 EXT-X-SESSION-KEY tags SHOULD be added if multiple Variant Streams or 1706 Renditions use the same encryption keys and formats. An EXT-X- 1707 SESSION-KEY tag is not associated with any particular Media Playlist. 1709 A Master Playlist MUST NOT contain more than one EXT-X-SESSION-KEY 1710 tag with the same METHOD, URI, IV, KEYFORMAT, and KEYFORMATVERSIONS 1711 attribute values. 1713 The EXT-X-SESSION-KEY tag is optional. 1715 4.4.5. Media or Master Playlist Tags 1717 The tags in this section can appear in either Master Playlists or 1718 Media Playlists. If one of these tags appears in a Master Playlist, 1719 it SHOULD NOT appear in any Media Playlist referenced by that Master 1720 Playlist. A tag that appears in both MUST have the same value; 1721 otherwise, clients SHOULD ignore the value in the Media Playlist(s). 1723 These tags MUST NOT appear more than once in a Playlist. If a tag 1724 appears more than once, clients MUST fail to parse the Playlist. 1726 4.4.5.1. EXT-X-INDEPENDENT-SEGMENTS 1728 The EXT-X-INDEPENDENT-SEGMENTS tag indicates that all media samples 1729 in a Media Segment can be decoded without information from other 1730 segments. It applies to every Media Segment in the Playlist. 1732 Its format is: 1734 #EXT-X-INDEPENDENT-SEGMENTS 1736 If the EXT-X-INDEPENDENT-SEGMENTS tag appears in a Master Playlist, 1737 it applies to every Media Segment in every Media Playlist in the 1738 Master Playlist. 1740 4.4.5.2. EXT-X-START 1742 The EXT-X-START tag indicates a preferred point at which to start 1743 playing a Playlist. By default, clients SHOULD start playback at 1744 this point when beginning a playback session. This tag is OPTIONAL. 1746 Its format is: 1748 #EXT-X-START:<attribute-list> 1750 The following attributes are defined: 1752 TIME-OFFSET 1753 The value of TIME-OFFSET is a signed-decimal-floating-point number 1754 of seconds. A positive number indicates a time offset from the 1755 beginning of the Playlist. A negative number indicates a negative 1756 time offset from the end of the last Media Segment in the 1757 Playlist. This attribute is REQUIRED. 1759 The absolute value of TIME-OFFSET SHOULD NOT be larger than the 1760 Playlist duration. If the absolute value of TIME-OFFSET exceeds 1761 the duration of the Playlist, it indicates either the end of the 1762 Playlist (if positive) or the beginning of the Playlist (if 1763 negative). 1765 If the Playlist does not contain the EXT-X-ENDLIST tag, the TIME- 1766 OFFSET SHOULD NOT be within three target durations of the end of 1767 the Playlist file. 1769 PRECISE 1771 The value is an enumerated-string; valid strings are YES and NO. 1772 If the value is YES, clients SHOULD start playback at the Media 1773 Segment containing the TIME-OFFSET, but SHOULD NOT render media 1774 samples in that segment whose presentation times are prior to the 1775 TIME-OFFSET. If the value is NO, clients SHOULD attempt to render 1776 every media sample in that segment. This attribute is OPTIONAL. 1777 If it is missing, its value should be treated as NO. 1779 4.4.5.3. EXT-X-DEFINE 1781 The EXT-X-DEFINE tag provides a Playlist variable definition or 1782 declaration. This tag is OPTIONAL. 1784 Its format is: 1786 #EXT-X-DEFINE:<attribute-list> 1788 The following attributes are defined: 1790 NAME 1792 The value is a quoted-string which specifies the Variable Name. 1793 All characters in the quoted-string MUST be from the following 1794 set: [a..z], [A..Z], [0..9], '-', and '_'. 1796 VALUE 1798 The value is a quoted-string which specifies the Variable Value. 1799 This attribute is REQUIRED if the EXT-X-DEFINE tag has a NAME 1800 attribute. 1802 IMPORT 1804 The value is a quoted-string which specifies the Variable Name and 1805 indicates that its value is that of the variable of the same name 1806 in the Master Playlist. EXT-X-DEFINE tags containing the IMPORT 1807 attribute MUST NOT occur in Master Playlists; they are only 1808 allowed in Media Playlists. 1810 If the IMPORT attribute value does not match any Variable Name 1811 declared in the Master Playlist, or if the Media Playlist was not 1812 loaded from a Master Playlist, the parser MUST fail to parse the 1813 Playlist. 1815 An EXT-X-DEFINE tag MUST contain either a NAME or an IMPORT 1816 attribute, but not both. 1818 An EXT-X-DEFINE tag MUST NOT specify the same Variable Name as any 1819 other EXT-X-DEFINE tag in the same Playlist. Parsers that encounter 1820 duplicate Variable Name declarations MUST fail to parse the Playlist. 1822 EXT-X-DEFINE tags do NOT implicitly persist across Playlist reloads. 1824 5. Key Files 1826 5.1. Structure of Key Files 1828 An EXT-X-KEY tag with a URI attribute identifies a Key file. A Key 1829 file contains a cipher key that can decrypt Media Segments in the 1830 Playlist. 1832 [AES_128] encryption uses 16-octet keys. If the KEYFORMAT of an EXT- 1833 X-KEY tag is "identity", the Key file is a single packed array of 16 1834 octets in binary format. 1836 5.2. IV for AES-128 1838 [AES_128] REQUIRES the same 16-octet IV to be supplied when 1839 encrypting and decrypting. Varying this IV increases the strength of 1840 the cipher. 1842 An IV attribute on an EXT-X-KEY tag with a KEYFORMAT of "identity" 1843 specifies an IV that can be used when decrypting Media Segments 1844 encrypted with that Key file. IV values for AES-128 are 128-bit 1845 numbers. 1847 An EXT-X-KEY tag with a KEYFORMAT of "identity" that does not have an 1848 IV attribute indicates that the Media Sequence Number is to be used 1849 as the IV when decrypting a Media Segment, by putting its big-endian 1850 binary representation into a 16-octet (128-bit) buffer and padding 1851 (on the left) with zeros. 1853 6. Client/Server Responsibilities 1855 6.1. Introduction 1857 This section describes how the server generates the Playlist and 1858 Media Segments and how the client should download them for playback. 1860 6.2. Server Responsibilities 1862 6.2.1. General Server Responsibilities 1864 The production of the source media is outside the scope of this 1865 document, which simply presumes a source of continuous encoded media 1866 containing the presentation. 1868 The server MUST divide the source media into individual Media 1869 Segments whose duration is less than or equal to a constant target 1870 duration. Segments that are longer than the planned target duration 1871 can trigger playback stalls and other errors. 1873 The server SHOULD attempt to divide the source media at points that 1874 support effective decode of individual Media Segments, e.g., on 1875 packet and key frame boundaries. 1877 The server MUST create a URI for every Media Segment that enables its 1878 clients to obtain the segment data. If a server supports partial 1879 loading of resources (e.g., via HTTP Range requests), it MAY specify 1880 segments as sub-ranges of larger resources using the EXT-X-BYTERANGE 1881 tag. 1883 The absence of media data (due to, for example, the temporary 1884 unavailability of an encoder) SHOULD be signaled by adding one or 1885 more Media Segments to the Playlist whose Segment durations add up to 1886 the duration of absent media; these Media Segments MUST have EXT- 1887 X-GAP tags applied to them. Attempting to download these segments 1888 MAY produce an error, such as HTTP 404 or 410. 1890 Any Media Segment that is specified in a Playlist loaded by a client 1891 MUST be available for immediate download unless it has been marked 1892 with an EXT-X-GAP tag; otherwise playback errors can occur. Once 1893 download starts, its transfer rate SHOULD NOT be constrained by the 1894 segment production process. 1896 HTTP servers SHOULD transfer text files -- such as Playlists and 1897 WebVTT segments -- using the "gzip" Content-Encoding if the client 1898 indicates that it is prepared to accept it. 1900 The server must create a Media Playlist file (Section 4) that 1901 contains a URI for each Media Segment that the server wishes to make 1902 available, in the order in which they are to be played. 1904 The value of the EXT-X-VERSION tag (Section 4.4.1.2) SHOULD NOT be 1905 greater than what is required for the tags and attributes in the 1906 Playlist (see Section 7). 1908 Changes to the Playlist file MUST be made atomically from the point 1909 of view of the clients, or playback errors MAY occur. 1911 The server MUST NOT change the Media Playlist file, except to: 1913 Append lines to it (Section 6.2.1). 1915 Remove Media Segment URIs from the Playlist in the order that they 1916 appear, along with any tags that apply only to those segments 1917 (Section 6.2.2). 1919 Increment the value of the EXT-X-MEDIA-SEQUENCE or EXT-X- 1920 DISCONTINUITY-SEQUENCE tags (Section 6.2.2). 1922 Add an EXT-X-ENDLIST tag to the Playlist (Section 6.2.1). 1924 A Media Playlist has further constraints on its updates if it 1925 contains an EXT-X-PLAYLIST-TYPE tag. An EXT-X-PLAYLIST-TYPE tag with 1926 a value of VOD indicates that the Playlist file MUST NOT change. An 1927 EXT-X-PLAYLIST-TYPE tag with a value of EVENT indicates that the 1928 server MUST NOT change or delete any part of the Playlist file; it 1929 MAY append lines to it. 1931 The value of the EXT-X-TARGETDURATION tag in the Media Playlist MUST 1932 NOT change. A typical target duration is 10 seconds. 1934 Playlist changes other than those allowed here can trigger playback 1935 errors and inconsistent client behavior. 1937 Each Media Segment in a Media Playlist has an integer Discontinuity 1938 Sequence Number. The Discontinuity Sequence Number can be used in 1939 addition to the timestamps within the media to synchronize Media 1940 Segments across different Renditions. 1942 A segment's Discontinuity Sequence Number is the value of the EXT-X- 1943 DISCONTINUITY-SEQUENCE tag (or zero if none) plus the number of EXT- 1944 X-DISCONTINUITY tags in the Playlist preceding the URI line of the 1945 segment. 1947 The server MAY associate an absolute date and time with a Media 1948 Segment by applying an EXT-X-PROGRAM-DATE-TIME tag to it. This 1949 defines an informative mapping of the (wall-clock) date and time 1950 specified by the tag to the first media timestamp in the segment, 1951 which may be used as a basis for seeking, for display, or for other 1952 purposes. If a server provides this mapping, it SHOULD apply an EXT- 1953 X-PROGRAM-DATE-TIME tag to every segment that has an EXT- 1954 X-DISCONTINUITY tag applied to it. 1956 The Server MUST NOT add any EXT-X-PROGRAM-DATE-TIME tag to a Playlist 1957 that would cause the mapping between program date and Media Segment 1958 to become ambiguous. 1960 The server MUST NOT remove an EXT-X-DATERANGE tag from a Playlist if 1961 any date in the range maps to a Media Segment in the Playlist. 1963 The server MUST NOT reuse the ID attribute value of an EXT- 1964 X-DATERANGE tag for any new Date Range in the same Playlist. 1966 Once the Following Range of a Date Range with an END-ON-NEXT=YES 1967 attribute is added to a Playlist, the Server MUST NOT subsequently 1968 add a Date Range with the same CLASS attribute whose START-DATE is 1969 between that of the END-ON-NEXT=YES range and its Following Range. 1971 For Date Ranges with a PLANNED-DURATION attribute, the Server SHOULD 1972 signal the actual end of the range once it has been established. It 1973 can do so by adding another EXT-X-DATERANGE tag with the same ID 1974 attribute value and either a DURATION or an END-DATE attribute or, if 1975 the Date Range has an END-ON-NEXT=YES attribute, by adding a 1976 Following Range. 1978 If the Media Playlist contains the final Media Segment of the 1979 presentation, then the Playlist file MUST contain the EXT-X-ENDLIST 1980 tag; this allows clients to minimize unproductive Playlist reloads. 1982 If a Media Playlist does not contain the EXT-X-ENDLIST tag, the 1983 server MUST make a new version of the Playlist file available that 1984 contains at least one new Media Segment. It MUST be made available 1985 no later than 1.5 times the target duration after the previous time 1986 the Playlist was updated with a Media Segment. This allows clients 1987 to utilize the network efficiently. 1989 If the server wishes to remove an entire presentation, it SHOULD 1990 provide a clear indication to clients that the Playlist file is no 1991 longer available (e.g., with an HTTP 404 or 410 response). It MUST 1992 ensure that all Media Segments in the Playlist file remain available 1993 to clients for at least the duration of the Playlist file at the time 1994 of removal to prevent interruption of in-progress playback. 1996 6.2.2. Live Playlists 1998 The server MAY limit the availability of Media Segments by removing 1999 Media Segments from the Playlist file (Section 6.2.1). If Media 2000 Segments are to be removed, the Playlist file MUST contain an EXT-X- 2001 MEDIA-SEQUENCE tag. Its value MUST be incremented by 1 for every 2002 Media Segment that is removed from the Playlist file; it MUST NOT 2003 decrease or wrap. Clients can malfunction if each Media Segment does 2004 not have a consistent, unique Media Sequence Number. 2006 Media Segments MUST be removed from the Playlist file in the order 2007 that they appear in the Playlist; otherwise, client playback can 2008 malfunction. 2010 The server MUST NOT remove a Media Segment from a Playlist file 2011 without an EXT-X-ENDLIST tag if that would produce a Playlist whose 2012 duration is less than three times the target duration. Doing so can 2013 trigger playback stalls. 2015 The Availability Duration of a Media Segment is the duration of the 2016 segment plus the duration of the longest-duration Playlist 2017 distributed by the server containing that segment. If the server 2018 removes a Media Segment URI from a Playlist that contains an EXT- 2019 X-ENDLIST tag, clients MUST be able to download the corresponding 2020 Media Segment until the time of removal plus the segment's 2021 Availability Duration. If the server removes a Media Segment URI 2022 from a Playlist that does not contain an EXT-X-ENDLIST tag, clients 2023 MUST be able to download the segment until the time at which it first 2024 appeared in the Playlist plus the segment's Availability Duration. 2026 If the server wishes to remove segments from a Media Playlist 2027 containing an EXT-X-DISCONTINUITY tag, the Media Playlist MUST 2028 contain an EXT-X-DISCONTINUITY-SEQUENCE tag. Without the EXT-X- 2029 DISCONTINUITY-SEQUENCE tag, it can be impossible for a client to 2030 locate corresponding segments between Renditions. 2032 If the server removes an EXT-X-DISCONTINUITY tag from the Media 2033 Playlist, it MUST increment the value of the EXT-X-DISCONTINUITY- 2034 SEQUENCE tag so that the Discontinuity Sequence Numbers of the 2035 segments still in the Media Playlist remain unchanged. The value of 2036 the EXT-X-DISCONTINUITY-SEQUENCE tag MUST NOT decrease or wrap. 2037 Clients can malfunction if each Media Segment does not have a 2038 consistent Discontinuity Sequence Number. 2040 If a server plans to remove a Media Segment after it is delivered to 2041 clients over HTTP, it SHOULD ensure that the HTTP response contains 2042 an Expires header that reflects the planned time-to-live. 2044 A Live Playlist MUST NOT contain the EXT-X-PLAYLIST-TYPE tag, as no 2045 value of that tag allows Media Segments to be removed. 2047 6.2.3. Encrypting Media Segments 2049 Media Segments MAY be encrypted. Every encrypted Media Segment MUST 2050 have an EXT-X-KEY tag (Section 4.4.2.4) applied to it with a URI that 2051 the client can use to obtain a Key file (Section 5) containing the 2052 decryption key. 2054 A Media Segment can only be encrypted with one encryption METHOD, 2055 using one encryption key and IV. However, a server MAY offer 2056 multiple ways to retrieve that key by providing multiple EXT-X-KEY 2057 tags, each with a different KEYFORMAT attribute value. 2059 The server MAY set the HTTP Expires header in the key response to 2060 indicate the duration for which the key can be cached. 2062 Any unencrypted Media Segment in a Playlist that is preceded by an 2063 encrypted Media Segment MUST have an EXT-X-KEY tag applied to it with 2064 a METHOD attribute of NONE. Otherwise, the client will misinterpret 2065 those segments as encrypted. 2067 If the encryption METHOD is AES-128 and the Playlist does not contain 2068 the EXT-X-I-FRAMES-ONLY tag, AES encryption as described in 2069 Section 4.4.2.4 SHALL be applied to individual Media Segments. 2071 If the encryption METHOD is AES-128 and the Playlist contains an EXT- 2072 X-I-FRAMES-ONLY tag, the entire resource MUST be encrypted using 2073 AES-128 CBC with PKCS7 padding [RFC5652]. Encryption MAY be 2074 restarted on 16-byte block boundaries, unless the first block 2075 contains an I-frame. The IV used for encryption MUST be either the 2076 Media Sequence Number of the Media Segment or the value of the IV 2077 attribute of the EXT-X-KEY tag, as described in Section 5.2. These 2078 constraints allow a client to load and decrypt individual I-frames 2079 specified as sub-ranges of regular encrypted Media Segments, and 2080 their Media Initialization Sections. 2082 If the encryption METHOD indicates Sample Encryption, media samples 2083 MAY be encrypted prior to encapsulation in a Media Segment. 2085 The server MUST NOT remove an EXT-X-KEY tag from the Playlist file if 2086 it applies to any Media Segment in the Playlist file, or clients who 2087 subsequently load that Playlist will be unable to decrypt those Media 2088 Segments. 2090 6.2.4. Providing Variant Streams 2092 A server MAY offer multiple Media Playlist files to provide different 2093 encodings of the same presentation. If it does so, it SHOULD provide 2094 a Master Playlist file that lists each Variant Stream to allow 2095 clients to switch between encodings dynamically. 2097 Master Playlists describe regular Variant Streams with EXT-X-STREAM- 2098 INF tags and I-frame Variant Streams with EXT-X-I-FRAME-STREAM-INF 2099 tags. 2101 If an EXT-X-STREAM-INF tag or EXT-X-I-FRAME-STREAM-INF tag contains 2102 the CODECS attribute, the attribute value MUST include every media 2103 format [RFC6381] present in any Media Segment in any of the 2104 Renditions specified by the Variant Stream. 2106 The server MUST meet the following constraints when producing Variant 2107 Streams in order to allow clients to switch between them seamlessly: 2109 Each Variant Stream MUST present the same content. 2111 Matching content in Variant Streams MUST have matching timestamps. 2112 This allows clients to synchronize the media. 2114 Matching content in Variant Streams MUST have matching 2115 Discontinuity Sequence Numbers (see Section 4.4.3.3). 2117 Each Media Playlist in each Variant Stream MUST have the same 2118 target duration. The only exceptions are SUBTITLES Renditions and 2119 Media Playlists containing an EXT-X-I-FRAMES-ONLY tag, which MAY 2120 have different target durations if they have an EXT-X-PLAYLIST- 2121 TYPE of VOD. 2123 Content that appears in a Media Playlist of one Variant Stream but 2124 not in another MUST appear either at the beginning or at the end 2125 of the Media Playlist file and MUST NOT be longer than the target 2126 duration. 2128 If any Media Playlists have an EXT-X-PLAYLIST-TYPE tag, all Media 2129 Playlists MUST have an EXT-X-PLAYLIST-TYPE tag with the same 2130 value. 2132 If the Playlist contains an EXT-X-PLAYLIST-TYPE tag with the value 2133 of VOD, the first segment of every Media Playlist in every Variant 2134 Stream MUST start at the same media timestamp. 2136 If any Media Playlist in a Master Playlist contains an EXT-X- 2137 PROGRAM-DATE-TIME tag, then all Media Playlists in that Master 2138 Playlist MUST contain EXT-X-PROGRAM-DATE-TIME tags with consistent 2139 mappings of date and time to media timestamps. 2141 Each Variant Stream MUST contain the same set of Date Ranges. The 2142 EXT-X-DATERANGE tags of corresponding Date Ranges MUST have the 2143 same ID attribute value and contain the same set of attribute/ 2144 value pairs. 2146 In addition, for broadest compatibility, Variant Streams SHOULD 2147 contain the same encoded audio bitstream. This allows clients to 2148 switch between Variant Streams without audible glitching. 2150 The rules for Variant Streams also apply to alternative Renditions 2151 (see Section 4.4.4.2.1). 2153 6.3. Client Responsibilities 2155 6.3.1. General Client Responsibilities 2157 How the client obtains the URI to the Playlist file is outside the 2158 scope of this document; it is presumed to have done so. 2160 The client obtains the Playlist file from the URI. If the Playlist 2161 file so obtained is a Master Playlist, the client can select a 2162 Variant Stream to load from the Master Playlist. 2164 Clients MUST ensure that loaded Playlists comply with Section 4 and 2165 that the EXT-X-VERSION tag, if present, specifies a protocol version 2166 supported by the client; if either check fails, the client MUST NOT 2167 attempt to use the Playlist, or unintended behavior could occur. 2169 When parsing Playlist elements that are subject to variable 2170 substitution, a Variable Reference whose Variable Name has been 2171 provided by an EXT-X-DEFINE tag that precedes the Variable Reference 2172 MUST be replaced by the corresponding Variable Value. Such 2173 replacements themselves are NOT subject to variable substitution. 2175 When parsing Playlist elements that are subject to variable 2176 substitution, a Variable Reference whose Variable Name has NOT been 2177 provided by an EXT-X-DEFINE tag preceding the Variable Reference MUST 2178 trigger a parsing error. 2180 If any URI element in a Playlist contains an URI scheme that the 2181 client cannot handle, the client MUST stop playback. All clients 2182 MUST support HTTP schemes. 2184 To support forward compatibility, when parsing Playlists, clients 2185 MUST: 2187 o ignore any unrecognized tags. 2189 o ignore any attribute/value pair with an unrecognized 2190 AttributeName. 2192 o ignore any tag containing an attribute/value pair of type 2193 enumerated-string whose AttributeName is recognized but whose 2194 AttributeValue is not recognized, unless the definition of the 2195 attribute says otherwise. 2197 When identifying playable Renditions, Clients SHOULD consider an 2198 audio Rendition having unrecognized CHANNELS parameters to be 2199 playable if its associated CODECS attribute is supported. However, 2200 an equivalent Rendition with the same audio codec and recognized 2201 CHANNELS parameters SHOULD be preferred if it is present in the 2202 Master Playlist. 2204 Algorithms used by the client to switch between Variant Streams are 2205 beyond the scope of this document. 2207 6.3.2. Loading the Media Playlist File 2209 Every time a Media Playlist is loaded or reloaded from a Playlist 2210 URI, the client MUST determine the next Media Segment to load, as 2211 described in Section 6.3.5, if it intends to play the presentation 2212 normally (i.e., in Playlist order at the nominal playback rate). 2214 If the Media Playlist contains the EXT-X-MEDIA-SEQUENCE tag, the 2215 client SHOULD assume that each Media Segment in it will become 2216 unavailable at the time that the Playlist file was loaded plus the 2217 duration of the Playlist file. 2219 A client MAY use the segment Media Sequence Number to track the 2220 location of a Media Segment within a Playlist when the Playlist is 2221 reloaded. 2223 A client MUST NOT assume that segments with the same Media Sequence 2224 Number in different Variant Streams or Renditions have the same 2225 position in the presentation; Playlists MAY have independent Media 2226 Sequence Numbers. Instead, a client MUST use the relative position 2227 of each segment on the Playlist timeline and its Discontinuity 2228 Sequence Number to locate corresponding segments. 2230 A client MUST load the Media Playlist file of every Rendition 2231 selected for playback in order to locate the media specific to that 2232 Rendition. But, to prevent unnecessary load on the server, it SHOULD 2233 NOT load the Playlist file of any other Rendition. 2235 For some Variant Streams, it is possible to select Renditions that do 2236 not include the Rendition specified by the EXT-X-STREAM-INF tag. As 2237 noted above, the client SHOULD NOT load that Rendition in those 2238 cases. 2240 6.3.3. Playing the Media Playlist File 2242 The client SHALL choose which Media Segment to play first from the 2243 Media Playlist when playback starts. If the EXT-X-ENDLIST tag is not 2244 present and the client intends to play the media normally, the client 2245 SHOULD NOT choose a segment that starts less than the duration of the 2246 last segment in the Playlist plus two target durations from the end 2247 of the Playlist file. Doing so can trigger playback stalls. 2249 Normal playback can be achieved by playing the Media Segments in the 2250 order that they appear in the Playlist. The client MAY present the 2251 available media in any way it wishes, including normal playback, 2252 random access, and trick modes. 2254 The client SHOULD NOT attempt to load Media Segments that have been 2255 marked with an EXT-X-GAP tag. Instead, clients are encouraged to 2256 look for another Variant Stream of the same Rendition which does not 2257 have the same gap, and play that instead. 2259 The encoding parameters for samples in a Media Segment and across 2260 multiple Media Segments in a Media Playlist SHOULD remain consistent. 2261 However, clients SHOULD deal with encoding changes as they are 2262 encountered, for example, by scaling video content to accommodate a 2263 resolution change. If the Variant Stream includes a RESOLUTION 2264 attribute, clients SHOULD display all video within a rectangle with 2265 the same proportions as that resolution. 2267 Clients SHOULD be prepared to handle multiple tracks of a particular 2268 type (e.g., audio or video). A client with no other preference 2269 SHOULD choose the track with the lowest numerical track identifier 2270 that it can play. 2272 Clients SHOULD ignore private streams inside Transport Streams that 2273 they do not recognize. Private streams can be used to support 2274 different devices with the same stream, although stream authors 2275 SHOULD be sensitive to the additional network load that this imposes. 2277 The client MUST be prepared to reset its parser(s) and decoder(s) 2278 before playing a Media Segment that has an EXT-X-DISCONTINUITY tag 2279 applied to it; otherwise, playback errors can occur. 2281 The client SHOULD attempt to load Media Segments in advance of when 2282 they will be required for uninterrupted playback to compensate for 2283 temporary variations in latency and throughput. 2285 The client MAY use the value of the EXT-X-PROGRAM-DATE-TIME tag to 2286 display the program origination time to the user. If the value 2287 includes time zone information, the client SHALL take it into 2288 account; if it does not, the client MAY assume the time to be local. 2290 Note that dates in Playlists can refer to when the content was 2291 produced (or to other times), which have no relation to the time of 2292 playback. 2294 If the first EXT-X-PROGRAM-DATE-TIME tag in a Playlist appears after 2295 one or more Media Segment URIs, the client SHOULD extrapolate 2296 backward from that tag (using EXTINF durations and/or media 2297 timestamps) to associate dates with those segments. To associate a 2298 date with any other Media Segment that does not have an EXT-X- 2299 PROGRAM-DATE-TIME tag applied to it directly, the client SHOULD 2300 extrapolate forward from the last EXT-X-PROGRAM-DATE-TIME tag 2301 appearing before that segment in the Playlist. 2303 6.3.4. Reloading the Media Playlist File 2305 The client MUST periodically reload a Media Playlist file to learn 2306 what media is currently available, unless it contains an EXT-X- 2307 PLAYLIST-TYPE tag with a value of VOD, or a value of EVENT and the 2308 EXT-X-ENDLIST tag is also present. 2310 However, the client MUST NOT attempt to reload the Playlist file more 2311 frequently than specified by this section, in order to limit the 2312 collective load on the server. 2314 When a client loads a Playlist file for the first time or reloads a 2315 Playlist file and finds that it has changed since the last time it 2316 was loaded, the client MUST wait for at least the duration of the 2317 last segment in the Playlist before attempting to reload the Playlist 2318 file again, measured from the last time the client began loading the 2319 Playlist file. 2321 If the client reloads a Playlist file and finds that it has not 2322 changed, then it MUST wait for a period of one-half the target 2323 duration before retrying. 2325 After reloading a Media Playlist, the client SHOULD verify that each 2326 Media Segment in it has the same URI (and byte range, if specified) 2327 as the Media Segment with the same Media Sequence Number in the 2328 previous Media Playlist. It SHOULD halt playback if it does not, as 2329 this normally indicates a server error. 2331 In order to reduce server load, the client SHOULD NOT reload the 2332 Playlist files of Variant Streams or alternate Renditions that are 2333 not currently being played. If it decides to switch playback to a 2334 different Variant Stream, it SHOULD stop reloading the Playlist of 2335 the old Variant Stream and begin loading the Playlist of the new 2336 Variant Stream. It can use the EXTINF durations and the constraints 2337 in Section 6.2.4 to determine the approximate location of 2338 corresponding media. Once media from the new Variant Stream has been 2339 loaded, the timestamps in the Media Segments can be used to 2340 synchronize the old and new timelines precisely. 2342 A client MUST NOT attempt to use the Media Sequence Number to 2343 synchronize between streams (see Section 6.3.2). 2345 6.3.5. Determining the Next Segment to Load 2347 The client MUST examine the Media Playlist file every time it is 2348 loaded or reloaded to determine the next Media Segment to load, as 2349 the set of available media MAY have changed. 2351 The first segment to load is generally the segment that the client 2352 has chosen to play first (see Section 6.3.3). 2354 In order to play the presentation normally, the next Media Segment to 2355 load is the one with the lowest Media Sequence Number that is greater 2356 than the Media Sequence Number of the last Media Segment loaded. 2358 6.3.6. Decrypting Encrypted Media Segments 2360 If a Media Playlist file contains an EXT-X-KEY tag that specifies a 2361 Key file URI, the client can obtain that Key file and use the key 2362 inside it to decrypt all Media Segments to which that EXT-X-KEY tag 2363 applies. 2365 A client MUST ignore any EXT-X-KEY tag with an unsupported or 2366 unrecognized KEYFORMAT attribute, to allow for cross-device 2367 addressability. If the Playlist contains a Media Segment to which 2368 only EXT-X-KEY tags with unrecognized or unsupported KEYFORMAT 2369 attributes are applied, playback SHOULD fail. 2371 A client MUST NOT attempt to decrypt any segments whose EXT-X-KEY tag 2372 has a METHOD attribute that it does not recognize. 2374 If the encryption METHOD is AES-128, AES-128 CBC decryption SHALL be 2375 applied to individual Media Segments, whose encryption format is 2376 described in Section 4.4.2.4. 2378 If the encryption METHOD is AES-128 and the Media Segment is part of 2379 an I-frame Playlist (Section 4.4.3.6) and it has an EXT-X-BYTERANGE 2380 tag applied to it, special care needs to be taken in loading and 2381 decrypting the segment, because the resource identified by the URI is 2382 encrypted in 16-byte blocks from the start of the resource. 2384 The decrypted I-frame can be recovered by first widening its byte 2385 range, as specified by the EXT-X-BYTERANGE tag, so that it starts and 2386 ends on 16-byte boundaries from the start of the resource. 2388 Next, the byte range is widened further to include a 16-byte block at 2389 the beginning of the range. This 16-byte block allows the correct IV 2390 for the following block to be calculated. 2392 The widened byte range can then be loaded and decrypted with AES-128 2393 CBC using an arbitrary IV. The number of bytes added to the 2394 beginning and the end of the original byte range are discarded from 2395 the decrypted bytes; what remains is the decrypted I-frame. 2397 If the encryption METHOD indicates Sample Encryption, decryption 2398 SHALL be applied to encrypted media samples within the Media Segment. 2400 An EXT-X-KEY tag with a METHOD of NONE indicates that the Media 2401 Segments it applies to are not encrypted. 2403 7. Protocol Version Compatibility 2405 Protocol compatibility is specified by the EXT-X-VERSION tag. A 2406 Playlist that contains tags or attributes that are not compatible 2407 with protocol version 1 MUST include an EXT-X-VERSION tag. 2409 A client MUST NOT attempt playback if it does not support the 2410 protocol version specified by the EXT-X-VERSION tag, or unintended 2411 behavior could occur. 2413 A Media Playlist MUST indicate an EXT-X-VERSION of 2 or higher if it 2414 contains: 2416 o The IV attribute of the EXT-X-KEY tag. 2418 A Media Playlist MUST indicate an EXT-X-VERSION of 3 or higher if it 2419 contains: 2421 o Floating-point EXTINF duration values. 2423 A Media Playlist MUST indicate an EXT-X-VERSION of 4 or higher if it 2424 contains: 2426 o The EXT-X-BYTERANGE tag. 2428 o The EXT-X-I-FRAMES-ONLY tag. 2430 A Media Playlist MUST indicate an EXT-X-VERSION of 5 or higher if it 2431 contains: 2433 o An EXT-X-KEY tag with a METHOD of SAMPLE-AES. 2435 o The KEYFORMAT and KEYFORMATVERSIONS attributes of the EXT-X-KEY 2436 tag. 2438 o The EXT-X-MAP tag. 2440 A Media Playlist MUST indicate an EXT-X-VERSION of 6 or higher if it 2441 contains: 2443 o The EXT-X-MAP tag in a Media Playlist that does not contain EXT- 2444 X-I-FRAMES-ONLY. 2446 Note that in protocol version 6, the semantics of the EXT- 2447 X-TARGETDURATION tag changed slightly. In protocol version 5 and 2448 earlier it indicated the maximum segment duration; in protocol 2449 version 6 and later it indicates the the maximum segment duration 2450 rounded to the nearest integer number of seconds. 2452 A Master Playlist MUST indicate an EXT-X-VERSION of 7 or higher if it 2453 contains: 2455 o "SERVICE" values for the INSTREAM-ID attribute of the EXT-X-MEDIA 2456 tag. 2458 A Playlist MUST indicate an EXT-X-VERSION of 8 or higher if it 2459 contains: 2461 o Variable substitution. 2463 The EXT-X-MEDIA tag and the AUDIO, VIDEO, and SUBTITLES attributes of 2464 the EXT-X-STREAM-INF tag are backward compatible to protocol version 2465 1, but playback on older clients may not be desirable. A server MAY 2466 consider indicating an EXT-X-VERSION of 4 or higher in the Master 2467 Playlist but is not required to do so. 2469 The PROGRAM-ID attribute of the EXT-X-STREAM-INF and the EXT-X-I- 2470 FRAME-STREAM-INF tags was removed in protocol version 6. 2472 The EXT-X-ALLOW-CACHE tag was removed in protocol version 7. 2474 8. Playlist Examples 2476 8.1. Simple Media Playlist 2478 #EXTM3U 2479 #EXT-X-TARGETDURATION:10 2480 #EXT-X-VERSION:3 2481 #EXTINF:9.009, 2482 http://media.example.com/first.ts 2483 #EXTINF:9.009, 2484 http://media.example.com/second.ts 2485 #EXTINF:3.003, 2486 http://media.example.com/third.ts 2487 #EXT-X-ENDLIST 2489 8.2. Live Media Playlist Using HTTPS 2491 #EXTM3U 2492 #EXT-X-VERSION:3 2493 #EXT-X-TARGETDURATION:8 2494 #EXT-X-MEDIA-SEQUENCE:2680 2496 #EXTINF:7.975, 2497 https://priv.example.com/fileSequence2680.ts 2498 #EXTINF:7.941, 2499 https://priv.example.com/fileSequence2681.ts 2500 #EXTINF:7.975, 2501 https://priv.example.com/fileSequence2682.ts 2503 8.3. Playlist with Encrypted Media Segments 2504 #EXTM3U 2505 #EXT-X-VERSION:3 2506 #EXT-X-MEDIA-SEQUENCE:7794 2507 #EXT-X-TARGETDURATION:15 2509 #EXT-X-KEY:METHOD=AES-128,URI="https://priv.example.com/key.php?r=52" 2511 #EXTINF:2.833, 2512 http://media.example.com/fileSequence52-A.ts 2513 #EXTINF:15.0, 2514 http://media.example.com/fileSequence52-B.ts 2515 #EXTINF:13.333, 2516 http://media.example.com/fileSequence52-C.ts 2518 #EXT-X-KEY:METHOD=AES-128,URI="https://priv.example.com/key.php?r=53" 2520 #EXTINF:15.0, 2521 http://media.example.com/fileSequence53-A.ts 2523 8.4. Master Playlist 2525 #EXTM3U 2526 #EXT-X-STREAM-INF:BANDWIDTH=1280000,AVERAGE-BANDWIDTH=1000000 2527 http://example.com/low.m3u8 2528 #EXT-X-STREAM-INF:BANDWIDTH=2560000,AVERAGE-BANDWIDTH=2000000 2529 http://example.com/mid.m3u8 2530 #EXT-X-STREAM-INF:BANDWIDTH=7680000,AVERAGE-BANDWIDTH=6000000 2531 http://example.com/hi.m3u8 2532 #EXT-X-STREAM-INF:BANDWIDTH=65000,CODECS="mp4a.40.5" 2533 http://example.com/audio-only.m3u8 2535 8.5. Master Playlist with I-Frames 2537 #EXTM3U 2538 #EXT-X-STREAM-INF:BANDWIDTH=1280000 2539 low/audio-video.m3u8 2540 #EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=86000,URI="low/iframe.m3u8" 2541 #EXT-X-STREAM-INF:BANDWIDTH=2560000 2542 mid/audio-video.m3u8 2543 #EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=150000,URI="mid/iframe.m3u8" 2544 #EXT-X-STREAM-INF:BANDWIDTH=7680000 2545 hi/audio-video.m3u8 2546 #EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=550000,URI="hi/iframe.m3u8" 2547 #EXT-X-STREAM-INF:BANDWIDTH=65000,CODECS="mp4a.40.5" 2548 audio-only.m3u8 2550 8.6. Master Playlist with Alternative Audio 2552 In this example, the CODECS attributes have been condensed for space. 2553 A '\' is used to indicate that the tag continues on the following 2554 line with whitespace removed: 2556 #EXTM3U 2557 #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="aac",NAME="English", \ 2558 DEFAULT=YES,AUTOSELECT=YES,LANGUAGE="en", \ 2559 URI="main/english-audio.m3u8" 2560 #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="aac",NAME="Deutsch", \ 2561 DEFAULT=NO,AUTOSELECT=YES,LANGUAGE="de", \ 2562 URI="main/german-audio.m3u8" 2563 #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="aac",NAME="Commentary", \ 2564 DEFAULT=NO,AUTOSELECT=NO,LANGUAGE="en", \ 2565 URI="commentary/audio-only.m3u8" 2566 #EXT-X-STREAM-INF:BANDWIDTH=1280000,CODECS="...",AUDIO="aac" 2567 low/video-only.m3u8 2568 #EXT-X-STREAM-INF:BANDWIDTH=2560000,CODECS="...",AUDIO="aac" 2569 mid/video-only.m3u8 2570 #EXT-X-STREAM-INF:BANDWIDTH=7680000,CODECS="...",AUDIO="aac" 2571 hi/video-only.m3u8 2572 #EXT-X-STREAM-INF:BANDWIDTH=65000,CODECS="mp4a.40.5",AUDIO="aac" 2573 main/english-audio.m3u8 2575 8.7. Master Playlist with Alternative Video 2577 This example shows three different video Renditions (Main, 2578 Centerfield, and Dugout) and three different Variant Streams (low, 2579 mid, and high). In this example, clients that did not support the 2580 EXT-X-MEDIA tag and the VIDEO attribute of the EXT-X-STREAM-INF tag 2581 would only be able to play the video Rendition "Main". 2583 Since the EXT-X-STREAM-INF tag has no AUDIO attribute, all video 2584 Renditions would be required to contain the audio. 2586 In this example, the CODECS attributes have been condensed for space. 2587 A '\' is used to indicate that the tag continues on the following 2588 line with whitespace removed: 2590 #EXTM3U 2591 #EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="low",NAME="Main", \ 2592 DEFAULT=YES,URI="low/main/audio-video.m3u8" 2593 #EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="low",NAME="Centerfield", \ 2594 DEFAULT=NO,URI="low/centerfield/audio-video.m3u8" 2595 #EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="low",NAME="Dugout", \ 2596 DEFAULT=NO,URI="low/dugout/audio-video.m3u8" 2598 #EXT-X-STREAM-INF:BANDWIDTH=1280000,CODECS="...",VIDEO="low" 2599 low/main/audio-video.m3u8 2601 #EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="mid",NAME="Main", \ 2602 DEFAULT=YES,URI="mid/main/audio-video.m3u8" 2603 #EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="mid",NAME="Centerfield", \ 2604 DEFAULT=NO,URI="mid/centerfield/audio-video.m3u8" 2605 #EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="mid",NAME="Dugout", \ 2606 DEFAULT=NO,URI="mid/dugout/audio-video.m3u8" 2608 #EXT-X-STREAM-INF:BANDWIDTH=2560000,CODECS="...",VIDEO="mid" 2609 mid/main/audio-video.m3u8 2611 #EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="hi",NAME="Main", \ 2612 DEFAULT=YES,URI="hi/main/audio-video.m3u8" 2613 #EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="hi",NAME="Centerfield", \ 2614 DEFAULT=NO,URI="hi/centerfield/audio-video.m3u8" 2615 #EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="hi",NAME="Dugout", \ 2616 DEFAULT=NO,URI="hi/dugout/audio-video.m3u8" 2618 #EXT-X-STREAM-INF:BANDWIDTH=7680000,CODECS="...",VIDEO="hi" 2619 hi/main/audio-video.m3u8 2621 8.8. Session Data in a Master Playlist 2623 In this example, only the EXT-X-SESSION-DATA is shown: 2625 #EXT-X-SESSION-DATA:DATA-ID="com.example.lyrics",URI="lyrics.json" 2627 #EXT-X-SESSION-DATA:DATA-ID="com.example.title",LANGUAGE="en", \ 2628 VALUE="This is an example" 2629 #EXT-X-SESSION-DATA:DATA-ID="com.example.title",LANGUAGE="es", \ 2630 VALUE="Este es un ejemplo" 2632 8.9. CHARACTERISTICS Attribute Containing Multiple Characteristics 2634 Certain characteristics are valid in combination, as in: 2636 CHARACTERISTICS= 2637 "public.accessibility.transcribes-spoken-dialog,public.easy-to-read" 2639 8.10. EXT-X-DATERANGE Carrying SCTE-35 Tags 2641 This example shows two EXT-X-DATERANGE tags that describe a single 2642 Date Range, with an SCTE-35 "out" splice_insert() command that is 2643 subsequently updated with an SCTE-35 "in" splice_insert() command. 2645 #EXTM3U 2646 ... 2647 #EXT-X-DATERANGE:ID="splice-6FFFFFF0",START-DATE="2014-03-05T11: 2648 15:00Z",PLANNED-DURATION=59.993,SCTE35-OUT=0xFC002F0000000000FF0 2649 00014056FFFFFF000E011622DCAFF000052636200000000000A0008029896F50 2650 000008700000000 2652 ... Media Segment declarations for 60s worth of media 2654 #EXT-X-DATERANGE:ID="splice-6FFFFFF0",DURATION=59.993,SCTE35-IN= 2655 0xFC002A0000000000FF00000F056FFFFFF000401162802E6100000000000A00 2656 08029896F50000008700000000 2657 ... 2659 9. Contributors 2661 Significant contributions to the design of this protocol were made by 2662 Jim Batson, David Biderman, Bill May, Roger Pantos, Alan Tseng, and 2663 Eryk Vershen. Stuart Cheshire helped edit the specification. 2665 Significant contributions to the update of this protocol were made by 2666 Bill May, Eryk Vershen, and Peng Zhou. 2668 In particular, Bill May co-authored the first edition of HTTP Live 2669 Streaming, [RFC8216], and continues to provide valuable guidance and 2670 input. 2672 10. IANA Considerations 2674 IANA has registered the following media type [RFC2046]: 2676 Type name: application 2678 Subtype name: vnd.apple.mpegurl 2680 Required parameters: none 2682 Optional parameters: none 2683 Encoding considerations: encoded as UTF-8, which is 8-bit text. This 2684 media type may require encoding on transports not capable of handling 2685 8-bit text. See Section 4 for more information. 2687 Security considerations: See Section 11. 2689 Compression: this media type does not employ compression. 2691 Interoperability considerations: There are no byte-ordering issues, 2692 since files are 8-bit text. Applications could encounter 2693 unrecognized tags, which SHOULD be ignored. 2695 Published specification: see Section 4. 2697 Applications that use this media type: Multimedia applications such 2698 as the iPhone media player in iOS 3.0 and later and QuickTime Player 2699 in Mac OS X version 10.6 and later. 2701 Fragment identifier considerations: no Fragment Identifiers are 2702 defined for this media type. 2704 Additional information: 2706 Deprecated alias names for this type: none 2707 Magic number(s): #EXTM3U 2708 File extension(s): .m3u8, .m3u (see Section 4) 2709 Macintosh file type code(s): none 2711 Person & email address to contact for further information: David 2712 Singer, singer AT apple.com. 2714 Intended usage: LIMITED USE 2716 Restrictions on usage: none 2718 Author: Roger Pantos 2720 Change Controller: David Singer 2722 11. Security Considerations 2724 Since the protocol generally uses HTTP to transfer data, most of the 2725 same security considerations apply. See Section 15 of HTTP 2726 [RFC7230]. 2728 Media file parsers are typically subject to "fuzzing" attacks. 2729 Implementors SHOULD pay particular attention to code that will parse 2730 data received from a server and ensure that all possible inputs are 2731 handled correctly. 2733 Playlist files contain URIs, which clients will use to make network 2734 requests of arbitrary entities. Clients SHOULD range-check responses 2735 to prevent buffer overflows. See also the Security Considerations 2736 section of "Uniform Resource Identifier (URI): Generic Syntax" 2737 [RFC3986]. 2739 Apart from URL resolution, this format does not employ any form of 2740 active content. 2742 Clients SHOULD limit each playback session to a reasonable number of 2743 concurrent downloads (for example, four) to avoid contributing to 2744 denial-of-service attacks. 2746 HTTP requests often include session state ("cookies"), which may 2747 contain private user data. Implementations MUST follow cookie 2748 restriction and expiry rules specified by "HTTP State Management 2749 Mechanism" [RFC6265] to protect themselves from attack. See also the 2750 Security Considerations section of that document, and "Use of HTTP 2751 State Management" [RFC2964]. 2753 Encryption keys are specified by URI. The delivery of these keys 2754 SHOULD be secured by a mechanism such as HTTP Over TLS [RFC2818] 2755 (formerly SSL) in conjunction with a secure realm or a session token. 2757 12. References 2759 12.1. Normative References 2761 [AC_3] Advanced Television Systems Committee, "Digital Audio 2762 Compression (AC-3) (E-AC-3)", ATSC Standard A/52:2010, 2763 November 2010, <http://atsc.org/wp- 2764 content/uploads/2015/03/A52-201212-17.pdf>. 2766 [AES_128] National Institute of Standards and Technology, "Advanced 2767 Encryption Standard (AES)", FIPS PUB 197, DOI 2768 10.6028/NIST.FIPS.197, November 2001, 2769 <http://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.197.pdf>. 2771 [CEA608] Consumer Technology Association, "Line 21 Data Services", 2772 ANSI/CTA Standard 608-E, April 2008, 2773 <https://standards.cta.tech/kwspub/published_docs/ 2774 ANSI-CTA-608-E-R-2014-Preview.pdf>. 2776 [CEA708] Consumer Technology Association, "Digital Television (DTV) 2777 Closed Captioning", ANSI/CTA Standard CEA-708-E, August 2778 2013, <https://standards.cta.tech/kwspub/published_docs/ 2779 ANSI-CTA-708-E-Preview.pdf>. 2781 [CICP] International Organization for Standardization, 2782 "Information technology - MPEG systems technologies - Part 2783 8: Coding-independent code points", ISO/IEC International 2784 Standard 23001-8:2016, 2016, <https://www.iso.org/obp/ 2785 ui/#iso:std:iso-iec:23001:-8:ed-2:v1:en>. 2787 [CMAF] International Organization for Standardization, 2788 "Information technology -- Multimedia application format 2789 (MPEG-A) -- Part 19: Common media application format 2790 (CMAF) for segmented media", ISO/IEC International 2791 Standard 23000-19:2017, December 2017, 2792 <https://www.iso.org/standard/71975.html>. 2794 [COMMON_ENC] 2795 International Organization for Standardization, 2796 "Information technology -- MPEG systems technologies -- 2797 Part 7: Common encryption in ISO base media file format 2798 files", ISO/IEC International Standard 23001-7:2016, 2799 February 2016, <http://www.iso.org/iso/ 2800 catalogue_detail.htm?csnumber=68042>. 2802 [H_264] International Telecommunications Union, "Advanced video 2803 coding for generic audiovisual services", January 2012, 2804 <http://www.itu.int/rec/T-REC-H.264>. 2806 [HDCP] Digital Content Protection LLC, "High-bandwidth Digital 2807 Content Protection System - Mapping HDCP to HDMI", 2808 February 2013, <http://www.digital- 2809 cp.com/sites/default/files/specifications/ 2810 HDCP%20on%20HDMI%20Specification%20Rev2_2_Final1.pdf>. 2812 [IMSC1] W3C, "TTML Profiles for Internet Media Subtitles and 2813 Captions 1.0 (IMSC1)", April 2016, 2814 <https://www.w3.org/TR/ttml-imsc1/>. 2816 [ISO_13818] 2817 International Organization for Standardization, "Generic 2818 coding of moving pictures and associated audio 2819 information", ISO/IEC International Standard 13818:2007, 2820 October 2007, 2821 <http://www.iso.org/iso/catalogue_detail?csnumber=44169>. 2823 [ISO_13818_3] 2824 International Organization for Standardization, "Generic 2825 coding of moving pictures and associated audio information 2826 -- Part 3: Audio", ISO/IEC International 2827 Standard 13818-3:1998, April 1998, 2828 <http://www.iso.org/iso/home/store/catalogue_tc/ 2829 catalogue_detail.htm?csnumber=26797>. 2831 [ISO_13818_7] 2832 International Organization for Standardization, "Generic 2833 coding of moving pictures and associated audio information 2834 -- Part 7: Advanced Audio Coding (AAC)", ISO/IEC 2835 International Standard 13818-7:2006, January 2006, 2836 <http://www.iso.org/iso/home/store/catalogue_tc/ 2837 catalogue_detail.htm?csnumber=43345>. 2839 [ISO_14496] 2840 International Organization for Standardization, 2841 "Information technology -- Coding of audio-visual objects 2842 -- Part 3: Audio", ISO/IEC International 2843 Standard 14496-3:2009, 2009, 2844 <http://www.iso.org/iso/catalogue_detail?csnumber=53943>. 2846 [ISO_8601] 2847 International Organization for Standardization, "Data 2848 elements and interchange formats -- Information 2849 interchange -- Representation of dates and times", ISO/IEC 2850 International Standard 8601:2004, December 2004, 2851 <http://www.iso.org/iso/catalogue_detail?csnumber=40874>. 2853 [ISOBMFF] International Organization for Standardization, 2854 "Information technology -- Coding of audio-visual objects 2855 -- Part 12: ISO base media file format", ISO/IEC 2856 International Standard 14496-12:2015, December 2015, 2857 <http://www.iso.org/iso/ 2858 catalogue_detail.htm?csnumber=68960>. 2860 [MP4_TIMED_TEXT] 2861 International Organization for Standardization, 2862 "Information technology -- Coding of audio-visual objects 2863 -- Part 30: Timed text and other visual overlays in ISO 2864 base media file format", ISO/IEC International 2865 Standard 14496-30:2014, March 2014, 2866 <https://www.iso.org/standard/63107.html>. 2868 [RFC2046] Freed, N. and N. Borenstein, "Multipurpose Internet Mail 2869 Extensions (MIME) Part Two: Media Types", RFC 2046, 2870 DOI 10.17487/RFC2046, November 1996, 2871 <https://www.rfc-editor.org/info/rfc2046>. 2873 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 2874 Requirement Levels", BCP 14, RFC 2119, 2875 DOI 10.17487/RFC2119, March 1997, 2876 <https://www.rfc-editor.org/info/rfc2119>. 2878 [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, 2879 DOI 10.17487/RFC2818, May 2000, 2880 <https://www.rfc-editor.org/info/rfc2818>. 2882 [RFC2964] Moore, K. and N. Freed, "Use of HTTP State Management", 2883 BCP 44, RFC 2964, DOI 10.17487/RFC2964, October 2000, 2884 <https://www.rfc-editor.org/info/rfc2964>. 2886 [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 2887 10646", STD 63, RFC 3629, DOI 10.17487/RFC3629, November 2888 2003, <https://www.rfc-editor.org/info/rfc3629>. 2890 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 2891 Resource Identifier (URI): Generic Syntax", STD 66, 2892 RFC 3986, DOI 10.17487/RFC3986, January 2005, 2893 <https://www.rfc-editor.org/info/rfc3986>. 2895 [RFC5646] Phillips, A., Ed. and M. Davis, Ed., "Tags for Identifying 2896 Languages", BCP 47, RFC 5646, DOI 10.17487/RFC5646, 2897 September 2009, <https://www.rfc-editor.org/info/rfc5646>. 2899 [RFC5652] Housley, R., "Cryptographic Message Syntax (CMS)", STD 70, 2900 RFC 5652, DOI 10.17487/RFC5652, September 2009, 2901 <https://www.rfc-editor.org/info/rfc5652>. 2903 [RFC6265] Barth, A., "HTTP State Management Mechanism", RFC 6265, 2904 DOI 10.17487/RFC6265, April 2011, 2905 <https://www.rfc-editor.org/info/rfc6265>. 2907 [RFC6381] Gellens, R., Singer, D., and P. Frojdh, "The 'Codecs' and 2908 'Profiles' Parameters for "Bucket" Media Types", RFC 6381, 2909 DOI 10.17487/RFC6381, August 2011, 2910 <https://www.rfc-editor.org/info/rfc6381>. 2912 [RFC7230] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 2913 Protocol (HTTP/1.1): Message Syntax and Routing", 2914 RFC 7230, DOI 10.17487/RFC7230, June 2014, 2915 <https://www.rfc-editor.org/info/rfc7230>. 2917 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2918 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 2919 May 2017, <https://www.rfc-editor.org/info/rfc8174>. 2921 [RFC8216] Pantos, R., Ed. and W. May, "HTTP Live Streaming", 2922 RFC 8216, DOI 10.17487/RFC8216, August 2017, 2923 <https://www.rfc-editor.org/info/rfc8216>. 2925 [RFC8259] Bray, T., Ed., "The JavaScript Object Notation (JSON) Data 2926 Interchange Format", STD 90, RFC 8259, 2927 DOI 10.17487/RFC8259, December 2017, 2928 <https://www.rfc-editor.org/info/rfc8259>. 2930 [SCTE35] Society of Cable Telecommunications Engineers, "Digital 2931 Program Insertion Cueing Message for Cable", ANSI/SCTE 35, 2932 August 2014, <http://www.scte.org/documents/pdf/Standards/ 2933 ANSI_SCTE%2035%202014.pdf>. 2935 [US_ASCII] 2936 American National Standards Institute, "Coded Character 2937 Sets - 7-Bit American National Standard Code for 2938 Information Interchange (7-Bit ASCII)", ANSI X3.4, 2939 December 1986. 2941 [WebVTT] World Wide Web Consortium (W3C), ""WebVTT: The Web Video 2942 Text Tracks Format", Draft Community Group Report", July 2943 2013, <http://dev.w3.org/html5/webvtt/>. 2945 12.2. Informative References 2947 [ID3] ID3.org, "The ID3 audio file data tagging format", 2948 <http://www.id3.org/Developer_Information>. 2950 [M3U] Nullsoft, Inc., "The M3U Playlist format, originally 2951 invented for the Winamp media player", 2952 <http://wikipedia.org/wiki/M3U>. 2954 [SampleEnc] 2955 Apple Inc., "MPEG-2 Stream Encryption Format for HTTP Live 2956 Streaming", <https://developer.apple.com/library/ios/docum 2957 entation/AudioVideo/Conceptual/HLS_Sample_Encryption/>. 2959 [UNICODE] The Unicode Consortium, "The Unicode Standard", 2960 <https://www.unicode.org/versions/latest/>. 2962 [UTI] Apple Inc., "Uniform Type Identifier", <http://developer.a 2963 pple.com/library/ios/#documentation/general/conceptual/ 2964 DevPedia-CocoaCore/UniformTypeIdentifier.html>. 2966 Appendix A. Changes from RFC 8216 2968 Several changes have been made since the publication of RFC 8216 2969 [RFC8216]. 2971 The following tags have been added: EXT-X-GAP, EXT-X-BITRATE, and 2972 EXT-X-DEFINE (including variable substitution). 2974 IMSC has been added to the set of recognized subtitle formats. 2976 The VIDEO-RANGE attribute has been added to the EXT-X-STREAM-INF and 2977 EXT-X-I-FRAME-STREAM-INF tags. 2979 TYPE-1 has been added as a defined value for the HDCP-LEVEL 2980 attribute. 2982 The minimum new segment publication latency has been removed from 2983 server timing model. 2985 The Availability Duration of a Media Segment now depends on the 2986 presence of an EXT-X-ENDLIST tag. 2988 The recommended playlist offset to join a live stream has changed. 2990 The minimum delay before reloading a Playlist file has changed. 2992 There have been a number of minor editorial changes. 2994 Author's Address 2996 Roger Pantos (editor) 2997 Apple Inc. 2998 Cupertino, California 2999 United States 3001 Email: http-live-streaming-review@group.apple.com