idnits 2.17.1 draft-pantos-hls-rfc8216bis-08.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- -- The document has an IETF Trust Provisions (28 Dec 2009) Section 6.c(i) Publication Limitation clause. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- == There are 2 instances of lines with non-RFC2606-compliant FQDNs in the document. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (October 29, 2020) is 1274 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) October 29, 2020 5 Intended status: Informational 6 Expires: May 2, 2021 8 HTTP Live Streaming 2nd Edition 9 draft-pantos-hls-rfc8216bis-08 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 10 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 May 2, 2021. 36 Copyright Notice 38 Copyright (c) 2020 IETF Trust and the persons identified as the 39 document authors. All rights reserved. 41 This document is subject to BCP 78 and the IETF Trust's Legal 42 Provisions Relating to IETF Documents 43 (https://trustee.ietf.org/license-info) in effect on the date of 44 publication of this document. Please review these documents 45 carefully, as they describe your rights and restrictions with respect 46 to this document. 48 This document may not be modified, and derivative works of it may not 49 be created, except to format it for publication as an RFC or to 50 translate it into languages other than English. 52 This Informational Internet Draft is submitted as an RFC Editor 53 Contribution and/or non-IETF Document (not as a Contribution, IETF 54 Contribution, nor IETF Document) in accordance with BCP 78 and BCP 55 79. 57 Table of Contents 59 1. Introduction to HTTP Live Streaming . . . . . . . . . . . . . 5 60 2. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . 5 61 3. Media Segments . . . . . . . . . . . . . . . . . . . . . . . 7 62 3.1. Supported Media Segment Formats . . . . . . . . . . . . . 7 63 3.1.1. MPEG-2 Transport Streams . . . . . . . . . . . . . . 8 64 3.1.2. Fragmented MPEG-4 . . . . . . . . . . . . . . . . . . 8 65 3.1.3. Packed Audio . . . . . . . . . . . . . . . . . . . . 9 66 3.1.4. WebVTT . . . . . . . . . . . . . . . . . . . . . . . 9 67 3.1.5. IMSC Subtitles . . . . . . . . . . . . . . . . . . . 10 68 3.2. Partial Segments . . . . . . . . . . . . . . . . . . . . 11 69 4. Playlists . . . . . . . . . . . . . . . . . . . . . . . . . . 11 70 4.1. Definition of a Playlist . . . . . . . . . . . . . . . . 12 71 4.2. Attribute Lists . . . . . . . . . . . . . . . . . . . . . 13 72 4.3. Variable Substitution . . . . . . . . . . . . . . . . . . 14 73 4.4. Playlist Tags . . . . . . . . . . . . . . . . . . . . . . 14 74 4.4.1. Basic Tags . . . . . . . . . . . . . . . . . . . . . 15 75 4.4.1.1. EXTM3U . . . . . . . . . . . . . . . . . . . . . 15 76 4.4.1.2. EXT-X-VERSION . . . . . . . . . . . . . . . . . . 15 77 4.4.2. Media or Master Playlist Tags . . . . . . . . . . . . 15 78 4.4.2.1. EXT-X-INDEPENDENT-SEGMENTS . . . . . . . . . . . 16 79 4.4.2.2. EXT-X-START . . . . . . . . . . . . . . . . . . . 16 80 4.4.2.3. EXT-X-DEFINE . . . . . . . . . . . . . . . . . . 17 81 4.4.3. Media Playlist Tags . . . . . . . . . . . . . . . . . 18 82 4.4.3.1. EXT-X-TARGETDURATION . . . . . . . . . . . . . . 18 83 4.4.3.2. EXT-X-MEDIA-SEQUENCE . . . . . . . . . . . . . . 18 84 4.4.3.3. EXT-X-DISCONTINUITY-SEQUENCE . . . . . . . . . . 19 85 4.4.3.4. EXT-X-ENDLIST . . . . . . . . . . . . . . . . . . 19 86 4.4.3.5. EXT-X-PLAYLIST-TYPE . . . . . . . . . . . . . . . 19 87 4.4.3.6. EXT-X-I-FRAMES-ONLY . . . . . . . . . . . . . . . 20 88 4.4.3.7. EXT-X-PART-INF . . . . . . . . . . . . . . . . . 20 89 4.4.3.8. EXT-X-SERVER-CONTROL . . . . . . . . . . . . . . 21 90 4.4.4. Media Segment Tags . . . . . . . . . . . . . . . . . 22 91 4.4.4.1. EXTINF . . . . . . . . . . . . . . . . . . . . . 22 92 4.4.4.2. EXT-X-BYTERANGE . . . . . . . . . . . . . . . . . 23 93 4.4.4.3. EXT-X-DISCONTINUITY . . . . . . . . . . . . . . . 23 94 4.4.4.4. EXT-X-KEY . . . . . . . . . . . . . . . . . . . . 24 95 4.4.4.5. EXT-X-MAP . . . . . . . . . . . . . . . . . . . . 26 96 4.4.4.6. EXT-X-PROGRAM-DATE-TIME . . . . . . . . . . . . . 27 97 4.4.4.7. EXT-X-GAP . . . . . . . . . . . . . . . . . . . . 27 98 4.4.4.8. EXT-X-BITRATE . . . . . . . . . . . . . . . . . . 27 99 4.4.4.9. EXT-X-PART . . . . . . . . . . . . . . . . . . . 28 100 4.4.5. Media Metadata Tags . . . . . . . . . . . . . . . . . 29 101 4.4.5.1. EXT-X-DATERANGE . . . . . . . . . . . . . . . . . 29 102 4.4.5.1.1. Mapping SCTE-35 into EXT-X-DATERANGE . . . . 31 103 4.4.5.2. EXT-X-SKIP . . . . . . . . . . . . . . . . . . . 33 104 4.4.5.3. EXT-X-PRELOAD-HINT . . . . . . . . . . . . . . . 33 105 4.4.5.4. EXT-X-RENDITION-REPORT . . . . . . . . . . . . . 34 106 4.4.6. Master Playlist Tags . . . . . . . . . . . . . . . . 35 107 4.4.6.1. EXT-X-MEDIA . . . . . . . . . . . . . . . . . . . 35 108 4.4.6.1.1. Rendition Groups . . . . . . . . . . . . . . 39 109 4.4.6.2. EXT-X-STREAM-INF . . . . . . . . . . . . . . . . 40 110 4.4.6.2.1. Alternative Renditions . . . . . . . . . . . 45 111 4.4.6.3. EXT-X-I-FRAME-STREAM-INF . . . . . . . . . . . . 46 112 4.4.6.4. EXT-X-SESSION-DATA . . . . . . . . . . . . . . . 46 113 4.4.6.5. EXT-X-SESSION-KEY . . . . . . . . . . . . . . . . 47 114 5. Key Files . . . . . . . . . . . . . . . . . . . . . . . . . . 48 115 5.1. Structure of Key Files . . . . . . . . . . . . . . . . . 48 116 5.2. IV for AES-128 . . . . . . . . . . . . . . . . . . . . . 48 117 6. Client/Server Responsibilities . . . . . . . . . . . . . . . 48 118 6.1. Introduction . . . . . . . . . . . . . . . . . . . . . . 49 119 6.2. Server Responsibilities . . . . . . . . . . . . . . . . . 49 120 6.2.1. General Server Responsibilities . . . . . . . . . . . 49 121 6.2.2. Live Playlists . . . . . . . . . . . . . . . . . . . 52 122 6.2.3. Encrypting Media Segments . . . . . . . . . . . . . . 53 123 6.2.4. Providing Variant Streams . . . . . . . . . . . . . . 54 124 6.2.5. Delivery Directives Interface . . . . . . . . . . . . 55 125 6.2.5.1. Playlist Delta Updates . . . . . . . . . . . . . 56 126 6.2.5.2. Blocking Playlist Reload . . . . . . . . . . . . 56 127 6.2.6. Providing Preload Hints . . . . . . . . . . . . . . . 57 128 6.3. Client Responsibilities . . . . . . . . . . . . . . . . . 58 129 6.3.1. General Client Responsibilities . . . . . . . . . . . 58 130 6.3.2. Loading the Media Playlist File . . . . . . . . . . . 59 131 6.3.3. Playing the Media Playlist File . . . . . . . . . . . 60 132 6.3.4. Reloading the Media Playlist File . . . . . . . . . . 62 133 6.3.5. Determining the Next Segment to Load . . . . . . . . 63 134 6.3.6. Decrypting Encrypted Media Segments . . . . . . . . . 63 135 6.3.7. Requesting Playlist Delta Updates . . . . . . . . . . 64 136 6.3.8. Issuing Blocking Requests . . . . . . . . . . . . . . 64 137 7. Protocol Version Compatibility . . . . . . . . . . . . . . . 65 138 8. Playlist Examples . . . . . . . . . . . . . . . . . . . . . . 67 139 8.1. Simple Media Playlist . . . . . . . . . . . . . . . . . . 67 140 8.2. Live Media Playlist Using HTTPS . . . . . . . . . . . . . 67 141 8.3. Playlist with Encrypted Media Segments . . . . . . . . . 68 142 8.4. Master Playlist . . . . . . . . . . . . . . . . . . . . . 68 143 8.5. Master Playlist with I-Frames . . . . . . . . . . . . . . 68 144 8.6. Master Playlist with Alternative Audio . . . . . . . . . 69 145 8.7. Master Playlist with Alternative Video . . . . . . . . . 69 146 8.8. Session Data in a Master Playlist . . . . . . . . . . . . 70 147 8.9. CHARACTERISTICS Attribute Containing Multiple 148 Characteristics . . . . . . . . . . . . . . . . . . . . . 70 149 8.10. EXT-X-DATERANGE Carrying SCTE-35 Tags . . . . . . . . . . 71 150 8.11. Low-Latency Playlist . . . . . . . . . . . . . . . . . . 71 151 9. Contributors . . . . . . . . . . . . . . . . . . . . . . . . 72 152 10. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 72 153 11. Security Considerations . . . . . . . . . . . . . . . . . . . 74 154 12. References . . . . . . . . . . . . . . . . . . . . . . . . . 74 155 12.1. Normative References . . . . . . . . . . . . . . . . . . 74 156 12.2. Informative References . . . . . . . . . . . . . . . . . 78 157 Appendix A. Changes from RFC 8216 . . . . . . . . . . . . . . . 79 158 Appendix B. Server Configuration Profiles . . . . . . . . . . . 80 159 B.1. Low-Latency Server Configuration Profile . . . . . . . . 80 160 Appendix C. Low-Latency CDN Tune-in . . . . . . . . . . . . . . 82 161 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 83 163 1. Introduction to HTTP Live Streaming 165 HTTP Live Streaming provides a reliable, cost-effective means of 166 delivering continuous and long-form video over the Internet. It 167 allows a receiver to adapt the bit rate of the media to the current 168 network conditions in order to maintain uninterrupted playback at the 169 best possible quality. It supports interstitial content boundaries. 170 It provides a flexible framework for media encryption. It can 171 efficiently offer multiple renditions of the same content, such as 172 audio translations. It offers compatibility with large-scale HTTP 173 caching infrastructure to support delivery to large audiences. It 174 supports low-latency playback at scale. 176 Since its first draft publication in 2009, HTTP Live Streaming has 177 been implemented and deployed by a wide array of content producers, 178 tools vendors, distributors, and device manufacturers. In the 179 subsequent ten years the protocol has been refined by extensive 180 review and discussion with a variety of media streaming implementors. 182 The purpose of this document is to facilitate interoperability 183 between HTTP Live Streaming implementations by describing the media 184 transmission protocol. Using this protocol, a client can receive a 185 continuous stream of media from a server for concurrent presentation. 187 This document describes version 10 of the protocol. 189 2. Overview 191 A multimedia presentation is specified by a Uniform Resource 192 Identifier (URI) [RFC3986] to a Playlist. 194 A Playlist is either a Media Playlist or a Master Playlist. Both are 195 UTF-8 text files containing URIs and descriptive tags. 197 A Media Playlist contains a list of Media Segments, which, when 198 played sequentially, will play the multimedia presentation. 200 Here is an example of a Media Playlist: 202 #EXTM3U 203 #EXT-X-TARGETDURATION:10 205 #EXTINF:9.009, 206 http://media.example.com/first.ts 207 #EXTINF:9.009, 208 http://media.example.com/second.ts 209 #EXTINF:3.003, 210 http://media.example.com/third.ts 212 The first line is the format identifier tag #EXTM3U. The line 213 containing #EXT-X-TARGETDURATION says that all Media Segments will be 214 10 seconds long or less. Then, three Media Segments are declared. 215 The first and second are 9.009 seconds long; the third is 3.003 216 seconds. 218 To play this Playlist, the client first downloads it and then 219 downloads and plays each Media Segment declared within it. The 220 client reloads the Playlist as described in this document to discover 221 any added segments. Data SHOULD be carried over HTTP [RFC7230], but, 222 in general, a URI can specify any protocol that can reliably transfer 223 the specified resource on demand. 225 A more complex presentation can be described by a Master Playlist. A 226 Master Playlist provides a set of Variant Streams, each of which 227 describes a different version of the same content. 229 A Variant Stream includes a Media Playlist that specifies media 230 encoded at a particular bit rate, in a particular format, and at a 231 particular resolution for media containing video. 233 A Variant Stream can also specify a set of Renditions. Renditions 234 are alternate versions of the content, such as audio produced in 235 different languages or video recorded from different camera angles. 237 Clients should switch between different Variant Streams to adapt to 238 network conditions. Clients should choose Renditions based on user 239 preferences. 241 Certain streams can be played in Low-Latency Mode. Low-Latency Mode 242 refers to the combined use of Partial Segments, Blocking Playlist 243 Reload and preload hinting to enable playback at a reduced delay from 244 live. 246 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 247 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 248 "OPTIONAL" in this document are to be interpreted as described in BCP 249 14 [RFC2119] [RFC8174] when, and only when, they appear in all 250 capitals, as shown here. 252 3. Media Segments 254 A Media Playlist contains a series of Media Segments that make up the 255 overall presentation. A Media Segment is specified by a URI and 256 optionally a byte range. 258 The duration of each Media Segment is indicated in the Media Playlist 259 by its EXTINF tag (Section 4.4.4.1). 261 Each segment in a Media Playlist has a unique integer Media Sequence 262 Number. The Media Sequence Number of the first segment in the Media 263 Playlist is either 0 or declared in the Playlist (Section 4.4.3.2). 264 The Media Sequence Number of every other segment is equal to the 265 Media Sequence Number of the segment that precedes it plus one. 267 Each Media Segment MUST carry the continuation of the encoded 268 bitstream from the end of the segment with the previous Media 269 Sequence Number, where values in a series such as timestamps and 270 Continuity Counters MUST continue uninterrupted. The only exceptions 271 are the first Media Segment ever to appear in a Media Playlist and 272 Media Segments that are explicitly signaled as discontinuities 273 (Section 4.4.4.3). Unmarked media discontinuities can trigger 274 playback errors. 276 Any Media Segment that contains video SHOULD include enough 277 information to initialize a video decoder and decode a continuous set 278 of frames that includes the final frame in the Segment; network 279 efficiency is optimized if there is enough information in the Segment 280 to decode all frames in the Segment. For example, any Media Segment 281 containing H.264 video SHOULD contain an Instantaneous Decoding 282 Refresh (IDR); frames prior to the first IDR will be downloaded but 283 possibly discarded. 285 3.1. Supported Media Segment Formats 287 All Media Segments MUST be in a format described in this section. 288 Transport of other media file formats is not defined. 290 Some media formats require a common sequence of bytes to initialize a 291 parser before a Media Segment can be parsed. This format-specific 292 sequence is called the Media Initialization Section. The Media 293 Initialization Section can be specified by an EXT-X-MAP tag 294 (Section 4.4.4.5). The Media Initialization Section MUST NOT contain 295 sample data. 297 3.1.1. MPEG-2 Transport Streams 299 MPEG-2 Transport Streams are specified by [ISO_13818]. 301 The Media Initialization Section of an MPEG-2 Transport Stream 302 Segment is a Program Association Table (PAT) followed by a Program 303 Map Table (PMT). 305 Transport Stream Segments MUST contain a single MPEG-2 Program; 306 playback of Multi-Program Transport Streams is not defined. Each 307 Transport Stream Segment MUST contain a PAT and a PMT, or have an 308 EXT-X-MAP tag (Section 4.4.4.5) applied to it. The first two 309 Transport Stream packets in a Segment without an EXT-X-MAP tag SHOULD 310 be a PAT and a PMT. 312 3.1.2. Fragmented MPEG-4 314 MPEG-4 Fragments are specified by the ISO Base Media File Format 315 [ISOBMFF]. Unlike regular MPEG-4 files that have a Movie Box 316 ('moov') that contains sample tables and a Media Data Box ('mdat') 317 containing the corresponding samples, an MPEG-4 Fragment consists of 318 a Movie Fragment Box ('moof') containing a subset of the sample table 319 and a Media Data Box containing those samples. Use of MPEG-4 320 Fragments does require a Movie Box for initialization, but that Movie 321 Box contains only non-sample-specific information such as track and 322 sample descriptions. 324 A Fragmented MPEG-4 (fMP4) Segment is a "segment" as defined by 325 Section 3 of [ISOBMFF], including the constraints on Media Data Boxes 326 in Section 8.16 of [ISOBMFF]. 328 The Media Initialization Section for an fMP4 Segment is an ISO Base 329 Media File that can initialize a parser for that Segment. 331 Broadly speaking, fMP4 Segments and Media Initialization Sections are 332 [ISOBMFF] files that also satisfy the constraints described in this 333 section. 335 The Media Initialization Section for an fMP4 Segment MUST contain a 336 File Type Box ('ftyp') containing a brand that is compatible with 337 'iso6' or higher. The File Type Box MUST be followed by a Movie Box. 338 The Movie Box MUST contain a Track Box ('trak') for every Track 339 Fragment Box ('traf') in the fMP4 Segment, with matching track_ID. 340 Each Track Box SHOULD contain a sample table, but its sample count 341 MUST be zero. Movie Header Boxes ('mvhd') and Track Header Boxes 342 ('tkhd') MUST have durations of zero. The Movie Box MUST contain a 343 Movie Extends Box ('mvex'); it SHOULD follow the last Track Box. 345 Note that a Common Media Application Format [CMAF] Header meets all 346 these requirements. 348 In an fMP4 Segment, every Track Fragment Box MUST contain a Track 349 Fragment Decode Time Box ('tfdt'). fMP4 Segments MUST use movie- 350 fragment-relative addressing. fMP4 Segments MUST NOT use external 351 data references. Note that a CMAF Segment meets these requirements. 353 An fMP4 Segment in a Playlist containing the EXT-X-I-FRAMES-ONLY tag 354 (Section 4.4.3.6) MAY omit the portion of the Media Data Box 355 following the intra-coded frame (I-frame) sample data. 357 This specification makes no additional restrictions on [ISOBMFF] 358 boxes or box order. However, fMP4 Segments that indicate 359 compatibility with an additional standard, such as [CMAF], SHOULD 360 comply with whatever rules that standard requires. 362 Each fMP4 Segment in a Media Playlist MUST have an EXT-X-MAP tag 363 applied to it. 365 3.1.3. Packed Audio 367 A Packed Audio Segment contains encoded audio samples and ID3 tags 368 that are simply packed together with minimal framing and no per- 369 sample timestamps. Supported Packed Audio formats are Advanced Audio 370 Coding (AAC) with Audio Data Transport Stream (ADTS) framing 371 [ISO_13818_7], MP3 [ISO_13818_3], AC-3 [AC_3], and Enhanced AC-3 372 [AC_3]. 374 A Packed Audio Segment has no Media Initialization Section. 376 Each Packed Audio Segment MUST signal the timestamp of its first 377 sample with an ID3 Private frame (PRIV) tag [ID3] at the beginning of 378 the segment. The ID3 PRIV owner identifier MUST be 379 "com.apple.streaming.transportStreamTimestamp". The ID3 payload MUST 380 be a 33-bit MPEG-2 Program Elementary Stream timestamp expressed as a 381 big-endian eight-octet number, with the upper 31 bits set to zero. 382 Clients SHOULD NOT play Packed Audio Segments without this ID3 tag. 384 3.1.4. WebVTT 386 A WebVTT Segment is a section of a WebVTT [WebVTT] file. WebVTT 387 Segments carry subtitles. 389 The Media Initialization Section of a WebVTT Segment is the WebVTT 390 header. 392 Each WebVTT Segment MUST contain all subtitle cues that are intended 393 to be displayed during the period indicated by the segment EXTINF 394 duration. The start time offset and end time offset of each cue MUST 395 indicate the total display time for that cue, even if part of the cue 396 time range is outside the Segment period. A WebVTT Segment MAY 397 contain no cues; this indicates that no subtitles are to be displayed 398 during that period. 400 Each WebVTT Segment MUST either start with a WebVTT header or have an 401 EXT-X-MAP tag applied to it. 403 In order to synchronize timestamps between audio/video and subtitles, 404 an X-TIMESTAMP-MAP metadata header SHOULD be added to each WebVTT 405 header. This header maps WebVTT cue timestamps to media timestamps 406 in other Renditions of the Variant Stream. Its format is: 408 X-TIMESTAMP-MAP=LOCAL:,MPEGTS: 409 e.g., X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000 411 indicating the media time to which the cue time MUST be mapped. The 412 cue timestamp in the LOCAL attribute MAY fall outside the range of 413 time covered by the segment. 415 The MPEGTS media timestamp MUST use a 90KHz timescale, even when non- 416 WebVTT Media Segments use a different timescale. 418 If a WebVTT segment does not have the X-TIMESTAMP-MAP, the client 419 MUST assume that the WebVTT cue time of 0 maps to an media timestamp 420 of 0. 422 When synchronizing WebVTT with PES timestamps, clients SHOULD account 423 for cases where the 33-bit PES timestamps have wrapped and the WebVTT 424 cue times have not. When the PES timestamp wraps, the WebVTT segment 425 SHOULD have a X-TIMESTAMP-MAP header that maps the current WebVTT 426 time to the new (low valued) PES timestamp. 428 3.1.5. IMSC Subtitles 430 An IMSC Segment is a Fragmented MPEG-4 (Section 3.1.2) Media Segment 431 that carries subtitle media according to MPEG-4 Part 30 432 [MP4_TIMED_TEXT]. This subtitle media MUST comply with the Text 433 Profile of IMSC1 [IMSC1]. 435 The Media Initialization Section of an IMSC Segment is specified in 436 Section 3.1.2. 438 Each IMSC Segment MUST contain all subtitle samples that are intended 439 to be displayed during the period indicated by the segment EXTINF 440 duration. Each Segment MUST contain definitions for all styles which 441 are applied to any part of any sample in the Segment. 443 3.2. Partial Segments 445 One component of viewer delay in a live stream is publishing latency: 446 a Segment cannot be distributed until it has been completely encoded 447 and packaged. A long Segment encoded in real-time introduces a delay 448 equal to its duration. Partial Segments provide a parallel channel 449 for distributing media at the live edge of the Media Playlist, where 450 the media is divided into a larger number of smaller pieces, such as 451 CMAF Chunks. These subsets are called Partial Segments. Because 452 each Partial Segment has a short duration, it can be packaged, 453 published, and added to the Media Playlist much earlier than its 454 Parent Segment. 456 A Partial Segment MUST be in one of the Supported Media Segment 457 Formats described in Section 3.1. A Partial Segment is associated 458 with a regular Media Segment, called its Parent Segment, by appearing 459 before it in the Media Playlist, and after the previous Media 460 Segment. Partial Segments are identified by the EXT-X-PART tag 461 (Section 4.4.4.9). 463 A Partial Segment MUST contain a subset of the media samples in its 464 Parent Segment. A Parent Segment and its entire set of Partial 465 Segments MUST contain the same set of media samples, with the same 466 timing and metadata. 468 Each Partial Segment has a Part Index, which is an integer indicating 469 the position of the Partial Segment within its Parent Segment. The 470 first Partial Segment has a Part Index of zero. 472 Each Partial Segment also has a Media Sequence Number, which is equal 473 to the Media Sequence Number of its Parent Segment. 475 4. Playlists 477 This section describes the Playlist files used by HTTP Live 478 Streaming. In this section, "MUST" and "MUST NOT" specify the rules 479 for the syntax and structure of legal Playlist files. Playlists that 480 violate these rules are invalid; clients MUST fail to parse them. 481 See Section 6.3.2. 483 The format of the Playlist files is derived from the M3U [M3U] 484 playlist file format and inherits two tags from that earlier file 485 format: EXTM3U (Section 4.4.1.1) and EXTINF (Section 4.4.4.1). 487 In the specification of tag syntax, a string enclosed by <> 488 identifies a tag parameter; its specific format is described in its 489 tag definition. If a parameter is further surrounded by [], it is 490 optional; otherwise, it is required. 492 Each Playlist file MUST be identifiable either by the path component 493 of its URI or by HTTP Content-Type. In the first case, the path MUST 494 end with either .m3u8 or .m3u. In the second, the HTTP Content-Type 495 MUST be "application/vnd.apple.mpegurl" or "audio/mpegurl". Clients 496 SHOULD refuse to parse Playlists that are not so identified. 498 4.1. Definition of a Playlist 500 Playlist files MUST be encoded in UTF-8 [RFC3629]. They MUST NOT 501 contain any Byte Order Mark (BOM); clients SHOULD fail to parse 502 Playlists that contain a BOM or do not parse as UTF-8. Playlist 503 files MUST NOT contain UTF-8 control characters (U+0000 to U+001F and 504 U+007F to U+009F), with the exceptions of CR (U+000D) and LF 505 (U+000A). All character sequences MUST be normalized according to 506 Unicode normalization form "NFC" [UNICODE]. Note that US-ASCII 507 [US_ASCII] conforms to these rules. 509 Lines in a Playlist file are terminated by either a single line feed 510 character or a carriage return character followed by a line feed 511 character. Each line is a URI, is blank, or starts with the 512 character '#'. Blank lines are ignored. Whitespace MUST NOT be 513 present, except for elements in which it is explicitly specified. 515 Lines that start with the character '#' are either comments or tags. 516 Tags begin with #EXT. They are case sensitive. All other lines that 517 begin with '#' are comments and SHOULD be ignored. 519 A URI line identifies a Media Segment or a Playlist file (see 520 Section 4.4.6.2). Each Media Segment is specified by a URI and the 521 tags that apply to it. 523 A Playlist is a Media Playlist if all URI lines in the Playlist 524 identify Media Segments. A Playlist is a Master Playlist if all URI 525 lines in the Playlist identify Media Playlists. A Playlist MUST be 526 either a Media Playlist or a Master Playlist; all other Playlists are 527 invalid. 529 A URI in a Playlist, whether it is a URI line or part of a tag, MAY 530 be relative. Any relative URI is considered to be relative to the 531 URI of the Playlist that contains it. 533 The duration of a Media Playlist is the sum of the durations of the 534 Media Segments within it. 536 The segment bit rate of a Media Segment is the size of the Media 537 Segment divided by its EXTINF duration (Section 4.4.4.1). Note that 538 this includes container overhead but does not include overhead 539 imposed by the delivery system, such as HTTP, TCP, or IP headers. 541 The peak segment bit rate of a Media Playlist is the largest bit rate 542 of any contiguous set of segments whose total duration is between 0.5 543 times the Target Duration and 1.5 times the Target Duration plus 0.5 544 seconds (since media segments may exceed the Target Duration by up to 545 0.5 seconds). The bit rate of a set is calculated by dividing the 546 sum of the segment sizes by the sum of the segment durations. 548 The average segment bit rate of a Media Playlist is the sum of the 549 sizes (in bits) of every Media Segment in the Media Playlist, divided 550 by the Media Playlist duration. Note that this includes container 551 overhead, but not HTTP or other overhead imposed by the delivery 552 system. 554 4.2. Attribute Lists 556 Certain tags have values that are attribute-lists. An attribute-list 557 is a comma-separated list of attribute/value pairs with no 558 whitespace. 560 An attribute/value pair has the following syntax: 562 AttributeName=AttributeValue 564 An AttributeName is an unquoted string containing characters from the 565 set [A..Z], [0..9], and '-'. Therefore, AttributeNames contain only 566 uppercase letters, not lowercase. There MUST NOT be any whitespace 567 between the AttributeName and the '=' character, nor between the '=' 568 character and the AttributeValue. 570 An AttributeValue is one of the following: 572 o decimal-integer: an unquoted string of characters from the set 573 [0..9] expressing an integer in base-10 arithmetic in the range 574 from 0 to 2^64-1 (18446744073709551615). A decimal-integer may be 575 from 1 to 20 characters long. 577 o hexadecimal-sequence: an unquoted string of characters from the 578 set [0..9] and [A..F] that is prefixed with 0x or 0X. The maximum 579 length of a hexadecimal-sequence depends on its AttributeNames. 581 o decimal-floating-point: an unquoted string of characters from the 582 set [0..9] and '.' that expresses a non-negative floating-point 583 number in decimal positional notation. 585 o signed-decimal-floating-point: an unquoted string of characters 586 from the set [0..9], '-', and '.' that expresses a signed 587 floating-point number in decimal positional notation. 589 o quoted-string: a string of characters within a pair of double 590 quotes (0x22). The following characters MUST NOT appear in a 591 quoted-string: line feed (0xA), carriage return (0xD), or double 592 quote (0x22). Quoted-string AttributeValues SHOULD be constructed 593 so that byte-wise comparison is sufficient to test two quoted- 594 string AttributeValues for equality. Note that this implies case- 595 sensitive comparison. 597 o enumerated-string: an unquoted character string from a set that is 598 explicitly defined by the AttributeName. An enumerated-string 599 will never contain double quotes ("), commas (,), or whitespace. 601 o decimal-resolution: two decimal-integers separated by the "x" 602 character. The first integer is a horizontal pixel dimension 603 (width); the second is a vertical pixel dimension (height). 605 The type of the AttributeValue for a given AttributeName is specified 606 by the attribute definition. 608 A given AttributeName MUST NOT appear more than once in a given 609 attribute-list. Clients SHOULD refuse to parse such Playlists. 611 4.3. Variable Substitution 613 The following Playlist elements are subject to variable substitution: 615 o URI lines 617 o quoted-string AttributeValues 619 o hexadecimal-sequence AttributeValues 621 A Variable Reference is a string of the form "{$" (0x7B,0x24) 622 followed by a Variable Name followed by "}" (0x7D). Variable Names 623 are defined by the EXT-X-DEFINE tag (Section 4.4.2.3). 625 See Section 6.3.1 for more information about variable substitution. 627 4.4. Playlist Tags 629 Playlist tags specify either global parameters of the Playlist or 630 information about the Media Segments or Media Playlists that appear 631 after them. 633 4.4.1. Basic Tags 635 These tags are allowed in both Media Playlists and Master Playlists. 637 4.4.1.1. EXTM3U 639 The EXTM3U tag indicates that the file is an Extended M3U [M3U] 640 Playlist file. It MUST be the first line of every Media Playlist and 641 every Master Playlist. Its format is: 643 #EXTM3U 645 4.4.1.2. EXT-X-VERSION 647 The EXT-X-VERSION tag indicates the compatibility version of the 648 Playlist file, its associated media, and its server. 650 The EXT-X-VERSION tag applies to the entire Playlist file. Its 651 format is: 653 #EXT-X-VERSION: 655 where n is an integer indicating the protocol compatibility version 656 number. 658 It MUST appear in all Playlists containing tags or attributes that 659 are not compatible with protocol version 1 to support 660 interoperability with older clients. Section 7 specifies the minimum 661 value of the compatibility version number for any given Playlist 662 file. 664 A Playlist file MUST NOT contain more than one EXT-X-VERSION tag. If 665 a client encounters a Playlist with multiple EXT-X-VERSION tags, it 666 MUST fail to parse it. 668 4.4.2. Media or Master Playlist Tags 670 The tags in this section can appear in either Master Playlists or 671 Media Playlists. If one of these tags appears in a Master Playlist, 672 it SHOULD NOT appear in any Media Playlist referenced by that Master 673 Playlist. A tag that appears in both MUST have the same value; 674 otherwise, clients SHOULD ignore the value in the Media Playlist(s). 676 Tags in this section MUST NOT appear more than once in a Playlist. 677 If one does, clients MUST fail to parse the Playlist. The only 678 exception to this rule is EXT-X-DEFINE, which MAY appear more than 679 once. 681 4.4.2.1. EXT-X-INDEPENDENT-SEGMENTS 683 The EXT-X-INDEPENDENT-SEGMENTS tag indicates that all media samples 684 in a Media Segment can be decoded without information from other 685 segments. It applies to every Media Segment in the Playlist. 687 Its format is: 689 #EXT-X-INDEPENDENT-SEGMENTS 691 If the EXT-X-INDEPENDENT-SEGMENTS tag appears in a Master Playlist, 692 it applies to every Media Segment in every Media Playlist in the 693 Master Playlist. 695 4.4.2.2. EXT-X-START 697 The EXT-X-START tag indicates a preferred point at which to start 698 playing a Playlist. By default, clients SHOULD start playback at 699 this point when beginning a playback session. This tag is OPTIONAL. 701 Its format is: 703 #EXT-X-START: 705 The following attributes are defined: 707 TIME-OFFSET 709 The value of TIME-OFFSET is a signed-decimal-floating-point number 710 of seconds. A positive number indicates a time offset from the 711 beginning of the Playlist. A negative number indicates a negative 712 time offset from the end of the last Media Segment in the 713 Playlist. This attribute is REQUIRED. 715 The absolute value of TIME-OFFSET SHOULD NOT be larger than the 716 Playlist duration. If the absolute value of TIME-OFFSET exceeds 717 the duration of the Playlist, it indicates either the end of the 718 Playlist (if positive) or the beginning of the Playlist (if 719 negative). 721 If the Playlist does not contain the EXT-X-ENDLIST tag, the TIME- 722 OFFSET SHOULD NOT be within three Target Durations of the end of 723 the Playlist file. 725 PRECISE 727 The value is an enumerated-string; valid strings are YES and NO. 728 If the value is YES, clients SHOULD start playback at the Media 729 Segment containing the TIME-OFFSET, but SHOULD NOT render media 730 samples in that segment whose presentation times are prior to the 731 TIME-OFFSET. If the value is NO, clients SHOULD attempt to render 732 every media sample in that segment. This attribute is OPTIONAL. 733 If it is missing, its value should be treated as NO. 735 4.4.2.3. EXT-X-DEFINE 737 The EXT-X-DEFINE tag provides a Playlist variable definition or 738 declaration. This tag is OPTIONAL. 740 Its format is: 742 #EXT-X-DEFINE: 744 The following attributes are defined: 746 NAME 748 The value is a quoted-string which specifies the Variable Name. 749 All characters in the quoted-string MUST be from the following 750 set: [a..z], [A..Z], [0..9], '-', and '_'. 752 VALUE 754 The value is a quoted-string which specifies the Variable Value. 755 This attribute is REQUIRED if the EXT-X-DEFINE tag has a NAME 756 attribute. 758 IMPORT 760 The value is a quoted-string which specifies the Variable Name and 761 indicates that its value is that of the variable of the same name 762 in the Master Playlist. EXT-X-DEFINE tags containing the IMPORT 763 attribute MUST NOT occur in Master Playlists; they are only 764 allowed in Media Playlists. 766 If the IMPORT attribute value does not match any Variable Name 767 declared in the Master Playlist, or if the Media Playlist was not 768 loaded from a Master Playlist, the parser MUST fail to parse the 769 Playlist. 771 An EXT-X-DEFINE tag MUST contain either a NAME or an IMPORT 772 attribute, but not both. 774 An EXT-X-DEFINE tag MUST NOT specify the same Variable Name as any 775 other EXT-X-DEFINE tag in the same Playlist. Parsers that encounter 776 duplicate Variable Name declarations MUST fail to parse the Playlist. 778 EXT-X-DEFINE tags do NOT implicitly persist across Playlist reloads. 780 4.4.3. Media Playlist Tags 782 Media Playlist tags describe global parameters of the Media Playlist. 783 There MUST NOT be more than one Media Playlist tag of each type in 784 any Media Playlist. 786 A Media Playlist tag MUST NOT appear in a Master Playlist 788 4.4.3.1. EXT-X-TARGETDURATION 790 The EXT-X-TARGETDURATION tag specifies the Target Duration, an upper 791 bound on the duration of all Media Segments in the Playlist. The 792 EXTINF duration of each Media Segment in a Playlist file, when 793 rounded to the nearest integer, MUST be less than or equal to the 794 Target Duration. Longer segments can trigger playback stalls or 795 other errors. It applies to the entire Playlist file. Its format 796 is: 798 #EXT-X-TARGETDURATION: 800 where s is a decimal-integer indicating the Target Duration in 801 seconds. The EXT-X-TARGETDURATION tag is REQUIRED. 803 4.4.3.2. EXT-X-MEDIA-SEQUENCE 805 The EXT-X-MEDIA-SEQUENCE tag indicates the Media Sequence Number of 806 the first Media Segment that appears in a Playlist file. Its format 807 is: 809 #EXT-X-MEDIA-SEQUENCE: 811 where number is a decimal-integer. 813 If the Media Playlist file does not contain an EXT-X-MEDIA-SEQUENCE 814 tag, then the Media Sequence Number of the first Media Segment in the 815 Media Playlist SHALL be considered to be 0. A client MUST NOT assume 816 that segments with the same Media Sequence Number in different Media 817 Playlists contain matching content (see Section 6.3.2). 819 A URI for a Media Segment is not required to contain its Media 820 Sequence Number. 822 See Section 6.2.1 and Section 6.3.5 for more information on setting 823 the EXT-X-MEDIA-SEQUENCE tag. 825 The EXT-X-MEDIA-SEQUENCE tag MUST appear before the first Media 826 Segment in the Playlist. 828 4.4.3.3. EXT-X-DISCONTINUITY-SEQUENCE 830 The EXT-X-DISCONTINUITY-SEQUENCE tag allows synchronization between 831 different Renditions of the same Variant Stream or different Variant 832 Streams that have EXT-X-DISCONTINUITY tags in their Media Playlists. 834 Its format is: 836 #EXT-X-DISCONTINUITY-SEQUENCE: 838 where number is a decimal-integer. 840 If the Media Playlist does not contain an EXT-X-DISCONTINUITY- 841 SEQUENCE tag, then the Discontinuity Sequence Number of the first 842 Media Segment in the Playlist SHALL be considered to be 0. 844 The EXT-X-DISCONTINUITY-SEQUENCE tag MUST appear before the first 845 Media Segment in the Playlist. 847 The EXT-X-DISCONTINUITY-SEQUENCE tag MUST appear before any EXT- 848 X-DISCONTINUITY tag. 850 See Section 6.2.1 and Section 6.2.2 for more information about 851 setting the value of the EXT-X-DISCONTINUITY-SEQUENCE tag. 853 4.4.3.4. EXT-X-ENDLIST 855 The EXT-X-ENDLIST tag indicates that no more Media Segments will be 856 added to the Media Playlist file. It MAY occur anywhere in the Media 857 Playlist file. Its format is: 859 #EXT-X-ENDLIST 861 4.4.3.5. EXT-X-PLAYLIST-TYPE 863 The EXT-X-PLAYLIST-TYPE tag provides mutability information about the 864 Media Playlist file. It applies to the entire Media Playlist file. 865 It is OPTIONAL. Its format is: 867 #EXT-X-PLAYLIST-TYPE: 869 where type-enum is either EVENT or VOD. 871 Section 6.2.1 defines the implications of the EXT-X-PLAYLIST-TYPE 872 tag. 874 If the EXT-X-PLAYLIST-TYPE value is EVENT, Media Segments can only be 875 added to the end of the Media Playlist. If the EXT-X-PLAYLIST-TYPE 876 value is Video On Demand (VOD), the Media Playlist cannot change. 878 If the EXT-X-PLAYLIST-TYPE tag is omitted from a Media Playlist, the 879 Playlist can be updated according to the rules in Section 6.2.1 with 880 no additional restrictions. For example, a live Playlist 881 (Section 6.2.2) MAY be updated to remove Media Segments in the order 882 that they appeared. 884 4.4.3.6. EXT-X-I-FRAMES-ONLY 886 The EXT-X-I-FRAMES-ONLY tag indicates that each Media Segment in the 887 Playlist describes a single I-frame. I-frames are encoded video 888 frames whose decoding does not depend on any other frame. I-frame 889 Playlists can be used for trick play, such as fast forward, rapid 890 reverse, and scrubbing. 892 The EXT-X-I-FRAMES-ONLY tag applies to the entire Playlist. Its 893 format is: 895 #EXT-X-I-FRAMES-ONLY 897 In a Playlist with the EXT-X-I-FRAMES-ONLY tag, the Media Segment 898 duration (EXTINF tag value) is the time between the presentation time 899 of the I-frame in the Media Segment and the presentation time of the 900 next I-frame in the Playlist, or the end of the presentation if it is 901 the last I-frame in the Playlist. 903 Media resources containing I-frame segments MUST begin with either a 904 Media Initialization Section (Section 3) or be accompanied by an EXT- 905 X-MAP tag indicating the Media Initialization Section so that clients 906 can load and decode I-frame segments in any order. The byte range of 907 an I-frame segment with an EXT-X-BYTERANGE tag applied to it 908 (Section 4.4.4.2) MUST NOT include its Media Initialization Section; 909 clients can assume that the Media Initialization Section is defined 910 by the EXT-X-MAP tag, or is located between the start of the resource 911 and the offset of the first I-frame segment in that resource. 913 Use of the EXT-X-I-FRAMES-ONLY REQUIRES a compatibility version 914 number of 4 or greater. 916 4.4.3.7. EXT-X-PART-INF 918 The EXT-X-PART-INF tag provides information about the Partial 919 Segments in the Playlist. It is REQUIRED if a Playlist contains one 920 or more EXT-X-PART tags. Its format is: 922 #EXT-X-PART-INF: 924 The following attributes are defined: 926 PART-TARGET 928 The value is a decimal-floating-point number of seconds indicating 929 the Part Target Duration. This attribute is REQUIRED. 931 4.4.3.8. EXT-X-SERVER-CONTROL 933 The EXT-X-SERVER-CONTROL tag allows the Server to indicate support 934 for Delivery Directives (Section 6.2.5). Its format is:. 936 #EXT-X-SERVER-CONTROL: 938 The following attributes are defined: 940 CAN-SKIP-UNTIL 942 Indicates that the Server can produce Playlist Delta Updates in 943 response to the _HLS_skip Delivery Directive. Its value is the 944 Skip Boundary, a decimal-floating-point number of seconds. The 945 Skip Boundary MUST be at least six times the Target Duration. 947 This attribute is OPTIONAL. It MAY appear in any Media Playlist. 949 CAN-SKIP-DATERANGES 951 A value of YES indicates that the Server can produce Playlist 952 Delta Updates that skip older EXT-X-DATERANGE tags in addition to 953 Media Segments. 955 This attribute is OPTIONAL. It REQUIRES the presence of the CAN- 956 SKIP-UNTIL attribute. 958 HOLD-BACK 960 The value is a decimal-floating-point number of seconds that 961 indicates the server-recommended minimum distance from the end of 962 the Playlist at which clients should begin to play or to which 963 they should seek, unless PART-HOLD-BACK applies. Its value MUST 964 be at least three times the Target Duration. 966 This attribute is OPTIONAL. Its absence implies a value of three 967 times the Target Duration. It MAY appear in any Media Playlist. 969 PART-HOLD-BACK 970 The value is a decimal-floating-point number of seconds that 971 indicates the server-recommended minimum distance from the end of 972 the Playlist at which clients should begin to play or to which 973 they should seek when playing in Low-Latency Mode. Its value MUST 974 be at least twice the Part Target Duration. Its value SHOULD be 975 at least three times the Part Target Duration. If different 976 Renditions have different Part Target Durations then PART-HOLD- 977 BACK SHOULD be at least three times the maximum Part Target 978 Duration. 980 PART-HOLD-BACK is REQUIRED if the Playlist contains the EXT-X- 981 PART-INF tag. 983 CAN-BLOCK-RELOAD 985 The value is an enumerated-string whose value is YES if the server 986 supports Blocking Playlist Reload (Section 6.2.5.2). This 987 attribute is OPTIONAL; its absence implies no support. 989 4.4.4. Media Segment Tags 991 Each Media Segment is specified by a series of Media Segment tags 992 followed by a URI. Some Media Segment tags apply to just the next 993 segment; others apply to all subsequent segments until another 994 instance of the same tag. 996 A Media Segment tag MUST NOT appear in a Master Playlist. Clients 997 MUST fail to parse Playlists that contain both Media Segment tags and 998 Master Playlist tags (Section 4.4.6). 1000 4.4.4.1. EXTINF 1002 The EXTINF tag specifies the duration of a Media Segment. It applies 1003 only to the next Media Segment. This tag is REQUIRED for each Media 1004 Segment. Its format is: 1006 #EXTINF:,[] 1008 where duration is a decimal-floating-point or decimal-integer number 1009 (as described in Section 4.2) that specifies the duration of the 1010 Media Segment in seconds. Durations SHOULD be decimal-floating- 1011 point, with enough accuracy to avoid perceptible error when segment 1012 durations are accumulated. However, if the compatibility version 1013 number is less than 3, durations MUST be integers. Durations that 1014 are reported as integers SHOULD be rounded to the nearest integer. 1015 The remainder of the line following the comma is an optional human- 1016 readable informative title of the Media Segment expressed as UTF-8 1017 text. 1019 4.4.4.2. EXT-X-BYTERANGE 1021 The EXT-X-BYTERANGE tag indicates that a Media Segment is a sub-range 1022 of the resource identified by its URI. It applies only to the next 1023 URI line that follows it in the Playlist. Its format is: 1025 #EXT-X-BYTERANGE:<n>[@<o>] 1027 where n is a decimal-integer indicating the length of the sub-range 1028 in bytes. If present, o is a decimal-integer indicating the start of 1029 the sub-range, as a byte offset from the beginning of the resource. 1030 If o is not present, the sub-range begins at the next byte following 1031 the sub-range of the previous Media Segment. 1033 If o is not present, a previous Media Segment MUST appear in the 1034 Playlist file and MUST be a sub-range of the same media resource, or 1035 the Media Segment is undefined and the client MUST fail to parse the 1036 Playlist. 1038 A Media Segment without an EXT-X-BYTERANGE tag consists of the entire 1039 resource identified by its URI. 1041 Use of the EXT-X-BYTERANGE tag REQUIRES a compatibility version 1042 number of 4 or greater. 1044 4.4.4.3. EXT-X-DISCONTINUITY 1046 The EXT-X-DISCONTINUITY tag indicates a discontinuity between the 1047 Media Segment that follows it and the one that preceded it. 1049 Its format is: 1051 #EXT-X-DISCONTINUITY 1053 The EXT-X-DISCONTINUITY tag MUST be present if there is a change in 1054 any of the following characteristics: 1056 o file format 1058 o number, type, and identifiers of tracks 1060 o timestamp sequence 1062 The EXT-X-DISCONTINUITY tag SHOULD be present if there is a change in 1063 any of the following characteristics: 1065 o encoding parameters 1066 o encoding sequence 1068 See Section 3, Section 6.2.1, and Section 6.3.3 for more information 1069 about the EXT-X-DISCONTINUITY tag. 1071 4.4.4.4. EXT-X-KEY 1073 Media Segments MAY be encrypted. The EXT-X-KEY tag specifies how to 1074 decrypt them. It applies to every Media Segment and to every Media 1075 Initialization Section declared by an EXT-X-MAP tag that appears 1076 between it and the next EXT-X-KEY tag in the Playlist file with the 1077 same KEYFORMAT attribute (or the end of the Playlist file). Two or 1078 more EXT-X-KEY tags with different KEYFORMAT attributes MAY apply to 1079 the same Media Segment if they ultimately produce the same decryption 1080 key. The format is: 1082 #EXT-X-KEY:<attribute-list> 1084 The following attributes are defined: 1086 METHOD 1088 The value is an enumerated-string that specifies the encryption 1089 method. This attribute is REQUIRED. 1091 The methods defined are: NONE, AES-128, and SAMPLE-AES. 1093 An encryption method of NONE means that Media Segments are not 1094 encrypted. If the encryption method is NONE, other attributes 1095 MUST NOT be present. 1097 An encryption method of AES-128 signals that Media Segments are 1098 completely encrypted using the Advanced Encryption Standard (AES) 1099 [AES_128] with a 128-bit key, Cipher Block Chaining (CBC), and 1100 Public-Key Cryptography Standards #7 (PKCS7) padding [RFC5652]. 1101 CBC is restarted on each segment boundary, using either the 1102 Initialization Vector (IV) attribute value or the Media Sequence 1103 Number as the IV; see Section 5.2. 1105 An alternative to whole-segment encryption is Sample Encryption. 1106 With Sample Encryption, only media sample data - such as audio 1107 packets or video frames - is encrypted. The rest of the Media 1108 Segment is unencrypted. Sample Encryption allows parts of the 1109 Segment to be processed without (or before) decrypting the media 1110 itself. 1112 An encryption method of SAMPLE-AES means that the Media Segments 1113 are Sample Encrypted using the Advanced Encryption Standard 1115 [AES_128]. How these media streams are encrypted and encapsulated 1116 in a segment depends on the media encoding and the media format of 1117 the segment. fMP4 Media Segments are encrypted using the 'cbcs' 1118 scheme of Common Encryption [COMMON_ENC]. Encryption of other 1119 Media Segment formats containing H.264 [H_264], AAC [ISO_14496], 1120 AC-3 [AC_3], and Enhanced AC-3 [AC_3] media streams is described 1121 in the HTTP Live Streaming (HLS) Sample Encryption specification 1122 [SampleEnc]. The IV attribute MAY be present; see Section 5.2. 1124 URI 1126 The value is a quoted-string containing a URI that specifies how 1127 to obtain the key. This attribute is REQUIRED unless the METHOD 1128 is NONE. 1130 IV 1132 The value is a hexadecimal-sequence that specifies a 128-bit 1133 unsigned integer Initialization Vector to be used with the key. 1134 Use of the IV attribute REQUIRES a compatibility version number of 1135 2 or greater. See Section 5.2 for when the IV attribute is used. 1137 KEYFORMAT 1139 The value is a quoted-string that specifies how the key is 1140 represented in the resource identified by the URI; see Section 5 1141 for more detail. This attribute is OPTIONAL; its absence 1142 indicates an implicit value of "identity". Use of the KEYFORMAT 1143 attribute REQUIRES a compatibility version number of 5 or greater. 1145 KEYFORMATVERSIONS 1147 The value is a quoted-string containing one or more positive 1148 integers separated by the "/" character (for example, "1", "1/2", 1149 or "1/2/5"). If more than one version of a particular KEYFORMAT 1150 is defined, this attribute can be used to indicate which 1151 version(s) this instance complies with. This attribute is 1152 OPTIONAL; if it is not present, its value is considered to be "1". 1153 Use of the KEYFORMATVERSIONS attribute REQUIRES a compatibility 1154 version number of 5 or greater. 1156 If the Media Playlist file does not contain an EXT-X-KEY tag, then 1157 Media Segments are not encrypted. 1159 See Section 5 for the format of the Key file, and Section 5.2, 1160 Section 6.2.3, and Section 6.3.6 for additional information on Media 1161 Segment encryption. 1163 4.4.4.5. EXT-X-MAP 1165 The EXT-X-MAP tag specifies how to obtain the Media Initialization 1166 Section (Section 3) required to parse the applicable Media Segments. 1167 It applies to every Media Segment that appears after it in the 1168 Playlist until the next EXT-X-MAP tag or until the end of the 1169 Playlist. 1171 Its format is: 1173 #EXT-X-MAP:<attribute-list> 1175 The following attributes are defined: 1177 URI 1179 The value is a quoted-string containing a URI that identifies a 1180 resource that contains the Media Initialization Section. This 1181 attribute is REQUIRED. 1183 BYTERANGE 1185 The value is a quoted-string specifying a byte range into the 1186 resource identified by the URI attribute. This range SHOULD 1187 contain only the Media Initialization Section. The format of the 1188 byte range is described in Section 4.4.4.2. This attribute is 1189 OPTIONAL; if it is not present, the byte range is the entire 1190 resource indicated by the URI. 1192 An EXT-X-MAP tag SHOULD be supplied for Media Segments in Playlists 1193 with the EXT-X-I-FRAMES-ONLY tag when the first Media Segment (i.e., 1194 I-frame) in the Playlist (or the first segment following an EXT- 1195 X-DISCONTINUITY tag) does not immediately follow the Media 1196 Initialization Section at the beginning of its resource. 1198 Use of the EXT-X-MAP tag in a Media Playlist that contains the EXT- 1199 X-I-FRAMES-ONLY tag REQUIRES a compatibility version number of 5 or 1200 greater. Use of the EXT-X-MAP tag in a Media Playlist that DOES NOT 1201 contain the EXT-X-I-FRAMES-ONLY tag REQUIRES a compatibility version 1202 number of 6 or greater. 1204 If the Media Initialization Section declared by an EXT-X-MAP tag is 1205 encrypted with a METHOD of AES-128, the IV attribute of the EXT-X-KEY 1206 tag that applies to the EXT-X-MAP is REQUIRED. 1208 4.4.4.6. EXT-X-PROGRAM-DATE-TIME 1210 The EXT-X-PROGRAM-DATE-TIME tag associates the first sample of a 1211 Media Segment with an absolute date and/or time. It applies only to 1212 the next Media Segment. Its format is: 1214 #EXT-X-PROGRAM-DATE-TIME:<date-time-msec> 1216 where date-time-msec is an ISO/IEC 8601:2004 [ISO_8601] date/time 1217 representation, such as YYYY-MM-DDThh:mm:ss.SSSZ. It SHOULD indicate 1218 a time zone and fractional parts of seconds, to millisecond accuracy. 1220 For example: 1222 #EXT-X-PROGRAM-DATE-TIME:2010-02-19T14:54:23.031+08:00 1224 See Section 6.2.1 and Section 6.3.3 for more information on the EXT- 1225 X-PROGRAM-DATE-TIME tag. 1227 4.4.4.7. EXT-X-GAP 1229 The EXT-X-GAP tag indicates that the segment URL to which it applies 1230 does not contain media data and SHOULD NOT be loaded by clients. It 1231 applies only to the next Media Segment. 1233 Its format is: 1235 #EXT-X-GAP 1237 See Section 6.2.1 and Section 6.3.3 for more information on the EXT- 1238 X-GAP tag. 1240 4.4.4.8. EXT-X-BITRATE 1242 The EXT-X-BITRATE tag identifies the approximate segment bit rate of 1243 the Media Segment(s) to which it applies. It applies to every Media 1244 Segment between it and the next EXT-X-BITRATE tag in the Playlist 1245 file (or the end of the Playlist file) that does not have an EXT- 1246 X-BYTERANGE tag applied to it. Its format is: 1248 #EXT-X-BITRATE:<rate> 1250 where rate is a decimal-integer of kilobits per second. 1252 This tag is OPTIONAL. If it is present then its value MUST be no 1253 less than 90% of the segment bit rate of each Media Segment to which 1254 it is applied and no greater than 110% of the segment bit rate of 1255 each Media Segment to which it is applied. 1257 4.4.4.9. EXT-X-PART 1259 The EXT-X-PART tag identifies a Partial Segment. It is OPTIONAL. 1260 Its format is: 1262 #EXT-X-PART:<attribute-list> 1264 The following attributes are defined: 1266 URI 1268 The value is the URI for the Partial Segment. This attribute is 1269 REQUIRED. 1271 DURATION 1273 The value is the duration of the Partial Segment as a decimal- 1274 floating-point number of seconds. This attribute is REQUIRED. 1276 INDEPENDENT 1278 The value is an enumerated-string whose value is YES if the 1279 Partial Segment contains an independent frame. This attribute is 1280 OPTIONAL; however every Partial Segment containing an independent 1281 frame SHOULD carry it to increase the efficiency with which 1282 clients can join and switch Renditions. 1284 BYTERANGE 1286 Indicates that the Partial Segment is a subrange of the resource 1287 specified by the URI attribute. The value is a quoted-string 1288 whose contents have the same format as the EXT-X-BYTERANGE tag: 1289 "<n>[@<o>]". 1291 GAP 1293 The value is an enumerated-string whose value is YES if the 1294 Partial Segment is not available. It is REQUIRED for such Partial 1295 Segments. 1297 All Media Segment Tags (Section 4.4.4) except for EXT-X-BYTERANGE and 1298 EXT-X-GAP that are applied to a Parent Segment MUST appear before the 1299 first EXT-X-PART tag of that Parent Segment. 1301 The duration of a Partial Segment MUST be less than or equal to the 1302 Part Target Duration. The duration of each Partial Segment MUST be 1303 at least 85% of the Part Target Duration, with the exception of 1304 Partial Segments with the INDEPENDENT=YES attribute and the final 1305 Partial Segment of any Parent Segment. 1307 4.4.5. Media Metadata Tags 1309 Media Metadata tags provide information about the playlist that is 1310 not associated with specific Media Segments. There MAY be more than 1311 one Media Metadata tag of each type in any Media Playlist. The only 1312 exception to this rule is EXT-X-SKIP, which MUST NOT appear more than 1313 once. 1315 4.4.5.1. EXT-X-DATERANGE 1317 The EXT-X-DATERANGE tag associates a Date Range (i.e., a range of 1318 time defined by a starting and ending date) with a set of attribute/ 1319 value pairs. Its format is: 1321 #EXT-X-DATERANGE:<attribute-list> 1323 where the defined attributes are: 1325 ID 1327 A quoted-string that uniquely identifies a Date Range in the 1328 Playlist. This attribute is REQUIRED. 1330 CLASS 1332 A client-defined quoted-string that specifies some set of 1333 attributes and their associated value semantics. All Date Ranges 1334 with the same CLASS attribute value MUST adhere to these 1335 semantics. This attribute is OPTIONAL. 1337 START-DATE 1339 A quoted-string containing the [ISO_8601] date/time at which the 1340 Date Range begins. This attribute is REQUIRED. 1342 END-DATE 1344 A quoted-string containing the [ISO_8601] date/time at which the 1345 Date Range ends. It MUST be equal to or later than the value of 1346 the START-DATE attribute. This attribute is OPTIONAL. 1348 DURATION 1350 The duration of the Date Range expressed as a decimal-floating- 1351 point number of seconds. It MUST NOT be negative. A single 1352 instant in time (e.g., crossing a finish line) SHOULD be 1353 represented with a duration of 0. This attribute is OPTIONAL. 1355 PLANNED-DURATION 1357 The expected duration of the Date Range expressed as a decimal- 1358 floating-point number of seconds. It MUST NOT be negative. This 1359 attribute SHOULD be used to indicate the expected duration of a 1360 Date Range whose actual duration is not yet known. It is 1361 OPTIONAL. 1363 X-<client-attribute> 1365 The "X-" prefix defines a namespace reserved for client-defined 1366 attributes. The client-attribute MUST be a legal AttributeName. 1367 Clients SHOULD use a reverse-DNS syntax when defining their own 1368 attribute names to avoid collisions. The attribute value MUST be 1369 a quoted-string, a hexadecimal-sequence, or a decimal-floating- 1370 point. An example of a client-defined attribute is X-COM-EXAMPLE- 1371 AD-ID="XYZ123". These attributes are OPTIONAL. 1373 SCTE35-CMD, SCTE35-OUT, SCTE35-IN 1375 Used to carry SCTE-35 data; see Section 4.4.5.1.1 for more 1376 information. These attributes are OPTIONAL. 1378 END-ON-NEXT 1380 An enumerated-string whose value MUST be YES. This attribute 1381 indicates that the end of the range containing it is equal to the 1382 START-DATE of its Following Range. The Following Range is the 1383 Date Range of the same CLASS that has the earliest START-DATE 1384 after the START-DATE of the range in question. This attribute is 1385 OPTIONAL. 1387 An EXT-X-DATERANGE tag with an END-ON-NEXT=YES attribute MUST have a 1388 CLASS attribute. Other EXT-X-DATERANGE tags with the same CLASS 1389 attribute MUST NOT specify Date Ranges that overlap. 1391 An EXT-X-DATERANGE tag with an END-ON-NEXT=YES attribute MUST NOT 1392 contain DURATION or END-DATE attributes. 1394 A Date Range with neither a DURATION, an END-DATE, nor an END-ON- 1395 NEXT=YES attribute has an unknown duration, even if it has a PLANNED- 1396 DURATION. 1398 If a Playlist contains an EXT-X-DATERANGE tag, it MUST also contain 1399 at least one EXT-X-PROGRAM-DATE-TIME tag. 1401 If a Playlist contains two EXT-X-DATERANGE tags with the same ID 1402 attribute value, then any AttributeName that appears in both tags 1403 MUST have the same AttributeValue. 1405 If a Date Range contains both a DURATION attribute and an END-DATE 1406 attribute, the value of the END-DATE attribute MUST be equal to the 1407 value of the START-DATE attribute plus the value of the DURATION 1408 attribute. 1410 Clients SHOULD ignore EXT-X-DATERANGE tags with illegal syntax. 1412 4.4.5.1.1. Mapping SCTE-35 into EXT-X-DATERANGE 1414 Splice information carried in source media according to the SCTE-35 1415 specification [SCTE35] MAY be represented in a Media Playlist using 1416 EXT-X-DATERANGE tags. 1418 Each SCTE-35 splice_info_section() containing a splice_null(), 1419 splice_schedule(), bandwidth_reservation(), or private_cmd() SHOULD 1420 be represented by an EXT-X-DATERANGE tag with an SCTE35-CMD attribute 1421 whose value is the big-endian binary representation of the 1422 splice_info_section(), expressed as a hexadecimal-sequence. 1424 An SCTE-35 splice out/in pair signaled by a pair of splice_insert() 1425 commands SHOULD be represented by one or more EXT-X-DATERANGE tags 1426 carrying the same ID attribute, which MUST be unique to that splice 1427 out/in pair. The "out" splice_info_section() (with 1428 out_of_network_indicator set to 1) MUST be placed in an SCTE35-OUT 1429 attribute, with the same formatting as SCTE35-CMD. The "in" 1430 splice_info_section() (with out_of_network_indicator set to 0) MUST 1431 be placed in an SCTE35-IN attribute, with the same formatting as 1432 SCTE35-CMD. 1434 An SCTE-35 splice out/in pair signaled by a pair of time_signal() 1435 commands, each carrying a single segmentation_descriptor(), SHOULD be 1436 represented by one or more EXT-X-DATERANGE tags carrying the same ID 1437 attribute, which MUST be unique to that splice out/in pair. The 1438 "out" splice_info_section() MUST be placed in an SCTE35-OUT 1439 attribute; the "in" splice_info_section() MUST be placed in an 1440 SCTE35-IN attribute. 1442 Different types of segmentation, as indicated by the 1443 segmentation_type_id in the segmentation_descriptor(), SHOULD be 1444 represented by separate EXT-X-DATERANGE tags, even if two or more 1445 segmentation_descriptor()s arrive in the same splice_info_section(). 1446 In that case, each EXT-X-DATERANGE tag will have an SCTE35-OUT, 1447 SCTE35-IN, or SCTE35-CMD attribute whose value is the entire 1448 splice_info_section(). 1450 An SCTE-35 time_signal() command that does not signal a splice out or 1451 in point SHOULD be represented by an EXT-X-DATERANGE tag with an 1452 SCTE35-CMD attribute. 1454 The START-DATE of an EXT-X-DATERANGE tag containing an SCTE35-OUT 1455 attribute MUST be the date and time that corresponds to the program 1456 time of that splice. 1458 The START-DATE of an EXT-X-DATERANGE tag containing an SCTE35-CMD 1459 MUST be the date and time specified by the splice_time() in the 1460 command or the program time at which the command appeared in the 1461 source stream if the command does not specify a splice_time(). 1463 An EXT-X-DATERANGE tag containing an SCTE35-OUT attribute MAY contain 1464 a PLANNED-DURATION attribute. Its value MUST be the planned duration 1465 of the splice. 1467 The DURATION of an EXT-X-DATERANGE tag containing an SCTE35-IN 1468 attribute MUST be the actual (not planned) program duration between 1469 the corresponding out-point and that in-point. 1471 The END-DATE of an EXT-X-DATERANGE tag containing an SCTE35-IN 1472 attribute MUST be the actual (not planned) program date and time of 1473 that in-point. 1475 If the actual end date and time is not known when an SCTE35-OUT 1476 attribute is added to the Playlist, the DURATION attribute and the 1477 END-TIME attribute MUST NOT be present; the actual end date of the 1478 splice SHOULD be signaled by another EXT-X-DATERANGE tag once it has 1479 been established. 1481 A canceled splice SHOULD NOT appear in the Playlist as an EXT- 1482 X-DATERANGE tag. 1484 An EXT-X-DATERANGE tag announcing a splice SHOULD be added to a 1485 Playlist at the same time as the last pre-splice Media Segment, or 1486 earlier if possible. 1488 The ID attribute of an EXT-X-DATERANGE tag MAY contain a 1489 splice_event_id and/or a segmentation_event_id, but it MUST be unique 1490 in the Playlist. If there is a possibility that an SCTE-35 id will 1491 be reused, the ID attribute value MUST include disambiguation, such 1492 as a date or sequence number. 1494 4.4.5.2. EXT-X-SKIP 1496 A server produces a Playlist Delta Update (Section 6.2.5.1), by 1497 replacing tags earlier than the Skip Boundary with an EXT-X-SKIP tag. 1499 When replacing Media Segments, the EXT-X-SKIP tag replaces the 1500 segment URI lines and all Media Segment Tags tags that are applied to 1501 those segments. This tag MUST NOT appear more than once in a 1502 Playlist 1504 Its format is: 1506 #EXT-X-SKIP:<attribute-list> 1508 The following attributes are defined: 1510 SKIPPED-SEGMENTS 1512 The value is the count of Media Segments were replaced by the EXT- 1513 X-SKIP tag. This attribute is REQUIRED. 1515 RECENTLY-REMOVED-DATERANGES 1517 The value is a quoted-string consisting of a tab (0x9) delimited 1518 list of EXT-X-DATERANGE IDs that have been removed from the 1519 Playlist recently. See Section 6.2.5.1 for more information. 1520 This attribute is REQUIRED if the Client requested an update that 1521 skips EXT-X-DATERANGE tags. 1523 4.4.5.3. EXT-X-PRELOAD-HINT 1525 The EXT-X-PRELOAD-HINT tag allows a Client loading media from a live 1526 stream to reduce the time to obtain a resource from the Server by 1527 issuing its request before the resource is available to be delivered. 1528 The server will hold onto the request ("block") until it can respond. 1530 Its format is: 1532 #EXT-X-PRELOAD-HINT:<attribute-list> 1534 The following attributes are defined: 1536 TYPE 1538 The value is an enumerated-string that specifies the type of the 1539 hinted resource. If the value is PART, the resource is a Partial 1540 Segment. If the value is MAP, the resource is a Media 1541 Initialization Section. This attribute is REQUIRED. 1543 URI 1545 The value is a URI identifying the hinted resource. It MUST match 1546 the URI that will be subsequently added to the Playlist as a non- 1547 hinted resource (for example, the URI of an EXT-X-PART tag). The 1548 URI MAY be relative to the URI of the Playlist or it MAY be 1549 absolute. The hostname MAY differ from the hostname of the 1550 Playlist URI. This attribute is REQUIRED. 1552 BYTERANGE-START 1554 The value is the byte offset of the first byte of the hinted 1555 resource, from the beginning of the resource identified by the URI 1556 attribute. This attribute is OPTIONAL. Its absence implies a 1557 value of 0. 1559 BYTERANGE-LENGTH 1561 The value is the length of the hinted resource. This attribute is 1562 OPTIONAL. Its absence indicates that the last byte of the hinted 1563 resource is the last byte of the resource identified by the URI 1564 attribute. 1566 Note that when a hinted Partial Segment eventually appears in the 1567 Playlist as an EXT-X-PART tag, it MAY have a different Discontinuity 1568 Sequence Number, Media Initialization Section, or encryption 1569 configuration. In other words, the Partial Segment can be preceded 1570 by an EXTINF tag indicating the end of the previous Parent Segment 1571 and an EXT-X-DISCONTINUITY, EXT-X-MAP, or EXT-X-KEY tag. 1573 A Playlist containing an EXT-X-ENDLIST tag MUST NOT contain an EXT-X- 1574 PRELOAD-HINT tag. 1576 4.4.5.4. EXT-X-RENDITION-REPORT 1578 The EXT-X-RENDITION-REPORT tag carries information about an 1579 associated Rendition that is as up-to-date as the Playlist that 1580 contains it. Its format is: 1582 #EXT-X-RENDITION-REPORT:<attribute-list> 1584 The following attributes are defined: 1586 URI 1588 The value is the URI for the Media Playlist of the specified 1589 Rendition. It MUST be relative to the URI of the Media Playlist 1590 containing the EXT-X-RENDITION-REPORT tag. This attribute is 1591 REQUIRED. 1593 LAST-MSN 1595 The value is a decimal-integer specifying the Media Sequence 1596 Number of the last Media Segment currently in the specified 1597 Rendition. If the Rendition contains Partial Segments then this 1598 value is the Media Sequence Number of the last Partial Segment. 1599 This attribute is REQUIRED. 1601 LAST-PART 1603 The value is a decimal-integer that indicates the Part Index of 1604 the last Partial Segment currently in the specified Rendition 1605 whose Media Sequence Number is equal to the LAST-MSN attribute 1606 value. This attribute is REQUIRED if the Rendition contains a 1607 Partial Segment. 1609 A server MAY omit adding an attribute to an EXT-X-RENDITION-REPORT 1610 tag - even a mandatory attribute - if its value is the same as that 1611 of the Rendition Report of the Media Playlist to which the EXT-X- 1612 RENDITION-REPORT tag is being added. Doing so reduces the size of 1613 the Rendition Report. 1615 4.4.6. Master Playlist Tags 1617 Master Playlist tags define the Variant Streams, Renditions, and 1618 other global parameters of the presentation. 1620 Master Playlist tags MUST NOT appear in a Media Playlist; clients 1621 MUST fail to parse any Playlist that contains both a Master Playlist 1622 tag and either a Media Playlist tag or a Media Segment tag. 1624 4.4.6.1. EXT-X-MEDIA 1626 The EXT-X-MEDIA tag is used to relate Media Playlists that contain 1627 alternative Renditions (Section 4.4.6.2.1) of the same content. For 1628 example, three EXT-X-MEDIA tags can be used to identify audio-only 1629 Media Playlists that contain English, French, and Spanish Renditions 1630 of the same presentation. Or, two EXT-X-MEDIA tags can be used to 1631 identify video-only Media Playlists that show two different camera 1632 angles. 1634 Its format is: 1636 #EXT-X-MEDIA:<attribute-list> 1637 The following attributes are defined: 1639 TYPE 1641 The value is an enumerated-string; valid strings are AUDIO, VIDEO, 1642 SUBTITLES, and CLOSED-CAPTIONS. This attribute is REQUIRED. 1644 Typically, closed-caption [CEA608] media is carried in the video 1645 stream. Therefore, an EXT-X-MEDIA tag with TYPE of CLOSED- 1646 CAPTIONS does not specify a Rendition; the closed-caption media is 1647 present in the Media Segments of every video Rendition. 1649 URI 1651 The value is a quoted-string containing a URI that identifies the 1652 Media Playlist file. This attribute is OPTIONAL; see 1653 Section 4.4.6.2.1. If the TYPE is CLOSED-CAPTIONS, the URI 1654 attribute MUST NOT be present. 1656 GROUP-ID 1658 The value is a quoted-string that specifies the group to which the 1659 Rendition belongs. See Section 4.4.6.1.1. This attribute is 1660 REQUIRED. 1662 LANGUAGE 1664 The value is a quoted-string containing one of the standard Tags 1665 for Identifying Languages [RFC5646], which identifies the primary 1666 language used in the Rendition. This attribute is OPTIONAL. 1668 ASSOC-LANGUAGE 1670 The value is a quoted-string containing a language tag [RFC5646] 1671 that identifies a language that is associated with the Rendition. 1672 An associated language is often used in a different role than the 1673 language specified by the LANGUAGE attribute (e.g., written versus 1674 spoken, or a fallback dialect). This attribute is OPTIONAL. 1676 The LANGUAGE and ASSOC-LANGUAGE attributes can be used, for 1677 example, to link Norwegian Renditions that use different spoken 1678 and written languages. 1680 NAME 1682 The value is a quoted-string containing a human-readable 1683 description of the Rendition. If the LANGUAGE attribute is 1684 present, then this description SHOULD be in that language. This 1685 attribute is REQUIRED. 1687 STABLE-RENDITION-ID 1689 The value is a quoted-string which is a stable identifier for the 1690 URI within the Master Playlist. All characters in the quoted- 1691 string MUST be from the following set: [a..z], [A..Z], [0..9], 1692 '+', '/', '=', '.', '-', and '_'. This attribute is OPTIONAL. 1694 The STABLE-RENDITION-ID allows the URI of a Rendition to change 1695 between two distinct downloads of the Master Playlist. IDs are 1696 matched using a byte-for-byte comparison. 1698 DEFAULT 1700 The value is an enumerated-string; valid strings are YES and NO. 1701 If the value is YES, then the client SHOULD play this Rendition of 1702 the content in the absence of information from the user indicating 1703 a different choice. This attribute is OPTIONAL. Its absence 1704 indicates an implicit value of NO. 1706 AUTOSELECT 1708 The value is an enumerated-string; valid strings are YES and NO. 1709 This attribute is OPTIONAL. Its absence indicates an implicit 1710 value of NO. If the value is YES, then the client MAY choose to 1711 play this Rendition in the absence of explicit user preference 1712 because it matches the current playback environment, such as 1713 chosen system language. 1715 If the AUTOSELECT attribute is present, its value MUST be YES if 1716 the value of the DEFAULT attribute is YES. 1718 FORCED 1720 The value is an enumerated-string; valid strings are YES and NO. 1721 This attribute is OPTIONAL. Its absence indicates an implicit 1722 value of NO. The FORCED attribute MUST NOT be present unless the 1723 TYPE is SUBTITLES. 1725 A value of YES indicates that the Rendition contains content that 1726 is considered essential to play. When selecting a FORCED 1727 Rendition, a client SHOULD choose the one that best matches the 1728 current playback environment (e.g., language). 1730 A value of NO indicates that the Rendition contains content that 1731 is intended to be played in response to explicit user request. 1733 INSTREAM-ID 1735 The value is a quoted-string that specifies a Rendition within the 1736 segments in the Media Playlist. This attribute is REQUIRED if the 1737 TYPE attribute is CLOSED-CAPTIONS, in which case it MUST have one 1738 of the values: "CC1", "CC2", "CC3", "CC4", or "SERVICEn" where n 1739 MUST be an integer between 1 and 63 (e.g., "SERVICE9" or 1740 "SERVICE42"). 1742 The values "CC1", "CC2", "CC3", and "CC4" identify a Line 21 Data 1743 Services channel [CEA608]. The "SERVICE" values identify a 1744 Digital Television Closed Captioning [CEA708] service block 1745 number. 1747 For all other TYPE values, the INSTREAM-ID MUST NOT be specified. 1749 CHARACTERISTICS 1751 The value is a quoted-string containing one or more Media 1752 Characteristic Tags (MCTs) separated by comma (,) characters. A 1753 Media Characteristic Tag has the same format as the payload of a 1754 media characteristic tag atom [MCT] This attribute is OPTIONAL. 1755 Each MCT indicates an individual characteristic of the Rendition. 1757 A SUBTITLES Rendition MAY include the following characteristics: 1758 "public.accessibility.transcribes-spoken-dialog", 1759 "public.accessibility.describes-music-and-sound", and 1760 "public.easy-to-read" (which indicates that the subtitles have 1761 been edited for ease of reading). 1763 An AUDIO Rendition MAY include the following characteristic: 1764 "public.accessibility.describes-video". 1766 The CHARACTERISTICS attribute MAY include private MCTs. 1768 CHANNELS 1770 The value is a quoted-string that specifies an ordered, slash- 1771 separated ("/") list of parameters. 1773 If the TYPE attribute is AUDIO, then the first parameter is a 1774 count of audio channels expressed as a decimal-integer, indicating 1775 the maximum number of independent, simultaneous audio channels 1776 present in any Media Segment in the Rendition. For example, an 1777 AC-3 5.1 Rendition would have a CHANNELS="6" attribute. 1779 If the TYPE attribute is AUDIO, then the second parameter 1780 identifies the encoding of object-based audio used by the 1781 Rendition. This parameter is a comma-separated list of Audio 1782 Object Coding Identifiers. It is optional. An Audio Object 1783 Coding Identifier is a string containing characters from the set 1784 [A..Z], [0..9], and '-'. They are codec-specific. A parameter 1785 value of consisting solely of the dash character (0x2D) indicates 1786 that the audio is not object-based. 1788 No other CHANNELS parameters are currently defined. 1790 All audio EXT-X-MEDIA tags SHOULD have a CHANNELS attribute. If a 1791 Master Playlist contains two Renditions with the same NAME encoded 1792 with the same codec but a different number of channels, then the 1793 CHANNELS attribute is REQUIRED; otherwise, it is OPTIONAL. 1795 4.4.6.1.1. Rendition Groups 1797 A set of one or more EXT-X-MEDIA tags with the same GROUP-ID value 1798 and the same TYPE value defines a Group of Renditions. Each member 1799 of the Group MUST be an alternative Rendition of the same content; 1800 otherwise, playback errors can occur. 1802 All EXT-X-MEDIA tags in a Playlist MUST meet the following 1803 constraints: 1805 o All EXT-X-MEDIA tags in the same Group MUST have different NAME 1806 attributes. 1808 o A Group MUST NOT have more than one member with a DEFAULT 1809 attribute of YES. 1811 o Each EXT-X-MEDIA tag with an AUTOSELECT=YES attribute SHOULD have 1812 a combination of LANGUAGE [RFC5646], ASSOC-LANGUAGE, FORCED, and 1813 CHARACTERISTICS attributes that is distinct from those of other 1814 AUTOSELECT=YES members of its Group. 1816 A Playlist MAY contain multiple Groups of the same TYPE in order to 1817 provide multiple encodings of that media type. If it does so, each 1818 Group of the same TYPE MUST have the same set of members, and each 1819 corresponding member MUST have identical attributes with the 1820 exception of the URI and CHANNELS attributes. 1822 Each member in a Group of Renditions MAY have a different sample 1823 format. For example, an English Rendition can be encoded with AC-3 1824 5.1 while a Spanish Rendition is encoded with AAC stereo. However, 1825 any EXT-X-STREAM-INF tag (Section 4.4.6.2) or EXT-X-I-FRAME-STREAM- 1826 INF tag (Section 4.4.6.3) that references such a Group MUST have a 1827 CODECS attribute that lists every sample format present in any 1828 Rendition in the Group, or client playback failures can occur. In 1829 the example above, the CODECS attribute would include 1830 "ac-3,mp4a.40.2". 1832 4.4.6.2. EXT-X-STREAM-INF 1834 The EXT-X-STREAM-INF tag specifies a Variant Stream, which is a set 1835 of Renditions that can be combined to play the presentation. The 1836 attributes of the tag provide information about the Variant Stream. 1838 The URI line that follows the EXT-X-STREAM-INF tag specifies a Media 1839 Playlist that carries a Rendition of the Variant Stream. The URI 1840 line is REQUIRED. Clients that do not support multiple video 1841 Renditions SHOULD play this Rendition. 1843 Its format is: 1845 #EXT-X-STREAM-INF:<attribute-list> 1846 <URI> 1848 The following attributes are defined: 1850 BANDWIDTH 1852 The value is a decimal-integer of bits per second. It represents 1853 the peak segment bit rate of the Variant Stream. 1855 If all the Media Segments in a Variant Stream have already been 1856 created, the BANDWIDTH value MUST be the largest sum of peak 1857 segment bit rates that is produced by any playable combination of 1858 Renditions. (For a Variant Stream with a single Media Playlist, 1859 this is just the peak segment bit rate of that Media Playlist.) 1860 An inaccurate value can cause playback stalls or prevent clients 1861 from playing the variant. 1863 If the Master Playlist is to be made available before all Media 1864 Segments in the presentation have been encoded, the BANDWIDTH 1865 value SHOULD be the BANDWIDTH value of a representative period of 1866 similar content, encoded using the same settings. 1868 Every EXT-X-STREAM-INF tag MUST include the BANDWIDTH attribute. 1870 AVERAGE-BANDWIDTH 1872 The value is a decimal-integer of bits per second. It represents 1873 the average segment bit rate of the Variant Stream. 1875 If all the Media Segments in a Variant Stream have already been 1876 created, the AVERAGE-BANDWIDTH value MUST be the largest sum of 1877 average segment bit rates that is produced by any playable 1878 combination of Renditions. (For a Variant Stream with a single 1879 Media Playlist, this is just the average segment bit rate of that 1880 Media Playlist.) An inaccurate value can cause playback stalls or 1881 prevent clients from playing the variant. 1883 If the Master Playlist is to be made available before all Media 1884 Segments in the presentation have been encoded, the AVERAGE- 1885 BANDWIDTH value SHOULD be the AVERAGE-BANDWIDTH value of a 1886 representative period of similar content, encoded using the same 1887 settings. 1889 The AVERAGE-BANDWIDTH attribute is OPTIONAL. 1891 SCORE 1893 The value is a positive decimal-floating-point number. It is an 1894 abstract, relative measure of the playback quality-of-experience 1895 of the Variant Stream. 1897 The value can be based on any metric or combination of metrics 1898 that can be consistently applied to all Variant Streams. The 1899 value SHOULD consider all media in the Variant Stream, including 1900 video, audio and subtitles. A Variant Stream with a SCORE 1901 attribute MUST be considered by the Playlist author to be more 1902 desirable than any Variant Stream with a lower SCORE attribute in 1903 the same Master Playlist. 1905 The SCORE attribute is OPTIONAL, but if any Variant Stream 1906 contains the SCORE attribute, then all Variant Streams in the 1907 Master Playlist SHOULD have a SCORE attribute. See Section 6.3.1 1908 for more information. 1910 CODECS 1912 The value is a quoted-string containing a comma-separated list of 1913 formats, where each format specifies a media sample type that is 1914 present in one or more Renditions specified by the Variant Stream. 1915 Valid format identifiers are those in the ISO Base Media File 1916 Format Name Space defined by "The 'Codecs' and 'Profiles' 1917 Parameters for "Bucket" Media Types" [RFC6381]. 1919 For example, a stream containing AAC low complexity (AAC-LC) audio 1920 and H.264 Main Profile Level 3.0 video would have a CODECS value 1921 of "mp4a.40.2,avc1.4d401e". 1923 Note that if a Variant Stream specifies one or more Renditions 1924 that include IMSC subtitles, the CODECS attribute MUST indicate 1925 this with a format identifier such as "stpp.ttml.im1t". 1927 Every EXT-X-STREAM-INF tag SHOULD include a CODECS attribute. 1929 RESOLUTION 1931 The value is a decimal-resolution describing the optimal pixel 1932 resolution at which to display all the video in the Variant 1933 Stream. 1935 The RESOLUTION attribute is OPTIONAL but is recommended if the 1936 Variant Stream includes video. 1938 FRAME-RATE 1940 The value is a decimal-floating-point describing the maximum frame 1941 rate for all the video in the Variant Stream, rounded to three 1942 decimal places. 1944 The FRAME-RATE attribute is OPTIONAL but is recommended if the 1945 Variant Stream includes video. The FRAME-RATE attribute SHOULD be 1946 included if any video in a Variant Stream exceeds 30 frames per 1947 second. 1949 HDCP-LEVEL 1951 The value is an enumerated-string; valid strings are TYPE-0, TYPE- 1952 1, and NONE. This attribute is advisory. A value of TYPE-0 1953 indicates that the Variant Stream could fail to play unless the 1954 output is protected by High-bandwidth Digital Content Protection 1955 (HDCP) Type 0 [HDCP] or equivalent. A value of TYPE-1 indicates 1956 that the Variant Stream could fail to play unless the output is 1957 protected by HDCP Type 1 or equivalent. A value of NONE indicates 1958 that the content does not require output copy protection. 1960 Encrypted Variant Streams with different HDCP levels SHOULD use 1961 different media encryption keys. 1963 The HDCP-LEVEL attribute is OPTIONAL. It SHOULD be present if any 1964 content in the Variant Stream will fail to play without HDCP. 1965 Clients without output copy protection SHOULD NOT load a Variant 1966 Stream with an HDCP-LEVEL attribute unless its value is NONE. 1968 ALLOWED-CPC 1969 The ALLOWED-CPC attribute allows a server to indicate that the 1970 playback of a Variant Stream containing encrypted Media Segments 1971 is to be restricted to devices that guarantee a certain level of 1972 content protection robustness. Its value is a quoted-string 1973 containing a comma-separated list of entries. Each entry consists 1974 of a KEYFORMAT attribute value followed by a colon character (:) 1975 followed by a sequence of Content Protection Configuration (CPC) 1976 Labels separated by slash (/) characters. Each CPC Label is a 1977 string containing characters from the set [A..Z], [0..9], and '-'. 1979 For example: ALLOWED-CPC="com.example.drm1:SMART-TV/PC, 1980 com.example.drm2:HW" 1982 A CPC Label identifies a class of playback device that implements 1983 the KEYFORMAT with a certain level of content protection 1984 robustness. Each KEYFORMAT can define its own set of CPC Labels. 1985 The "identity" KEYFORMAT does not define any labels. A KEYFORMAT 1986 that defines CPC Labels SHOULD also specify its robustness 1987 requirements in a secure manner in each key response. 1989 A client MAY play the Variant Stream if it implements one of the 1990 listed KEYFORMAT schemes with content protection robustness that 1991 matches one or more of the CPC Labels in the list. If it does not 1992 match any of the CPC Labels then it SHOULD NOT attempt to play the 1993 Variant Stream. 1995 The ALLOWED-CPC attribute is OPTIONAL. If it is not present or 1996 does not contain a particular KEYFORMAT then all clients that 1997 support that KEYFORMAT MAY play the Variant Stream. 1999 VIDEO-RANGE 2001 The value is an enumerated-string; valid strings are SDR, HLG and 2002 PQ. 2004 The value MUST be SDR if the video in the Variant Stream is 2005 encoded using one of the following reference opto-electronic 2006 transfer characteristic functions specified by the 2007 TransferCharacteristics code point: [CICP] 1, 6, 13, 14, 15. Note 2008 that different TransferCharacteristics code points can use the 2009 same transfer function. 2011 The value MUST be HLG if the video in the Variant Stream is 2012 encoded using a reference opto-electronic transfer characteristic 2013 function specified by the TransferCharacteristics code point 18, 2014 or consists of such video mixed with video qualifying as SDR (see 2015 above). 2017 The value MUST be PQ if the video in the Variant Stream is encoded 2018 using a reference opto-electronic transfer characteristic function 2019 specified by the TransferCharacteristics code point 16, or 2020 consists of such video mixed with video qualifying as SDR or HLG 2021 (see above). 2023 This attribute is OPTIONAL. Its absence implies a value of SDR. 2024 Clients that do not recognize the attribute value SHOULD NOT 2025 select the Variant Stream. 2027 STABLE-VARIANT-ID 2029 The value is a quoted-string which is a stable identifier for the 2030 URI within the Master Playlist. All characters in the quoted- 2031 string MUST be from the following set: [a..z], [A..Z], [0..9], 2032 '+', '/', '=', '.', '-', and '_'. This attribute is OPTIONAL. 2034 The STABLE-VARIANT-ID allows the URI of the Variant Stream to 2035 change between two distinct downloads of the Master Playlist. IDs 2036 are matched using a byte-for-byte comparison. 2038 AUDIO 2040 The value is a quoted-string. It MUST match the value of the 2041 GROUP-ID attribute of an EXT-X-MEDIA tag elsewhere in the Master 2042 Playlist whose TYPE attribute is AUDIO. It indicates the set of 2043 audio Renditions that SHOULD be used when playing the 2044 presentation. See Section 4.4.6.2.1. 2046 The AUDIO attribute is OPTIONAL. 2048 VIDEO 2050 The value is a quoted-string. It MUST match the value of the 2051 GROUP-ID attribute of an EXT-X-MEDIA tag elsewhere in the Master 2052 Playlist whose TYPE attribute is VIDEO. It indicates the set of 2053 video Renditions that SHOULD be used when playing the 2054 presentation. See Section 4.4.6.2.1. 2056 The VIDEO attribute is OPTIONAL. 2058 SUBTITLES 2060 The value is a quoted-string. It MUST match the value of the 2061 GROUP-ID attribute of an EXT-X-MEDIA tag elsewhere in the Master 2062 Playlist whose TYPE attribute is SUBTITLES. It indicates the set 2063 of subtitle Renditions that can be used when playing the 2064 presentation. See Section 4.4.6.2.1. 2066 The SUBTITLES attribute is OPTIONAL. 2068 CLOSED-CAPTIONS 2070 The value can be either a quoted-string or an enumerated-string 2071 with the value NONE. If the value is a quoted-string, it MUST 2072 match the value of the GROUP-ID attribute of an EXT-X-MEDIA tag 2073 elsewhere in the Playlist whose TYPE attribute is CLOSED-CAPTIONS, 2074 and it indicates the set of closed-caption Renditions that can be 2075 used when playing the presentation. See Section 4.4.6.2.1. 2077 If the value is the enumerated-string value NONE, all EXT-X- 2078 STREAM-INF tags MUST have this attribute with a value of NONE, 2079 indicating that there are no closed captions in any Variant Stream 2080 in the Master Playlist. Having closed captions in one Variant 2081 Stream but not another can trigger playback inconsistencies. 2083 The CLOSED-CAPTIONS attribute is OPTIONAL. 2085 4.4.6.2.1. Alternative Renditions 2087 When an EXT-X-STREAM-INF tag contains an AUDIO, VIDEO, SUBTITLES, or 2088 CLOSED-CAPTIONS attribute, it indicates that alternative Renditions 2089 of the content are available for playback of that Variant Stream. 2091 When defining alternative Renditions, the following constraints MUST 2092 be met to prevent client playback errors: 2094 o All playable combinations of Renditions associated with an EXT-X- 2095 STREAM-INF tag MUST have an aggregate bandwidth less than or equal 2096 to the BANDWIDTH attribute of the EXT-X-STREAM-INF tag. 2098 o If an EXT-X-STREAM-INF tag contains a RESOLUTION attribute and a 2099 VIDEO attribute, then every alternative video Rendition MUST have 2100 an optimal display resolution matching the value of the RESOLUTION 2101 attribute. 2103 o Every alternative Rendition associated with an EXT-X-STREAM-INF 2104 tag MUST meet the constraints for a Variant Stream described in 2105 Section 6.2.4. 2107 The URI attribute of the EXT-X-MEDIA tag is REQUIRED if the media 2108 type is SUBTITLES, but OPTIONAL if the media type is VIDEO or AUDIO. 2109 If the media type is VIDEO or AUDIO, a missing URI attribute 2110 indicates that the media data for this Rendition is included in the 2111 Media Playlist of any EXT-X-STREAM-INF tag referencing this EXT- 2112 X-MEDIA tag. If the media TYPE is AUDIO and the URI attribute is 2113 missing, clients MUST assume that the audio data for this Rendition 2114 is present in every video Rendition specified by the EXT-X-STREAM-INF 2115 tag. 2117 The URI attribute of the EXT-X-MEDIA tag MUST NOT be included if the 2118 media type is CLOSED-CAPTIONS. 2120 4.4.6.3. EXT-X-I-FRAME-STREAM-INF 2122 The EXT-X-I-FRAME-STREAM-INF tag identifies a Media Playlist file 2123 containing the I-frames of a multimedia presentation. It stands 2124 alone, in that it does not apply to a particular URI in the Master 2125 Playlist. Its format is: 2127 #EXT-X-I-FRAME-STREAM-INF:<attribute-list> 2129 All attributes defined for the EXT-X-STREAM-INF tag (Section 4.4.6.2) 2130 are also defined for the EXT-X-I-FRAME-STREAM-INF tag, except for the 2131 FRAME-RATE, AUDIO, SUBTITLES, and CLOSED-CAPTIONS attributes. In 2132 addition, the following attribute is defined: 2134 URI 2136 The value is a quoted-string containing a URI that identifies the 2137 I-frame Media Playlist file. That Playlist file MUST contain an 2138 EXT-X-I-FRAMES-ONLY tag. 2140 Every EXT-X-I-FRAME-STREAM-INF tag MUST include a BANDWIDTH attribute 2141 and a URI attribute. 2143 The provisions in Section 4.4.6.2.1 also apply to EXT-X-I-FRAME- 2144 STREAM-INF tags with a VIDEO attribute. 2146 A Master Playlist that specifies alternative VIDEO Renditions and 2147 I-frame Playlists SHOULD include an alternative I-frame VIDEO 2148 Rendition for each regular VIDEO Rendition, with the same NAME and 2149 LANGUAGE attributes. 2151 4.4.6.4. EXT-X-SESSION-DATA 2153 The EXT-X-SESSION-DATA tag allows arbitrary session data to be 2154 carried in a Master Playlist. 2156 Its format is: 2158 #EXT-X-SESSION-DATA:<attribute-list> 2160 The following attributes are defined: 2162 DATA-ID 2164 The value of DATA-ID is a quoted-string that identifies a 2165 particular data value. The DATA-ID SHOULD conform to a reverse 2166 DNS naming convention, such as "com.example.movie.title"; however, 2167 there is no central registration authority, so Playlist authors 2168 SHOULD take care to choose a value that is unlikely to collide 2169 with others. This attribute is REQUIRED. 2171 VALUE 2173 VALUE is a quoted-string. It contains the data identified by 2174 DATA-ID. If the LANGUAGE is specified, VALUE SHOULD contain a 2175 human-readable string written in the specified language. 2177 URI 2179 The value is a quoted-string containing a URI. The resource 2180 identified by the URI MUST be formatted as JSON [RFC8259]; 2181 otherwise, clients may fail to interpret the resource. 2183 LANGUAGE 2185 The value is a quoted-string containing a language tag [RFC5646] 2186 that identifies the language of the VALUE. This attribute is 2187 OPTIONAL. 2189 Each EXT-X-SESSION-DATA tag MUST contain either a VALUE or URI 2190 attribute, but not both. 2192 A Playlist MAY contain multiple EXT-X-SESSION-DATA tags with the same 2193 DATA-ID attribute. A Playlist MUST NOT contain more than one EXT-X- 2194 SESSION-DATA tag with the same DATA-ID attribute and the same 2195 LANGUAGE attribute. 2197 4.4.6.5. EXT-X-SESSION-KEY 2199 The EXT-X-SESSION-KEY tag allows encryption keys from Media Playlists 2200 to be specified in a Master Playlist. This allows the client to 2201 preload these keys without having to read the Media Playlist(s) 2202 first. 2204 Its format is: 2206 #EXT-X-SESSION-KEY:<attribute-list> 2208 All attributes defined for the EXT-X-KEY tag (Section 4.4.4.4) are 2209 also defined for the EXT-X-SESSION-KEY, except that the value of the 2210 METHOD attribute MUST NOT be NONE. If an EXT-X-SESSION-KEY is used, 2211 the values of the METHOD, KEYFORMAT, and KEYFORMATVERSIONS attributes 2212 MUST match any EXT-X-KEY with the same URI value. 2214 EXT-X-SESSION-KEY tags SHOULD be added if multiple Variant Streams or 2215 Renditions use the same encryption keys and formats. An EXT-X- 2216 SESSION-KEY tag is not associated with any particular Media Playlist. 2218 A Master Playlist MUST NOT contain more than one EXT-X-SESSION-KEY 2219 tag with the same METHOD, URI, IV, KEYFORMAT, and KEYFORMATVERSIONS 2220 attribute values. 2222 The EXT-X-SESSION-KEY tag is optional. 2224 5. Key Files 2226 5.1. Structure of Key Files 2228 An EXT-X-KEY tag with a URI attribute identifies a Key file. A Key 2229 file contains a cipher key that can decrypt Media Segments in the 2230 Playlist. 2232 [AES_128] encryption uses 16-octet keys. If the KEYFORMAT of an EXT- 2233 X-KEY tag is "identity", the Key file is a single packed array of 16 2234 octets in binary format. 2236 5.2. IV for AES-128 2238 [AES_128] REQUIRES the same 16-octet IV to be supplied when 2239 encrypting and decrypting. Varying this IV increases the strength of 2240 the cipher. 2242 An IV attribute on an EXT-X-KEY tag with a KEYFORMAT of "identity" 2243 specifies an IV that can be used when decrypting Media Segments 2244 encrypted with that Key file. IV values for AES-128 are 128-bit 2245 numbers. 2247 An EXT-X-KEY tag with a KEYFORMAT of "identity" that does not have an 2248 IV attribute indicates that the Media Sequence Number is to be used 2249 as the IV when decrypting a Media Segment, by putting its big-endian 2250 binary representation into a 16-octet (128-bit) buffer and padding 2251 (on the left) with zeros. 2253 6. Client/Server Responsibilities 2254 6.1. Introduction 2256 This section describes how the server generates the Playlist and 2257 Media Segments and how the client should download them for playback. 2259 6.2. Server Responsibilities 2261 6.2.1. General Server Responsibilities 2263 The production of the source media is outside the scope of this 2264 document, which simply presumes a source of continuous encoded media 2265 containing the presentation. 2267 The server MUST divide the source media into individual Media 2268 Segments whose duration (when rounded to a whole second) is less than 2269 or equal to the Target Duration. Segments longer than that can 2270 trigger playback stalls and other errors. 2272 The server SHOULD attempt to divide the source media at points that 2273 support effective decode of individual Media Segments, such as on 2274 packet and key frame boundaries. 2276 The server MUST create a URI for every Media Segment that enables its 2277 clients to obtain the segment data. If a server supports partial 2278 loading of resources (e.g., via HTTP Range requests), it MAY specify 2279 segments as sub-ranges of larger resources using the EXT-X-BYTERANGE 2280 tag. 2282 The absence of media data (due to, for example, the temporary 2283 unavailability of an encoder) SHOULD be signaled by adding one or 2284 more Media Segments to the Playlist whose Segment durations add up to 2285 the duration of absent media; these Media Segments MUST have EXT- 2286 X-GAP tags applied to them. Similarly, such Partial Segments MUST 2287 have a GAP=YES attribute. Attempting to download these segments MAY 2288 produce an error, such as HTTP 404 or 410. 2290 A Media Segment MUST be available for immediate download at the full 2291 speed of the link to the Client when it is added to a Playlist unless 2292 it has been marked with an EXT-X-GAP tag; otherwise playback errors 2293 can occur. Once download starts, its transfer rate SHOULD NOT be 2294 constrained by the segment production process. 2296 A Partial Segment MUST be similarly available at the time it is added 2297 to a Playlist. 2299 HTTP servers SHOULD transfer text files -- such as Playlists and 2300 WebVTT segments -- using the "gzip" Content-Encoding if the client 2301 indicates that it is prepared to accept it. 2303 The server must create a Media Playlist file (Section 4) that 2304 contains a URI for each Media Segment that the server wishes to make 2305 available, in the order in which they are to be played. 2307 The value of the EXT-X-VERSION tag (Section 4.4.1.2) SHOULD NOT be 2308 greater than what is required for the tags and attributes in the 2309 Playlist (see Section 7). 2311 Changes to the Playlist file MUST be made atomically from the point 2312 of view of the clients, or playback errors MAY occur. 2314 The server MUST NOT change the Media Playlist file, except to: 2316 Append lines to it (Section 6.2.1). 2318 Remove Media Segment URIs from the Playlist in the order that they 2319 appear, along with any tags that apply only to those segments 2320 (Section 6.2.2). 2322 Remove Media Metadata tags that no longer apply to the 2323 presentation (Section 6.2.1). 2325 Remove EXT-X-PART tags no longer at the live edge (Section 6.2.2). 2327 Increment the value of the EXT-X-MEDIA-SEQUENCE or EXT-X- 2328 DISCONTINUITY-SEQUENCE tags (Section 6.2.2). 2330 Add an EXT-X-ENDLIST tag to the Playlist (Section 6.2.1). 2332 A Media Playlist has further constraints on its updates if it 2333 contains an EXT-X-PLAYLIST-TYPE tag. An EXT-X-PLAYLIST-TYPE tag with 2334 a value of VOD indicates that the Playlist file MUST NOT change. An 2335 EXT-X-PLAYLIST-TYPE tag with a value of EVENT indicates that the 2336 Server MUST NOT change or remove any part of the Playlist file, with 2337 the exception of EXT-X-PART tags and Media Metadata tags as described 2338 above; the Server MAY append lines to the Playlist. 2340 The value of the EXT-X-TARGETDURATION tag in the Media Playlist MUST 2341 NOT change. A typical Target Duration is 6 seconds. 2343 Playlist changes other than those allowed here can trigger playback 2344 errors and inconsistent client behavior. 2346 Each Media Segment in a Media Playlist has an integer Discontinuity 2347 Sequence Number. The Discontinuity Sequence Number can be used in 2348 addition to the timestamps within the media to synchronize Media 2349 Segments across different Renditions. 2351 A segment's Discontinuity Sequence Number is the value of the EXT-X- 2352 DISCONTINUITY-SEQUENCE tag (or zero if none) plus the number of EXT- 2353 X-DISCONTINUITY tags in the Playlist preceding the URI line of the 2354 segment. 2356 The server MAY associate an absolute date and time with a Media 2357 Segment by applying an EXT-X-PROGRAM-DATE-TIME tag to it. This 2358 defines an informative mapping of the (wall-clock) date and time 2359 specified by the tag to the first media timestamp in the segment, 2360 which may be used as a basis for seeking, for display, or for other 2361 purposes. If a server provides this mapping, it SHOULD apply an EXT- 2362 X-PROGRAM-DATE-TIME tag to every segment that has an EXT- 2363 X-DISCONTINUITY tag applied to it. 2365 The Server MUST NOT add any EXT-X-PROGRAM-DATE-TIME tag to a Playlist 2366 that would cause the mapping between program date and Media Segment 2367 to become ambiguous. 2369 When applied to live content, a reasonable default for the EXT-X- 2370 PROGRAM-DATE-TIME tag is the date and time that the content was 2371 captured (recorded). 2373 The server MUST NOT remove an EXT-X-DATERANGE tag from a Playlist if 2374 any date in the range maps to a Media Segment in the Playlist. 2376 The server MUST NOT reuse the ID attribute value of an EXT- 2377 X-DATERANGE tag for any new Date Range in the same Playlist. 2379 Once the Following Range of a Date Range with an END-ON-NEXT=YES 2380 attribute is added to a Playlist, the Server MUST NOT subsequently 2381 add a Date Range with the same CLASS attribute whose START-DATE is 2382 between that of the END-ON-NEXT=YES range and its Following Range. 2384 For Date Ranges with a PLANNED-DURATION attribute, the Server SHOULD 2385 signal the actual end of the range once it has been established. It 2386 can do so by adding another EXT-X-DATERANGE tag with the same ID 2387 attribute value and either a DURATION or an END-DATE attribute or, if 2388 the Date Range has an END-ON-NEXT=YES attribute, by adding a 2389 Following Range. 2391 If the Media Playlist contains the final Media Segment of the 2392 presentation, then the Playlist file MUST contain the EXT-X-ENDLIST 2393 tag; this allows clients to minimize unproductive Playlist reloads. 2395 If a Media Playlist does not contain the EXT-X-ENDLIST tag, the 2396 server MUST make a new version of the Playlist file available that 2397 contains at least one new Media Segment. It MUST be made available 2398 no later than 1.5 times the Target Duration after the previous time 2399 the Playlist was updated with a Media Segment. This allows clients 2400 to utilize the network efficiently. 2402 If a Media Playlist without an EXT-X-ENDLIST tag contains Partial 2403 Segments, the Server MUST add a new Partial Segment to the Playlist 2404 within one Part Target Duration after it added the previous Partial 2405 Segment. 2407 If the server wishes to remove an entire presentation, it SHOULD 2408 provide a clear indication to clients that the Playlist file is no 2409 longer available (e.g., with an HTTP 404 or 410 response). It MUST 2410 ensure that all Media Segments in the Playlist file remain available 2411 to clients for at least the duration of the Playlist file at the time 2412 of removal to prevent interruption of in-progress playback. 2414 6.2.2. Live Playlists 2416 The server MAY limit the availability of Media Segments by removing 2417 Media Segments from the Playlist file (Section 6.2.1). If Media 2418 Segments are to be removed, the Playlist file MUST contain an EXT-X- 2419 MEDIA-SEQUENCE tag. Its value MUST be incremented by 1 for every 2420 Media Segment that is removed from the Playlist file; it MUST NOT 2421 decrease or wrap. Clients can malfunction if each Media Segment does 2422 not have a consistent, unique Media Sequence Number. 2424 EXT-X-PART tags SHOULD be removed from the Playlist after they are 2425 greater than three Target Durations from the end of the Playlist. 2427 Media Segments and EXT-X-PART tags MUST be removed from the Playlist 2428 in the order that they appear in the Playlist; otherwise, client 2429 playback can malfunction. 2431 The server MUST NOT remove a Media Segment from a Playlist file 2432 without an EXT-X-ENDLIST tag if that would produce a Playlist whose 2433 duration is less than three times the Target Duration. Doing so can 2434 trigger playback stalls. 2436 The Availability Duration of a Media Segment is the duration of the 2437 segment plus the duration of the longest-duration Playlist 2438 distributed by the server containing that segment. If the server 2439 removes a Media Segment URI from a Playlist that contains an EXT- 2440 X-ENDLIST tag, clients MUST be able to download the corresponding 2441 Media Segment until the time of removal plus the segment's 2442 Availability Duration. If the server removes a Media Segment URI 2443 from a Playlist that does not contain an EXT-X-ENDLIST tag, clients 2444 MUST be able to download the segment until the time at which it first 2445 appeared in the Playlist plus the segment's Availability Duration. 2447 If the server wishes to remove segments from a Media Playlist 2448 containing an EXT-X-DISCONTINUITY tag, the Media Playlist MUST 2449 contain an EXT-X-DISCONTINUITY-SEQUENCE tag. Without the EXT-X- 2450 DISCONTINUITY-SEQUENCE tag, it can be impossible for a client to 2451 locate corresponding segments between Renditions. 2453 If the server removes an EXT-X-DISCONTINUITY tag from the Media 2454 Playlist, it MUST increment the value of the EXT-X-DISCONTINUITY- 2455 SEQUENCE tag so that the Discontinuity Sequence Numbers of the 2456 segments still in the Media Playlist remain unchanged. The value of 2457 the EXT-X-DISCONTINUITY-SEQUENCE tag MUST NOT decrease or wrap. 2458 Clients can malfunction if each Media Segment does not have a 2459 consistent Discontinuity Sequence Number. 2461 If a server plans to remove a Media Segment after it is delivered to 2462 clients over HTTP, it SHOULD ensure that the HTTP response contains 2463 an Expires header that reflects the planned time-to-live. 2465 A Live Playlist MUST NOT contain the EXT-X-PLAYLIST-TYPE tag, as no 2466 value of that tag allows Media Segments to be removed. 2468 6.2.3. Encrypting Media Segments 2470 Media Segments MAY be encrypted. Every encrypted Media Segment MUST 2471 have an EXT-X-KEY tag (Section 4.4.4.4) applied to it with a URI that 2472 the client can use to obtain a Key file (Section 5) containing the 2473 decryption key. 2475 A Media Segment can only be encrypted with one encryption METHOD, 2476 using one encryption key and IV. However, a server MAY offer 2477 multiple ways to retrieve that key by providing multiple EXT-X-KEY 2478 tags, each with a different KEYFORMAT attribute value. 2480 The server MAY set the HTTP Expires header in the key response to 2481 indicate the duration for which the key can be cached. 2483 Any unencrypted Media Segment in a Playlist that is preceded by an 2484 encrypted Media Segment MUST have an EXT-X-KEY tag applied to it with 2485 a METHOD attribute of NONE. Otherwise, the client will misinterpret 2486 those segments as encrypted. 2488 If the encryption METHOD is AES-128 and the Playlist does not contain 2489 the EXT-X-I-FRAMES-ONLY tag, AES encryption as described in 2490 Section 4.4.4.4 SHALL be applied to individual Media Segments. 2492 If the encryption METHOD is AES-128 and the Playlist contains an EXT- 2493 X-I-FRAMES-ONLY tag, the entire resource MUST be encrypted using 2494 AES-128 CBC with PKCS7 padding [RFC5652]. Encryption MAY be 2495 restarted on 16-byte block boundaries, unless the first block 2496 contains an I-frame. The IV used for encryption MUST be either the 2497 Media Sequence Number of the Media Segment or the value of the IV 2498 attribute of the EXT-X-KEY tag, as described in Section 5.2. These 2499 constraints allow a client to load and decrypt individual I-frames 2500 specified as sub-ranges of regular encrypted Media Segments, and 2501 their Media Initialization Sections. 2503 If the encryption METHOD indicates Sample Encryption, media samples 2504 MAY be encrypted prior to encapsulation in a Media Segment. 2506 The server MUST NOT remove an EXT-X-KEY tag from the Playlist file if 2507 it applies to any Media Segment in the Playlist file, or clients who 2508 subsequently load that Playlist will be unable to decrypt those Media 2509 Segments. 2511 6.2.4. Providing Variant Streams 2513 A server MAY offer multiple Media Playlist files to provide different 2514 encodings of the same presentation. If it does so, it SHOULD provide 2515 a Master Playlist file that lists each Variant Stream to allow 2516 clients to switch between encodings dynamically. 2518 Master Playlists describe regular Variant Streams with EXT-X-STREAM- 2519 INF tags and I-frame Variant Streams with EXT-X-I-FRAME-STREAM-INF 2520 tags. 2522 If an EXT-X-STREAM-INF tag or EXT-X-I-FRAME-STREAM-INF tag contains 2523 the CODECS attribute, the attribute value MUST include every media 2524 format [RFC6381] present in any Media Segment in any of the 2525 Renditions specified by the Variant Stream. 2527 The server MUST meet the following constraints when producing Variant 2528 Streams in order to allow clients to switch between them seamlessly: 2530 Each Variant Stream MUST present the same content. 2532 Matching content in Variant Streams MUST have matching timestamps. 2533 This allows clients to synchronize the media. 2535 Matching content in Variant Streams MUST have matching 2536 Discontinuity Sequence Numbers (see Section 4.4.3.3). 2538 Each Media Playlist in each Variant Stream MUST have the same 2539 Target Duration. The only exceptions are SUBTITLES Renditions and 2540 Media Playlists containing an EXT-X-I-FRAMES-ONLY tag, which MAY 2541 have different Target Durations if they have an EXT-X-PLAYLIST- 2542 TYPE of VOD. 2544 Content that appears in a Media Playlist of one Variant Stream but 2545 not in another MUST appear either at the beginning or at the end 2546 of the Media Playlist file and MUST NOT be longer than the Target 2547 Duration. 2549 If any Media Playlists have an EXT-X-PLAYLIST-TYPE tag, all Media 2550 Playlists MUST have an EXT-X-PLAYLIST-TYPE tag with the same 2551 value. 2553 If the Playlist contains an EXT-X-PLAYLIST-TYPE tag with the value 2554 of VOD, the first segment of every Media Playlist in every Variant 2555 Stream MUST start at the same media timestamp. 2557 If any Media Playlist in a Master Playlist contains an EXT-X- 2558 PROGRAM-DATE-TIME tag, then all Media Playlists in that Master 2559 Playlist MUST contain EXT-X-PROGRAM-DATE-TIME tags with consistent 2560 mappings of date and time to media timestamps. 2562 Each Variant Stream MUST contain the same set of Date Ranges. The 2563 EXT-X-DATERANGE tags of corresponding Date Ranges MUST have the 2564 same ID attribute value and contain the same set of attribute/ 2565 value pairs. 2567 If any Media Playlist in a Master Playlist contains an EXT-X- 2568 SERVER-CONTROL tag, then all Media Playlists in that Master 2569 Playlist MUST contain that tag, with the same attributes and 2570 values. 2572 In addition, for broadest compatibility, Variant Streams SHOULD 2573 contain the same encoded audio bitstream. This allows clients to 2574 switch between Variant Streams without audible glitching. 2576 The rules for Variant Streams also apply to alternative Renditions 2577 (see Section 4.4.6.2.1). 2579 6.2.5. Delivery Directives Interface 2581 A server MAY provide a set of services to its clients by implementing 2582 support for Delivery Directives. Delivery Directives are transmitted 2583 by the Client to the Server as Query Parameters in Playlist request 2584 URIs. 2586 Servers advertise the availability of Delivery Directives using the 2587 EXT-X-SERVER-CONTROL tag (Section 4.4.3.8). 2589 Currently-defined Delivery Directives are _HLS_skip, _HLS_msn and 2590 _HLS_part. 2592 6.2.5.1. Playlist Delta Updates 2594 Live presentations involve frequent Playlist downloads. When 2595 Playlists are large and a Client already has the previous version, 2596 the transfer cost can be reduced considerably by sending only the 2597 newest information in response to a Playlist update request. 2599 A Server advertises support for Playlist Delta Updates that skip 2600 older Media Segments by adding the CAN-SKIP-UNTIL attribute to the 2601 EXT-X-SERVER-CONTROL tag. A Server can also offer support for 2602 Playlist Delta Updates that skip older EXT-X-DATERANGE tags by adding 2603 the CAN-SKIP-DATERANGES attribute to the EXT-X-SERVER-CONTROL tag. 2605 When a Server receives a request for a Playlist containing the CAN- 2606 SKIP-UNTIL attribute but no EXT-X-ENDLIST tag, and the requested URL 2607 contains an _HLS_skip directive whose value is YES or v2, it MUST 2608 respond with a Playlist Delta Update. 2610 The Playlist Delta Update is a version of the Playlist in which Media 2611 Segments that are further from the end of the Playlist than the Skip 2612 Boundary (Section 4.4.3.8), as well as their associated tags, are 2613 replaced by an EXT-X-SKIP tag (Section 4.4.5.2). 2615 When the _HLS_skip directive has a value of v2, the Playlist Delta 2616 Update additionally MUST NOT contain EXT-X-DATERANGE tags that were 2617 added to the Playlist more than CAN-SKIP-UNTIL seconds before the 2618 Playlist request. The RECENTLY-REMOVED-DATERANGES attribute of the 2619 EXT-X-SKIP tag MUST list the date ranges that were removed from the 2620 Playlist within CAN-SKIP-UNTIL seconds of the Playlist request. 2622 All tags that were not skipped MUST remain in the Playlist Delta 2623 Update. 2625 A Server MUST ignore the _HLS_skip directive if the Playlist does not 2626 contain the CAN-SKIP-UNTIL attribute, or if it contains an EXT- 2627 X-ENDLIST tag. 2629 6.2.5.2. Blocking Playlist Reload 2631 A Server MAY offer Blocking Playlist Reloads, which enable immediate 2632 client discovery of Playlist updates as an alternative to polling. 2634 A Server advertises support for Blocking Playlist Reload by adding 2635 the CAN-BLOCK-RELOAD=YES attribute to the EXT-X-SERVER-CONTROL tag. 2637 A Client requests a Blocking Playlist Reload using an _HLS_msn 2638 directive with a decimal-integer value M. When the Playlist URI 2639 contains an _HLS_msn directive and no _HLS_part directive, the Server 2640 MUST defer responding to the request until the Playlist contains a 2641 Media Segment with a Media Sequence Number of M or later or it 2642 responds with an error. 2644 The Playlist URI MAY also contain an _HLS_part directive with a 2645 decimal-integer value N. When the Playlist URI contains both an 2646 _HLS_msn directive and an _HLS_part directive, the Server MUST defer 2647 responding to the request until the Playlist contains the Partial 2648 Segment with Part Index N and with a Media Sequence Number of M or 2649 later or it responds with an error. 2651 If the Client requests a Part Index greater than that of the final 2652 Partial Segment of the Parent Segment, the Server MUST treat the 2653 request as one for Part Index 0 of the following Parent Segment. 2655 The Server MUST deliver the entire Playlist, even if the requested 2656 Media Segment is not the last one in the Playlist, and even if it is 2657 no longer in the Playlist. 2659 A Server MUST ignore _HLS_msn and _HLS_part if the Playlist contains 2660 an EXT-X-ENDLIST tag. 2662 If the _HLS_msn is greater than the Media Sequence Number of the last 2663 Media Segment in the current Playlist plus two, or if the _HLS_part 2664 exceeds the last Partial Segment in the current Playlist by the 2665 Advance Part Limit, then the server SHOULD immediately return Bad 2666 Request, such as HTTP 400. The Advance Part Limit is three divided 2667 by the Part Target Duration if the Part Target Duration is less than 2668 one second, or three otherwise. 2670 If the Playlist URI contains an _HLS_part directive but no _HLS_msn 2671 directive, the Server MUST return Bad Request, such as HTTP 400. 2673 A Server that cannot provide the requested Playlist after blocking 2674 for more than three Target Durations SHOULD return Service 2675 Unavailable, such as HTTP 503. 2677 6.2.6. Providing Preload Hints 2679 The Server MAY add EXT-X-PRELOAD-HINT tags (Section 4.4.5.3) to the 2680 Playlist to allow Clients playing the stream to request upcoming 2681 resources in advance. 2683 A hinted resource MUST be available for request when its EXT-X- 2684 PRELOAD-HINT tag is added to the Playlist. 2686 When processing requests for a URL or a byte range of a URL that 2687 includes one or more Partial Segments that are not yet completely 2688 available to be sent - such as requests made in response to an EXT-X- 2689 PRELOAD-HINT tag - the server MUST refrain from transmitting any 2690 bytes belonging to a Partial Segment until all bytes of that Partial 2691 Segment can be transmitted at the full speed of the link to the 2692 client. If the requested range includes more than one Partial 2693 Segment then the server MUST enforce this delivery guarantee for each 2694 Partial Segment in turn. This enables the client to perform accurate 2695 Adaptive Bit Rate (ABR) measurements. 2697 The Server SHOULD NOT hint a byte range that it does not expect its 2698 clients to require in the near term. 2700 The server SHOULD respond with "Not Found" (such as HTTP 404) to a 2701 request for a resource that it cannot find and that is not specified 2702 by an EXT-X-PRELOAD-HINT tag in an active Media Playlist. 2704 A server MAY choose not to publish previously-hinted resources if the 2705 planned segmentation changes, such as the case of early return from 2706 an ad. The server SHOULD respond to client requests for those 2707 resources with "Not Found" (such as HTTP 404). 2709 If a Partial Segment is created as a subrange of a larger resource 2710 and its length is not known at the time that its hint is added to the 2711 Playlist, the BYTERANGE-LENGTH attribute SHOULD be omitted. The 2712 BYTERANGE-OFFSET SHOULD indicate the Partial Segment's starting 2713 offset into the larger resource. 2715 The Server SHOULD NOT add more than one EXT-X-PRELOAD-HINT tag with 2716 the same TYPE to a Playlist. 2718 6.3. Client Responsibilities 2720 6.3.1. General Client Responsibilities 2722 How the client obtains the URI to the Playlist file is outside the 2723 scope of this document; it is presumed to have done so. 2725 The client obtains the Playlist file from the URI. If the Playlist 2726 file so obtained is a Master Playlist, the client can select a 2727 Variant Stream to load from the Master Playlist. 2729 Clients MUST ensure that loaded Playlists comply with Section 4 and 2730 that the EXT-X-VERSION tag, if present, specifies a protocol version 2731 supported by the client; if either check fails, the client MUST NOT 2732 attempt to use the Playlist, or unintended behavior could occur. 2734 When parsing Playlist elements that are subject to variable 2735 substitution, a Variable Reference whose Variable Name has been 2736 provided by an EXT-X-DEFINE tag that precedes the Variable Reference 2737 MUST be replaced by the corresponding Variable Value. Such 2738 replacements themselves are NOT subject to variable substitution. 2740 When parsing Playlist elements that are subject to variable 2741 substitution, a Variable Reference whose Variable Name has NOT been 2742 provided by an EXT-X-DEFINE tag preceding the Variable Reference MUST 2743 trigger a parsing error. 2745 If any URI element in a Playlist contains an URI scheme that the 2746 client cannot handle, the client MUST stop playback. All clients 2747 MUST support HTTP schemes. 2749 To support forward compatibility, when parsing Playlists, clients 2750 MUST: 2752 o ignore any unrecognized tags. 2754 o ignore any attribute/value pair with an unrecognized 2755 AttributeName. 2757 o ignore any tag containing an attribute/value pair of type 2758 enumerated-string whose AttributeName is recognized but whose 2759 AttributeValue is not recognized, unless the definition of the 2760 attribute says otherwise. 2762 When identifying playable Renditions, Clients SHOULD consider an 2763 audio Rendition having unrecognized CHANNELS parameters to be 2764 playable if its associated CODECS attribute is supported. However, 2765 an equivalent Rendition with the same audio codec and recognized 2766 CHANNELS parameters SHOULD be preferred if it is present in the 2767 Master Playlist. 2769 When all Variant Streams have a SCORE attribute, the client SHOULD 2770 use the SCORE value to choose a Variant Stream after all other 2771 playability constraints have been applied. If several Variant 2772 Streams have the highest SCORE value then other criteria MAY be used 2773 to chose among them. 2775 Algorithms used by the client to switch between Variant Streams are 2776 beyond the scope of this document. 2778 6.3.2. Loading the Media Playlist File 2780 Every time a Media Playlist is loaded or reloaded from a Playlist 2781 URI, the client MUST determine the next Media Segment to load, as 2782 described in Section 6.3.5, if it intends to play the presentation 2783 normally (i.e., in Playlist order at the nominal playback rate). 2785 If the Media Playlist contains the EXT-X-MEDIA-SEQUENCE tag, the 2786 client SHOULD assume that each Media Segment in it will become 2787 unavailable at the time that the Playlist file was loaded plus the 2788 duration of the Playlist file. 2790 A client MAY use the segment Media Sequence Number to track the 2791 location of a Media Segment within a Playlist when the Playlist is 2792 reloaded. 2794 A client MUST NOT assume that segments with the same Media Sequence 2795 Number in different Variant Streams or Renditions have the same 2796 position in the presentation; Playlists MAY have independent Media 2797 Sequence Numbers. Instead, a client MUST use the relative position 2798 of each segment on the Playlist timeline and its Discontinuity 2799 Sequence Number to locate corresponding segments. 2801 Clients using Delivery Directives (Section 6.2.5) MUST ensure that 2802 all query parameters appear in UTF-8 order within the URI. This 2803 improves Server cache utilization. 2805 A client MUST load the Media Playlist file of every Rendition 2806 selected for playback in order to locate the media specific to that 2807 Rendition. But, to prevent unnecessary load on the server, it SHOULD 2808 NOT load the Playlist file of any other Rendition. 2810 For some Variant Streams, it is possible to select Renditions that do 2811 not include the Rendition specified by the EXT-X-STREAM-INF tag. As 2812 noted above, the client SHOULD NOT load that Rendition in those 2813 cases. 2815 6.3.3. Playing the Media Playlist File 2817 The client SHALL choose which Media Segment to play first from the 2818 Media Playlist when playback starts. If the EXT-X-ENDLIST tag is not 2819 present and the client intends to play the media normally, the client 2820 SHOULD NOT choose a segment closer to the end of the Playlist than 2821 described by the HOLD-BACK and PART-HOLD-BACK attributes. Doing so 2822 can trigger playback stalls. 2824 Normal playback can be achieved by playing Media Segments or Partial 2825 Segments in the order that they appear in the Playlist. The client 2826 MAY present the available media in any way it wishes, including 2827 normal playback, random access, and trick modes. 2829 The client SHOULD NOT attempt to load Media Segments that have been 2830 marked with an EXT-X-GAP tag, or to load Partial Segments with a 2831 GAP=YES attribute. Instead, clients are encouraged to look for 2832 another Variant Stream of the same Rendition which does not have the 2833 same gap, and play that instead. 2835 The encoding parameters for samples in a Media Segment and across 2836 multiple Media Segments in a Media Playlist SHOULD remain consistent. 2837 However, clients SHOULD deal with encoding changes as they are 2838 encountered, for example, by scaling video content to accommodate a 2839 resolution change. If the Variant Stream includes a RESOLUTION 2840 attribute, clients SHOULD display all video within a rectangle with 2841 the same proportions as that resolution. 2843 Clients SHOULD be prepared to handle multiple tracks of a particular 2844 type (e.g., audio or video). A client with no other preference 2845 SHOULD choose the track with the lowest numerical track identifier 2846 that it can play. 2848 Clients SHOULD ignore private streams inside Transport Streams that 2849 they do not recognize. Private streams can be used to support 2850 different devices with the same stream, although stream authors 2851 SHOULD be sensitive to the additional network load that this imposes. 2853 The client MUST be prepared to reset its parser(s) and decoder(s) 2854 before playing a Media Segment that has an EXT-X-DISCONTINUITY tag 2855 applied to it; otherwise, playback errors can occur. 2857 The client SHOULD attempt to load Media Segments in advance of when 2858 they will be required for uninterrupted playback to compensate for 2859 temporary variations in latency and throughput. 2861 The client MAY use the value of the EXT-X-PROGRAM-DATE-TIME tag to 2862 display the program origination time to the user. If the value 2863 includes time zone information, the client SHALL take it into 2864 account; if it does not, the client MAY assume the time to be local. 2866 Note that dates in Playlists can refer to when the content was 2867 produced (or to other times), which have no relation to the time of 2868 playback. 2870 If the first EXT-X-PROGRAM-DATE-TIME tag in a Playlist appears after 2871 one or more Media Segment URIs, the client SHOULD extrapolate 2872 backward from that tag (using EXTINF durations and/or media 2873 timestamps) to associate dates with those segments. To associate a 2874 date with any other Media Segment that does not have an EXT-X- 2875 PROGRAM-DATE-TIME tag applied to it directly, the client SHOULD 2876 extrapolate forward from the last EXT-X-PROGRAM-DATE-TIME tag 2877 appearing before that segment in the Playlist. 2879 6.3.4. Reloading the Media Playlist File 2881 The client MUST periodically reload a Media Playlist file to learn 2882 what media is currently available, unless it contains an EXT-X- 2883 PLAYLIST-TYPE tag with a value of VOD, or a value of EVENT and the 2884 EXT-X-ENDLIST tag is also present. 2886 However, the client MUST NOT attempt to reload the Playlist file more 2887 frequently than specified by this section, in order to limit the 2888 collective load on the server. 2890 When a client loads a Playlist file for the first time or reloads a 2891 Playlist file and finds that it has changed since the last time it 2892 was loaded, the client MUST wait for at least the duration of the 2893 last segment in the Playlist before attempting to reload the Playlist 2894 file again, measured from the last time the client began loading the 2895 Playlist file. 2897 If the client reloads a Playlist file and finds that it has not 2898 changed, then it MUST wait for a period of one-half the Target 2899 Duration before retrying. If the Playlist file remains unchanged 2900 when reloaded and it has been at least 1.5 times the Target Duration 2901 since the last time the client loaded a changed Playlist then the 2902 client MAY conclude that the server is not behaving properly and 2903 switch to a different Variant Stream or trigger a playback error. 2905 After reloading a Media Playlist, the client SHOULD verify that each 2906 Media Segment in it has the same URI (and byte range, if specified) 2907 as the Media Segment with the same Media Sequence Number in the 2908 previous Media Playlist. It SHOULD halt playback if it does not, as 2909 this normally indicates a server error. 2911 In order to reduce server load, the client SHOULD NOT reload the 2912 Playlist files of Variant Streams or alternate Renditions that are 2913 not currently being played. If it decides to switch playback to a 2914 different Variant Stream, it SHOULD stop reloading the Playlist of 2915 the old Variant Stream and begin loading the Playlist of the new 2916 Variant Stream. It can use the EXTINF durations and the constraints 2917 in Section 6.2.4 to determine the approximate location of 2918 corresponding media. Once media from the new Variant Stream has been 2919 loaded, the timestamps in the Media Segments can be used to 2920 synchronize the old and new timelines precisely. 2922 A client MUST NOT attempt to use the Media Sequence Number to 2923 synchronize between streams (see Section 6.3.2). 2925 6.3.5. Determining the Next Segment to Load 2927 The client MUST examine the Media Playlist file every time it is 2928 loaded or reloaded to determine the next Media Segment to load, as 2929 the set of available media MAY have changed. 2931 The first segment to load is generally the segment that the client 2932 has chosen to play first (see Section 6.3.3). 2934 In order to play the presentation normally, the next Media Segment to 2935 load is the one with the lowest Media Sequence Number that is greater 2936 than the Media Sequence Number of the last Media Segment loaded. 2938 6.3.6. Decrypting Encrypted Media Segments 2940 If a Media Playlist file contains an EXT-X-KEY tag that specifies a 2941 Key file URI, the client can obtain that Key file and use the key 2942 inside it to decrypt all Media Segments to which that EXT-X-KEY tag 2943 applies. 2945 A client MUST ignore any EXT-X-KEY tag with an unsupported or 2946 unrecognized KEYFORMAT attribute, to allow for cross-device 2947 addressability. If the Playlist contains a Media Segment to which 2948 only EXT-X-KEY tags with unrecognized or unsupported KEYFORMAT 2949 attributes are applied, playback SHOULD fail. 2951 A client MUST NOT attempt to decrypt any segments whose EXT-X-KEY tag 2952 has a METHOD attribute that it does not recognize. 2954 If the encryption METHOD is AES-128, AES-128 CBC decryption SHALL be 2955 applied to individual Media Segments, whose encryption format is 2956 described in Section 4.4.4.4. 2958 If the encryption METHOD is AES-128 and the Media Segment is part of 2959 an I-frame Playlist (Section 4.4.3.6) and it has an EXT-X-BYTERANGE 2960 tag applied to it, special care needs to be taken in loading and 2961 decrypting the segment, because the resource identified by the URI is 2962 encrypted in 16-byte blocks from the start of the resource. 2964 The decrypted I-frame can be recovered by first widening its byte 2965 range, as specified by the EXT-X-BYTERANGE tag, so that it starts and 2966 ends on 16-byte boundaries from the start of the resource. 2968 Next, the byte range is widened further to include a 16-byte block at 2969 the beginning of the range. This 16-byte block allows the correct IV 2970 for the following block to be calculated. 2972 The widened byte range can then be loaded and decrypted with AES-128 2973 CBC using an arbitrary IV. The number of bytes added to the 2974 beginning and the end of the original byte range are discarded from 2975 the decrypted bytes; what remains is the decrypted I-frame. 2977 If the encryption METHOD indicates Sample Encryption, decryption 2978 SHALL be applied to encrypted media samples within the Media Segment. 2980 An EXT-X-KEY tag with a METHOD of NONE indicates that the Media 2981 Segments it applies to are not encrypted. 2983 6.3.7. Requesting Playlist Delta Updates 2985 If a Media Playlist file contains an EXT-X-SERVER-CONTROL tag with a 2986 CAN-SKIP-UNTIL attribute and no EXT-X-ENDLIST tag, a Client MAY use 2987 the _HLS_skip Delivery Directive to request Playlist Delta Updates. 2989 A Client SHOULD NOT request a Playlist Delta Update unless it already 2990 has a version of the Playlist that is no older than one-half of the 2991 Skip Boundary. 2993 The client can request a Playlist Delta Update that skips older Media 2994 Segments by adding an "_HLS_skip=YES" directive to the Media Playlist 2995 URL when it requests the Playlist. 2997 Alternately, if the EXT-X-SERVER-CONTROL tag contains a CAN-SKIP- 2998 DATERANGES=YES attribute, the client can request a Playlist Delta 2999 Update that skips both older Segments and older EXT-X-DATERANGE tags 3000 by adding an "_HLS_skip=v2" directive to the Media Playlist URL when 3001 it requests the Playlist. 3003 A Client MUST merge the contents of a Playlist Delta Update with its 3004 previous version of the Playlist to form an up-to-date version of the 3005 Playlist. If a Client receives a Playlist containing an EXT-X-SKIP 3006 tag and finds that it does not already have all of the information 3007 that was skipped, it MUST obtain a complete copy of the Playlist by 3008 reissuing its Playlist request without the _HLS_skip directive. 3010 6.3.8. Issuing Blocking Requests 3012 Clients MUST NOT request Blocking Playlist Reloads unless the 3013 Playlist contains an EXT-X-SERVER-CONTROL tag with a CAN-BLOCK- 3014 RELOAD=YES attribute. 3016 If Blocking Playlist Reloads are supported, Clients SHOULD use the 3017 _HLS_msn Delivery Directive (and _HLS_part, if the Playlist contains 3018 Partial Segments) to obtain Playlist updates in preference to the 3019 polling regime described in Section 6.3.4. 3021 If up-to-date information on the next expected Media Sequence Number 3022 of a Rendition is not available, a Client SHOULD use a tune-in 3023 algorithm such as the one described in Appendix C to obtain a recent 3024 version of the Playlist. 3026 Clients MUST ignore EXT-X-PRELOAD-HINT tags with unrecognized TYPE 3027 attributes. Clients SHOULD ignore all but the first EXT-X-PRELOAD- 3028 HINT tag in a Playlist with a particular TYPE attribute. 3030 When processing a Playlist containing an EXT-X-PRELOAD-HINT tag with 3031 TYPE=PART, a Client with sufficient space in its download pipeline 3032 that is not already loading the hinted resource SHOULD request it. 3033 This will typically happen at the same time as its blocking request 3034 for the next Playlist update. 3036 When processing a Playlist containing an EXT-X-PRELOAD-HINT tag with 3037 TYPE=MAP, a Client with sufficient space in its download pipeline 3038 that has not already cached the hinted Media Initialization 3039 Section SHOULD request it. 3041 A Client SHOULD cancel a request for a hinted resource if it is not 3042 present in a subsequent Playlist update, such as in an EXT-X-PRELOAD- 3043 HINT tag or as part of another tag such as EXT-X-PART. The client 3044 SHOULD ignore the results of such requests. 3046 A Client SHOULD recognize when a Partial Segment indicated by an EXT- 3047 X-PART tag is a subrange of a hint download and obtain the Partial 3048 Segment from the hint download. Clients SHOULD recognize contiguous 3049 ranges between existing Partial Segments and Partial Segment hints 3050 and avoid duplicate downloads. 3052 7. Protocol Version Compatibility 3054 Protocol compatibility is specified by the EXT-X-VERSION tag. A 3055 Playlist that contains tags or attributes that are not compatible 3056 with protocol version 1 MUST include an EXT-X-VERSION tag. 3058 A client MUST NOT attempt playback if it does not support the 3059 protocol version specified by the EXT-X-VERSION tag, or unintended 3060 behavior could occur. 3062 A Media Playlist MUST indicate an EXT-X-VERSION of 2 or higher if it 3063 contains: 3065 o The IV attribute of the EXT-X-KEY tag. 3067 A Media Playlist MUST indicate an EXT-X-VERSION of 3 or higher if it 3068 contains: 3070 o Floating-point EXTINF duration values. 3072 A Media Playlist MUST indicate an EXT-X-VERSION of 4 or higher if it 3073 contains: 3075 o The EXT-X-BYTERANGE tag. 3077 o The EXT-X-I-FRAMES-ONLY tag. 3079 A Media Playlist MUST indicate an EXT-X-VERSION of 5 or higher if it 3080 contains: 3082 o An EXT-X-KEY tag with a METHOD of SAMPLE-AES. 3084 o The KEYFORMAT and KEYFORMATVERSIONS attributes of the EXT-X-KEY 3085 tag. 3087 o The EXT-X-MAP tag. 3089 A Media Playlist MUST indicate an EXT-X-VERSION of 6 or higher if it 3090 contains: 3092 o The EXT-X-MAP tag in a Media Playlist that does not contain EXT- 3093 X-I-FRAMES-ONLY. 3095 Note that in protocol version 6, the semantics of the EXT- 3096 X-TARGETDURATION tag changed slightly. In protocol version 5 and 3097 earlier it indicated the maximum segment duration; in protocol 3098 version 6 and later it indicates the the maximum segment duration 3099 rounded to the nearest integer number of seconds. 3101 A Master Playlist MUST indicate an EXT-X-VERSION of 7 or higher if it 3102 contains: 3104 o "SERVICE" values for the INSTREAM-ID attribute of the EXT-X-MEDIA 3105 tag. 3107 A Playlist MUST indicate an EXT-X-VERSION of 8 or higher if it 3108 contains: 3110 o Variable substitution. 3112 A Playlist MUST indicate an EXT-X-VERSION of 9 or higher if it 3113 contains: 3115 o The EXT-X-SKIP tag. 3117 A Playlist MUST indicate an EXT-X-VERSION of 10 or higher if it 3118 contains: 3120 o An EXT-X-SKIP tag that replaces EXT-X-DATERANGE tags in a Playlist 3121 Delta Update. 3123 The EXT-X-MEDIA tag and the AUDIO, VIDEO, and SUBTITLES attributes of 3124 the EXT-X-STREAM-INF tag are backward compatible to protocol version 3125 1, but playback on older clients may not be desirable. A server MAY 3126 consider indicating an EXT-X-VERSION of 4 or higher in the Master 3127 Playlist but is not required to do so. 3129 The PROGRAM-ID attribute of the EXT-X-STREAM-INF and the EXT-X-I- 3130 FRAME-STREAM-INF tags was removed in protocol version 6. 3132 The EXT-X-ALLOW-CACHE tag was removed in protocol version 7. 3134 8. Playlist Examples 3136 8.1. Simple Media Playlist 3138 #EXTM3U 3139 #EXT-X-TARGETDURATION:10 3140 #EXT-X-VERSION:3 3141 #EXTINF:9.009, 3142 http://media.example.com/first.ts 3143 #EXTINF:9.009, 3144 http://media.example.com/second.ts 3145 #EXTINF:3.003, 3146 http://media.example.com/third.ts 3147 #EXT-X-ENDLIST 3149 8.2. Live Media Playlist Using HTTPS 3151 #EXTM3U 3152 #EXT-X-VERSION:3 3153 #EXT-X-TARGETDURATION:8 3154 #EXT-X-MEDIA-SEQUENCE:2680 3156 #EXTINF:7.975, 3157 https://priv.example.com/fileSequence2680.ts 3158 #EXTINF:7.941, 3159 https://priv.example.com/fileSequence2681.ts 3160 #EXTINF:7.975, 3161 https://priv.example.com/fileSequence2682.ts 3163 8.3. Playlist with Encrypted Media Segments 3165 #EXTM3U 3166 #EXT-X-VERSION:3 3167 #EXT-X-MEDIA-SEQUENCE:7794 3168 #EXT-X-TARGETDURATION:15 3170 #EXT-X-KEY:METHOD=AES-128,URI="https://priv.example.com/key.php?r=52" 3172 #EXTINF:2.833, 3173 http://media.example.com/fileSequence52-A.ts 3174 #EXTINF:15.0, 3175 http://media.example.com/fileSequence52-B.ts 3176 #EXTINF:13.333, 3177 http://media.example.com/fileSequence52-C.ts 3179 #EXT-X-KEY:METHOD=AES-128,URI="https://priv.example.com/key.php?r=53" 3181 #EXTINF:15.0, 3182 http://media.example.com/fileSequence53-A.ts 3184 8.4. Master Playlist 3186 #EXTM3U 3187 #EXT-X-STREAM-INF:BANDWIDTH=1280000,AVERAGE-BANDWIDTH=1000000 3188 http://example.com/low.m3u8 3189 #EXT-X-STREAM-INF:BANDWIDTH=2560000,AVERAGE-BANDWIDTH=2000000 3190 http://example.com/mid.m3u8 3191 #EXT-X-STREAM-INF:BANDWIDTH=7680000,AVERAGE-BANDWIDTH=6000000 3192 http://example.com/hi.m3u8 3193 #EXT-X-STREAM-INF:BANDWIDTH=65000,CODECS="mp4a.40.5" 3194 http://example.com/audio-only.m3u8 3196 8.5. Master Playlist with I-Frames 3198 #EXTM3U 3199 #EXT-X-STREAM-INF:BANDWIDTH=1280000 3200 low/audio-video.m3u8 3201 #EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=86000,URI="low/iframe.m3u8" 3202 #EXT-X-STREAM-INF:BANDWIDTH=2560000 3203 mid/audio-video.m3u8 3204 #EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=150000,URI="mid/iframe.m3u8" 3205 #EXT-X-STREAM-INF:BANDWIDTH=7680000 3206 hi/audio-video.m3u8 3207 #EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=550000,URI="hi/iframe.m3u8" 3208 #EXT-X-STREAM-INF:BANDWIDTH=65000,CODECS="mp4a.40.5" 3209 audio-only.m3u8 3211 8.6. Master Playlist with Alternative Audio 3213 In this example, the CODECS attributes have been condensed for space. 3214 A '\' is used to indicate that the tag continues on the following 3215 line with whitespace removed: 3217 #EXTM3U 3218 #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="aac",NAME="English", \ 3219 DEFAULT=YES,AUTOSELECT=YES,LANGUAGE="en", \ 3220 URI="main/english-audio.m3u8" 3221 #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="aac",NAME="Deutsch", \ 3222 DEFAULT=NO,AUTOSELECT=YES,LANGUAGE="de", \ 3223 URI="main/german-audio.m3u8" 3224 #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="aac",NAME="Commentary", \ 3225 DEFAULT=NO,AUTOSELECT=NO,LANGUAGE="en", \ 3226 URI="commentary/audio-only.m3u8" 3227 #EXT-X-STREAM-INF:BANDWIDTH=1280000,CODECS="...",AUDIO="aac" 3228 low/video-only.m3u8 3229 #EXT-X-STREAM-INF:BANDWIDTH=2560000,CODECS="...",AUDIO="aac" 3230 mid/video-only.m3u8 3231 #EXT-X-STREAM-INF:BANDWIDTH=7680000,CODECS="...",AUDIO="aac" 3232 hi/video-only.m3u8 3233 #EXT-X-STREAM-INF:BANDWIDTH=65000,CODECS="mp4a.40.5",AUDIO="aac" 3234 main/english-audio.m3u8 3236 8.7. Master Playlist with Alternative Video 3238 This example shows three different video Renditions (Main, 3239 Centerfield, and Dugout) and three different Variant Streams (low, 3240 mid, and high). In this example, clients that did not support the 3241 EXT-X-MEDIA tag and the VIDEO attribute of the EXT-X-STREAM-INF tag 3242 would only be able to play the video Rendition "Main". 3244 Since the EXT-X-STREAM-INF tag has no AUDIO attribute, all video 3245 Renditions would be required to contain the audio. 3247 In this example, the CODECS attributes have been condensed for space. 3248 A '\' is used to indicate that the tag continues on the following 3249 line with whitespace removed: 3251 #EXTM3U 3252 #EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="low",NAME="Main", \ 3253 DEFAULT=YES,URI="low/main/audio-video.m3u8" 3254 #EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="low",NAME="Centerfield", \ 3255 DEFAULT=NO,URI="low/centerfield/audio-video.m3u8" 3256 #EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="low",NAME="Dugout", \ 3257 DEFAULT=NO,URI="low/dugout/audio-video.m3u8" 3259 #EXT-X-STREAM-INF:BANDWIDTH=1280000,CODECS="...",VIDEO="low" 3260 low/main/audio-video.m3u8 3262 #EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="mid",NAME="Main", \ 3263 DEFAULT=YES,URI="mid/main/audio-video.m3u8" 3264 #EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="mid",NAME="Centerfield", \ 3265 DEFAULT=NO,URI="mid/centerfield/audio-video.m3u8" 3266 #EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="mid",NAME="Dugout", \ 3267 DEFAULT=NO,URI="mid/dugout/audio-video.m3u8" 3269 #EXT-X-STREAM-INF:BANDWIDTH=2560000,CODECS="...",VIDEO="mid" 3270 mid/main/audio-video.m3u8 3272 #EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="hi",NAME="Main", \ 3273 DEFAULT=YES,URI="hi/main/audio-video.m3u8" 3274 #EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="hi",NAME="Centerfield", \ 3275 DEFAULT=NO,URI="hi/centerfield/audio-video.m3u8" 3276 #EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="hi",NAME="Dugout", \ 3277 DEFAULT=NO,URI="hi/dugout/audio-video.m3u8" 3279 #EXT-X-STREAM-INF:BANDWIDTH=7680000,CODECS="...",VIDEO="hi" 3280 hi/main/audio-video.m3u8 3282 8.8. Session Data in a Master Playlist 3284 In this example, only the EXT-X-SESSION-DATA is shown: 3286 #EXT-X-SESSION-DATA:DATA-ID="com.example.lyrics",URI="lyrics.json" 3288 #EXT-X-SESSION-DATA:DATA-ID="com.example.title",LANGUAGE="en", \ 3289 VALUE="This is an example" 3290 #EXT-X-SESSION-DATA:DATA-ID="com.example.title",LANGUAGE="es", \ 3291 VALUE="Este es un ejemplo" 3293 8.9. CHARACTERISTICS Attribute Containing Multiple Characteristics 3295 Certain characteristics are valid in combination, as in: 3297 CHARACTERISTICS= 3298 "public.accessibility.transcribes-spoken-dialog,public.easy-to-read" 3300 8.10. EXT-X-DATERANGE Carrying SCTE-35 Tags 3302 This example shows two EXT-X-DATERANGE tags that describe a single 3303 Date Range, with an SCTE-35 "out" splice_insert() command that is 3304 subsequently updated with an SCTE-35 "in" splice_insert() command. 3306 #EXTM3U 3307 ... 3308 #EXT-X-DATERANGE:ID="splice-6FFFFFF0",START-DATE="2014-03-05T11: 3309 15:00Z",PLANNED-DURATION=59.993,SCTE35-OUT=0xFC002F0000000000FF0 3310 00014056FFFFFF000E011622DCAFF000052636200000000000A0008029896F50 3311 000008700000000 3313 ... Media Segment declarations for 60s worth of media 3315 #EXT-X-DATERANGE:ID="splice-6FFFFFF0",DURATION=59.993,SCTE35-IN= 3316 0xFC002A0000000000FF00000F056FFFFFF000401162802E6100000000000A00 3317 08029896F50000008700000000 3318 ... 3320 8.11. Low-Latency Playlist 3322 This example shows the end of a Playlist that contains Partial 3323 Segments. Note that EXT-X-PART tags have been removed from earlier 3324 Parent Segments. The Playlist also includes a Preload Hint, a 3325 Rendition Report, and a mid-roll advertisement. 3327 #EXTM3U 3328 #EXT-X-TARGETDURATION:4 3329 ... 3330 #EXTINF:4.00008, 3331 fileSequence268.mp4 3332 #EXTINF:4.00008, 3333 fileSequence269.mp4 3334 #EXTINF:4.00008, 3335 fileSequence270.mp4 3336 #EXT-X-PART:DURATION=2.00004,INDEPENDENT=YES,URI="filePart271.0.mp4" 3337 #EXT-X-PART:DURATION=2.00004,URI="filePart271.1.mp4" 3338 #EXTINF:4.00008, 3339 fileSequence271.mp4 3340 #EXT-X-PART:DURATION=2.00004,INDEPENDENT=YES,URI="filePart272.0.mp4" 3341 #EXT-X-PART:DURATION=0.50001,URI="filePart272.1.mp4" 3342 #EXTINF:2.50005, 3343 fileSequence272.mp4 3344 #EXT-X-DISCONTINUITY 3345 #EXT-X-PART:DURATION=2.00004,INDEPENDENT=YES,URI="midRoll273.0.mp4" 3346 #EXT-X-PART:DURATION=2.00004,URI="midRoll273.1.mp4" 3347 #EXTINF:4.00008, 3348 midRoll273.mp4 3349 #EXT-X-PART:DURATION=2.00004,INDEPENDENT=YES,URI="midRoll274.0.mp4" 3350 #EXT-X-PRELOAD-HINT:TYPE=PART,URI="midRoll274.1.mp4" 3351 #EXT-X-RENDITION-REPORT:URI="/1M/LL-HLS.m3u8",LAST-MSN=274,LAST-PART=1 3353 9. Contributors 3355 Significant contributions to the design of this protocol were made by 3356 Jim Batson, David Biderman, Bill May, Roger Pantos, Alan Tseng, and 3357 Eryk Vershen. Stuart Cheshire helped edit the specification. 3359 Significant contributions to the update of this protocol were made by 3360 Bill May, Eryk Vershen, and Peng Zhou. 3362 In particular, Bill May co-authored the first edition of HTTP Live 3363 Streaming, [RFC8216], and continues to provide valuable guidance and 3364 input. 3366 10. IANA Considerations 3368 IANA has registered the following media type [RFC2046]: 3370 Type name: application 3372 Subtype name: vnd.apple.mpegurl 3374 Required parameters: none 3375 Optional parameters: none 3377 Encoding considerations: encoded as UTF-8, which is 8-bit text. This 3378 media type may require encoding on transports not capable of handling 3379 8-bit text. See Section 4 for more information. 3381 Security considerations: See Section 11. 3383 Compression: this media type does not employ compression. 3385 Interoperability considerations: There are no byte-ordering issues, 3386 since files are 8-bit text. Applications could encounter 3387 unrecognized tags, which SHOULD be ignored. 3389 Published specification: see Section 4. 3391 Applications that use this media type: Multimedia applications such 3392 as the iPhone media player in iOS 3.0 and later and QuickTime Player 3393 in Mac OS X version 10.6 and later. 3395 Fragment identifier considerations: no Fragment Identifiers are 3396 defined for this media type. 3398 Query parameter considerations: the definition of all query 3399 parameters for resources of this media type which begin with the 3400 string "_HLS_" are reserved by this specification. Currently-defined 3401 query parameters are specified in Section 6.2.5. 3403 Additional information: 3405 Deprecated alias names for this type: none 3406 Magic number(s): #EXTM3U 3407 File extension(s): .m3u8, .m3u (see Section 4) 3408 Macintosh file type code(s): none 3410 Person & email address to contact for further information: David 3411 Singer, singer AT apple.com. 3413 Intended usage: LIMITED USE 3415 Restrictions on usage: none 3417 Author: Roger Pantos 3419 Change Controller: David Singer 3421 11. Security Considerations 3423 Since the protocol generally uses HTTP to transfer data, most of the 3424 same security considerations apply. See Section 15 of HTTP 3425 [RFC7230]. 3427 Media file parsers are typically subject to "fuzzing" attacks. 3428 Implementors SHOULD pay particular attention to code that will parse 3429 data received from a server and ensure that all possible inputs are 3430 handled correctly. 3432 Playlist files contain URIs, which clients will use to make network 3433 requests of arbitrary entities. Clients SHOULD range-check responses 3434 to prevent buffer overflows. See also the Security Considerations 3435 section of "Uniform Resource Identifier (URI): Generic Syntax" 3436 [RFC3986]. 3438 Apart from URL resolution, this format does not employ any form of 3439 active content. 3441 Clients SHOULD limit each playback session to a reasonable number of 3442 concurrent downloads (for example, four) to avoid contributing to 3443 denial-of-service attacks. 3445 HTTP requests often include session state ("cookies"), which may 3446 contain private user data. Implementations MUST follow cookie 3447 restriction and expiry rules specified by "HTTP State Management 3448 Mechanism" [RFC6265] to protect themselves from attack. See also the 3449 Security Considerations section of that document, and "Use of HTTP 3450 State Management" [RFC2964]. 3452 Encryption keys are specified by URI. The delivery of these keys 3453 SHOULD be secured by a mechanism such as HTTP Over TLS [RFC2818] 3454 (formerly SSL) in conjunction with a secure realm or a session token. 3456 12. References 3458 12.1. Normative References 3460 [AC_3] Advanced Television Systems Committee, "Digital Audio 3461 Compression (AC-3) (E-AC-3)", ATSC Standard A/52:2010, 3462 November 2010, <http://atsc.org/wp- 3463 content/uploads/2015/03/A52-201212-17.pdf>. 3465 [AES_128] National Institute of Standards and Technology, "Advanced 3466 Encryption Standard (AES)", FIPS PUB 197, DOI 3467 10.6028/NIST.FIPS.197, November 2001, 3468 <http://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.197.pdf>. 3470 [CEA608] Consumer Technology Association, "Line 21 Data Services", 3471 ANSI/CTA Standard 608-E, April 2008, 3472 <https://standards.cta.tech/kwspub/published_docs/ANSI- 3473 CTA-608-E-R-2014-Preview.pdf>. 3475 [CEA708] Consumer Technology Association, "Digital Television (DTV) 3476 Closed Captioning", ANSI/CTA Standard CEA-708-E, August 3477 2013, <https://standards.cta.tech/kwspub/published_docs/ 3478 ANSI-CTA-708-E-Preview.pdf>. 3480 [CICP] International Organization for Standardization, 3481 "Information technology - MPEG systems technologies - Part 3482 8: Coding-independent code points", ISO/IEC International 3483 Standard 23001-8:2016, 2016, <https://www.iso.org/obp/ 3484 ui/#iso:std:iso-iec:23001:-8:ed-2:v1:en>. 3486 [CMAF] International Organization for Standardization, 3487 "Information technology -- Multimedia application format 3488 (MPEG-A) -- Part 19: Common media application format 3489 (CMAF) for segmented media", ISO/IEC International 3490 Standard 23000-19:2017, December 2017, 3491 <https://www.iso.org/standard/71975.html>. 3493 [COMMON_ENC] 3494 International Organization for Standardization, 3495 "Information technology -- MPEG systems technologies -- 3496 Part 7: Common encryption in ISO base media file format 3497 files", ISO/IEC International Standard 23001-7:2016, 3498 February 2016, <http://www.iso.org/iso/ 3499 catalogue_detail.htm?csnumber=68042>. 3501 [H_264] International Telecommunications Union, "Advanced video 3502 coding for generic audiovisual services", January 2012, 3503 <http://www.itu.int/rec/T-REC-H.264>. 3505 [HDCP] Digital Content Protection LLC, "High-bandwidth Digital 3506 Content Protection System - Mapping HDCP to HDMI", 3507 February 2013, <http://www.digital- 3508 cp.com/sites/default/files/specifications/ 3509 HDCP%20on%20HDMI%20Specification%20Rev2_2_Final1.pdf>. 3511 [IMSC1] W3C, "TTML Profiles for Internet Media Subtitles and 3512 Captions 1.0 (IMSC1)", April 2016, 3513 <https://www.w3.org/TR/ttml-imsc1/>. 3515 [ISO_13818] 3516 International Organization for Standardization, "Generic 3517 coding of moving pictures and associated audio 3518 information", ISO/IEC International Standard 13818:2007, 3519 October 2007, 3520 <http://www.iso.org/iso/catalogue_detail?csnumber=44169>. 3522 [ISO_13818_3] 3523 International Organization for Standardization, "Generic 3524 coding of moving pictures and associated audio information 3525 -- Part 3: Audio", ISO/IEC International 3526 Standard 13818-3:1998, April 1998, 3527 <http://www.iso.org/iso/home/store/catalogue_tc/ 3528 catalogue_detail.htm?csnumber=26797>. 3530 [ISO_13818_7] 3531 International Organization for Standardization, "Generic 3532 coding of moving pictures and associated audio information 3533 -- Part 7: Advanced Audio Coding (AAC)", ISO/IEC 3534 International Standard 13818-7:2006, January 2006, 3535 <http://www.iso.org/iso/home/store/catalogue_tc/ 3536 catalogue_detail.htm?csnumber=43345>. 3538 [ISO_14496] 3539 International Organization for Standardization, 3540 "Information technology -- Coding of audio-visual objects 3541 -- Part 3: Audio", ISO/IEC International 3542 Standard 14496-3:2009, 2009, 3543 <http://www.iso.org/iso/catalogue_detail?csnumber=53943>. 3545 [ISO_8601] 3546 International Organization for Standardization, "Data 3547 elements and interchange formats -- Information 3548 interchange -- Representation of dates and times", ISO/IEC 3549 International Standard 8601:2004, December 2004, 3550 <http://www.iso.org/iso/catalogue_detail?csnumber=40874>. 3552 [ISOBMFF] International Organization for Standardization, 3553 "Information technology -- Coding of audio-visual objects 3554 -- Part 12: ISO base media file format", ISO/IEC 3555 International Standard 14496-12:2015, December 2015, 3556 <http://www.iso.org/iso/ 3557 catalogue_detail.htm?csnumber=68960>. 3559 [MP4_TIMED_TEXT] 3560 International Organization for Standardization, 3561 "Information technology -- Coding of audio-visual objects 3562 -- Part 30: Timed text and other visual overlays in ISO 3563 base media file format", ISO/IEC International 3564 Standard 14496-30:2014, March 2014, 3565 <https://www.iso.org/standard/63107.html>. 3567 [RFC2046] Freed, N. and N. Borenstein, "Multipurpose Internet Mail 3568 Extensions (MIME) Part Two: Media Types", RFC 2046, 3569 DOI 10.17487/RFC2046, November 1996, 3570 <https://www.rfc-editor.org/info/rfc2046>. 3572 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 3573 Requirement Levels", BCP 14, RFC 2119, 3574 DOI 10.17487/RFC2119, March 1997, 3575 <https://www.rfc-editor.org/info/rfc2119>. 3577 [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, 3578 DOI 10.17487/RFC2818, May 2000, 3579 <https://www.rfc-editor.org/info/rfc2818>. 3581 [RFC2964] Moore, K. and N. Freed, "Use of HTTP State Management", 3582 BCP 44, RFC 2964, DOI 10.17487/RFC2964, October 2000, 3583 <https://www.rfc-editor.org/info/rfc2964>. 3585 [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 3586 10646", STD 63, RFC 3629, DOI 10.17487/RFC3629, November 3587 2003, <https://www.rfc-editor.org/info/rfc3629>. 3589 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 3590 Resource Identifier (URI): Generic Syntax", STD 66, 3591 RFC 3986, DOI 10.17487/RFC3986, January 2005, 3592 <https://www.rfc-editor.org/info/rfc3986>. 3594 [RFC5646] Phillips, A., Ed. and M. Davis, Ed., "Tags for Identifying 3595 Languages", BCP 47, RFC 5646, DOI 10.17487/RFC5646, 3596 September 2009, <https://www.rfc-editor.org/info/rfc5646>. 3598 [RFC5652] Housley, R., "Cryptographic Message Syntax (CMS)", STD 70, 3599 RFC 5652, DOI 10.17487/RFC5652, September 2009, 3600 <https://www.rfc-editor.org/info/rfc5652>. 3602 [RFC6265] Barth, A., "HTTP State Management Mechanism", RFC 6265, 3603 DOI 10.17487/RFC6265, April 2011, 3604 <https://www.rfc-editor.org/info/rfc6265>. 3606 [RFC6381] Gellens, R., Singer, D., and P. Frojdh, "The 'Codecs' and 3607 'Profiles' Parameters for "Bucket" Media Types", RFC 6381, 3608 DOI 10.17487/RFC6381, August 2011, 3609 <https://www.rfc-editor.org/info/rfc6381>. 3611 [RFC7230] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 3612 Protocol (HTTP/1.1): Message Syntax and Routing", 3613 RFC 7230, DOI 10.17487/RFC7230, June 2014, 3614 <https://www.rfc-editor.org/info/rfc7230>. 3616 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 3617 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 3618 May 2017, <https://www.rfc-editor.org/info/rfc8174>. 3620 [RFC8216] Pantos, R., Ed. and W. May, "HTTP Live Streaming", 3621 RFC 8216, DOI 10.17487/RFC8216, August 2017, 3622 <https://www.rfc-editor.org/info/rfc8216>. 3624 [RFC8259] Bray, T., Ed., "The JavaScript Object Notation (JSON) Data 3625 Interchange Format", STD 90, RFC 8259, 3626 DOI 10.17487/RFC8259, December 2017, 3627 <https://www.rfc-editor.org/info/rfc8259>. 3629 [SCTE35] Society of Cable Telecommunications Engineers, "Digital 3630 Program Insertion Cueing Message for Cable", ANSI/SCTE 35, 3631 August 2014, <http://www.scte.org/documents/pdf/Standards/ 3632 ANSI_SCTE%2035%202014.pdf>. 3634 [US_ASCII] 3635 American National Standards Institute, "Coded Character 3636 Sets - 7-Bit American National Standard Code for 3637 Information Interchange (7-Bit ASCII)", ANSI X3.4, 3638 December 1986. 3640 [WebVTT] World Wide Web Consortium (W3C), ""WebVTT: The Web Video 3641 Text Tracks Format", Draft Community Group Report", July 3642 2013, <http://dev.w3.org/html5/webvtt/>. 3644 12.2. Informative References 3646 [ID3] ID3.org, "The ID3 audio file data tagging format", 3647 <http://www.id3.org/Developer_Information>. 3649 [M3U] Nullsoft, Inc., "The M3U Playlist format, originally 3650 invented for the Winamp media player", 3651 <http://wikipedia.org/wiki/M3U>. 3653 [MCT] Apple Inc., "QuickTime File Format Specification - Media 3654 Characteristic Tags", <https://developer.apple.com/library 3655 /archive/documentation/QuickTime/QTFF/QTFFChap2/ 3656 qtff2.html>. 3658 [SampleEnc] 3659 Apple Inc., "MPEG-2 Stream Encryption Format for HTTP Live 3660 Streaming", 3661 <https://developer.apple.com/library/ios/documentation/ 3662 AudioVideo/Conceptual/HLS_Sample_Encryption/>. 3664 [UNICODE] The Unicode Consortium, "The Unicode Standard", 3665 <https://www.unicode.org/versions/latest/>. 3667 Appendix A. Changes from RFC 8216 3669 Several changes have been made since the publication of RFC 8216 3670 [RFC8216]. 3672 The following tags have been added: EXT-X-GAP, EXT-X-BITRATE, EXT-X- 3673 SERVER-CONTROL, EXT-X-SKIP, EXT-X-PART-INF, EXT-X-PART, EXT-X- 3674 PRELOAD-HINT, and EXT-X-RENDITION-REPORT. 3676 The EXT-X-DEFINE tag was introduced to support variable substitution. 3678 IMSC has been added to the set of recognized subtitle formats. 3680 The VIDEO-RANGE, ALLOWED-CPC, and STABLE-VARIANT-ID attributes have 3681 been added to the EXT-X-STREAM-INF and EXT-X-I-FRAME-STREAM-INF tags. 3683 The STABLE-RENDITION-ID attribute has been added to the EXT-X-MEDIA 3684 tag. 3686 TYPE-1 has been added as a defined value for the HDCP-LEVEL 3687 attribute. 3689 Redefined the CHANNELS attribute value. 3691 The minimum new segment publication latency has been removed from 3692 server timing model. 3694 The Availability Duration of a Media Segment now depends on the 3695 presence of an EXT-X-ENDLIST tag. 3697 The recommended playlist offset to join a live stream has changed. 3699 The minimum delay before reloading a Playlist file has changed. 3701 The definition of peak segment bit rate was changed to ensure every 3702 segment is included in at least one contiguous set. 3704 Media Metadata tags such as EXT-X-DATERANGE may be removed from 3705 playlists. 3707 Partial Segments were defined as a means to reduce publishing 3708 latency. 3710 Delivery Directives were introduced, including support for Playlist 3711 Delta Updates and Blocking Playlist Reload. 3713 A Low-Latency Server Configuration Profile was added to Appendix B. 3715 Correct the reference for the semantics of the CHARACTERISTICS 3716 attribute. 3718 Appendix C was added. 3720 There have been a number of minor editorial changes. 3722 Appendix B. Server Configuration Profiles 3724 Server Configuration Profiles specify additional requirements that 3725 optimize delivery of HTTP Live Streaming for certain use cases. 3727 B.1. Low-Latency Server Configuration Profile 3729 Playing at a reduced delay from live requires certain stream and 3730 transport features to support the timely delivery of media. Clients 3731 SHOULD verify that the server meets these requirements before playing 3732 at a delay-from-live of less than two Target Durations. Because the 3733 Low-Latency extensions are additions rather than replacements, 3734 clients can and SHOULD fall back to regular-latency playback if they 3735 discover that the server does not meet the requirements of this 3736 configuration profile. 3738 This profile places the following requirements on stream production: 3740 All Media Playlists have EXT-X-PROGRAM-DATE-TIME tags. This 3741 allows more-precise mapping between Segments across Renditions. 3742 Note that real-time clocks are NOT required to be synchronized 3743 between client and server. 3745 Each (non-Partial) Media Segment in a Media Playlist will contain 3746 at least one independent frame. 3748 A Playlist that contains an EXT-X-PART tag but no EXT-X-ENDLIST 3749 tag will also contain an EXT-X-PRELOAD-HINT tag that specifies the 3750 next Partial Segment that is expected to be added to the Playlist. 3752 If the Partial Segment specified by an EXT-X-PRELOAD-HINT tag has 3753 a different Media Initialization Section than the last Partial 3754 Segment in the Playlist, the Playlist will also contain an EXT-X- 3755 PRELOAD-HINT tag with TYPE=MAP that hints the Media Initialization 3756 Section of the hinted Partial Segment. 3758 Each Media Playlist contains one EXT-X-RENDITION-REPORT tag for 3759 each Media Playlist (Rendition) in the Master Playlist, except for 3760 the Media Playlist to which the EXT-X-RENDITION-REPORT tag is 3761 being added, and Playlists that contain the EXT-X-I-FRAMES-ONLY 3762 tag. 3764 This profile places the following requirements on stream delivery: 3766 HTTP-delivered Playlists and Segments are served via HTTP/2. 3767 Efficient delivery requires HTTP/2 priority control (dependencies 3768 and weights) and support for Ping frames. 3770 Each server offers the entire set of Variant Streams in the master 3771 Playlist. This allows rapid bit rate switching without connection 3772 reestablishment. 3774 Servers support HTTP Range requests if Media Playlists contain the 3775 BYTERANGE, BYTERANGE-START, or BYTERANGE-LENGTH attributes. 3777 TCP connections support Selective Acknowledgment (SACK) across the 3778 entire route from client to server. This improves the performance 3779 of TCP loss recovery 3781 Playlist requests are idempotent. 3783 Playlists are delivered in GZIP format. This speeds up Media 3784 Playlist reload and Rendition switching. 3786 All Renditions in a Master Playlist are updated in sync, within an 3787 accuracy of one Part Target Duration. 3789 CDNs and other proxy caches recognize blocking requests for 3790 Playlists and Media Segments whose cache fill is already pending, 3791 and hold the duplicate requests until they can be delivered from 3792 that cache fill. This minimizes the load on the active origin. 3794 HTTP caches used to deliver Playlists or Segments will set the Age 3795 HTTP Response header. 3797 In addition, the following configurations are recommended: 3799 TCP connections should set Explicit Congestion Notification (ECN) 3800 during congestion. They should also use TCP timestamps, TAIL LOSS 3801 probe, and TCP RACK. These configurations improve the performance 3802 of TCP loss recovery. See RFC 2018, RFC 3168, RFC 7323, and IETF 3803 draft-ietf-tcpm-rack for more information about these TCP options. 3805 Servers should support TLS 1.3 or higher. This reduces time to 3806 connect. Servers should also support TLS 1.3 0-RTT connections 3807 for Media Playlists and Media Segments. 3809 Blocking Playlist Reload allows longer caching of Playlists 3810 without detriment to Clients. Successful responses to blocking 3811 Playlist requests should be cached for six Target Durations. 3812 Unsuccessful responses (such as 404s) should be cached for four 3813 Target Durations. Successful responses to non-blocking Playlist 3814 requests should be cached for half the Target Duration. 3815 Unsuccessful responses to non-blocking Playlist requests should be 3816 cached for for one Target Duration. 3818 Successful responses to blocking Media segment requests should be 3819 cached for six Target Durations. Unsuccessful responses should be 3820 cached for one Target Duration. 3822 Origin servers should use Cache-Control headers to communicate the 3823 desired cache lifetime. 3825 The recommended Target Duration is six seconds. 3827 The recommended GOP size is between one and two seconds. Smaller 3828 GOPs allow faster switching between Renditions. 3830 Appendix C. Low-Latency CDN Tune-in 3832 Clients SHOULD support delivery of low-latency streams through CDNs 3833 and other HTTP caches. Correctly implementing PART-HOLD-BACK, the 3834 server-recommended playback delay from live, requires that the client 3835 first obtain a reasonably up-to-date version of the Media Playlist. 3837 There are various approaches that a client may take to obtain a 3838 recent version of a Media Playlist. The following algorithm 3839 typically requires two Playlist requests to obtain a Playlist that is 3840 within one Part Target Duration of the current Playlist: 3842 1. Send a request for the Media Playlist that does not include an 3843 _HLS_msn or _HLS_part directive. 3845 2. Record the first Playlist response, including its received time 3846 and Age header. If there's no Age header in the first Playlist 3847 response, consider the Playlist to be up to date. (No Age header 3848 means that the response came directly from the origin, rather 3849 than being held for a period of time in an intervening HTTP 3850 cache.) 3852 3. If there is an Age header in the first Playlist response, set the 3853 goalDuration to match the Age value. Increase the goalDuration 3854 by one second if the Part Target Duration is less than 1.0. 3856 4. While the Age value is greater than or equal to the floor of the 3857 Part Target Duration: 3859 A. Set currentGoal to be the goalDuration plus the amount of 3860 time since the first Playlist response. 3862 B. If the current version of the Playlist has at least 3863 currentGoal more media in it than the first Playlist, 3864 consider the current Playlist to be up to date. 3866 C. Use the Target Duration and the Part Target Duration to 3867 estimate how many more segments and parts the server will add 3868 to the Playlist to contribute at least currentGoal more media 3869 to it. 3871 D. Request the Media Playlist again, using the _HLS_msn and 3872 _HLS_part directives to obtain the Playlist that has the 3873 estimated additional duration of media since the first 3874 Playlist. 3876 E. Update the current Playlist and the Age value from the 3877 Playlist response. 3879 Author's Address 3881 Roger Pantos (editor) 3882 Apple Inc. 3883 Cupertino, California 3884 United States 3886 Email: http-live-streaming-review@group.apple.com