idnits 2.17.1 draft-pantos-hls-rfc8216bis-09.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 (April 27, 2021) is 1096 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) April 27, 2021 5 Intended status: Informational 6 Expires: October 29, 2021 8 HTTP Live Streaming 2nd Edition 9 draft-pantos-hls-rfc8216bis-09 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 October 29, 2021. 36 Copyright Notice 38 Copyright (c) 2021 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 . . . . . . . . . . . . . . . . . . . . . . 15 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 . . . . . . . . . . . . . . . 20 87 4.4.3.6. EXT-X-I-FRAMES-ONLY . . . . . . . . . . . . . . . 20 88 4.4.3.7. EXT-X-PART-INF . . . . . . . . . . . . . . . . . 21 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 . . . . . . . . . . . . . . . . . . 28 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 . . . . . . . . . . . . . . . 34 105 4.4.5.4. EXT-X-RENDITION-REPORT . . . . . . . . . . . . . 35 106 4.4.6. Master Playlist Tags . . . . . . . . . . . . . . . . 36 107 4.4.6.1. EXT-X-MEDIA . . . . . . . . . . . . . . . . . . . 36 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 . . . . . . . . . . . 46 111 4.4.6.3. EXT-X-I-FRAME-STREAM-INF . . . . . . . . . . . . 46 112 4.4.6.4. EXT-X-SESSION-DATA . . . . . . . . . . . . . . . 47 113 4.4.6.5. EXT-X-SESSION-KEY . . . . . . . . . . . . . . . . 48 114 5. Key Files . . . . . . . . . . . . . . . . . . . . . . . . . . 48 115 5.1. Structure of Key Files . . . . . . . . . . . . . . . . . 48 116 5.2. IV for AES-128 . . . . . . . . . . . . . . . . . . . . . 49 117 6. Client/Server Responsibilities . . . . . . . . . . . . . . . 49 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 . . . . . . . . . . . . . . 54 123 6.2.4. Providing Variant Streams . . . . . . . . . . . . . . 54 124 6.2.5. Delivery Directives Interface . . . . . . . . . . . . 56 125 6.2.5.1. Playlist Delta Updates . . . . . . . . . . . . . 56 126 6.2.5.2. Blocking Playlist Reload . . . . . . . . . . . . 57 127 6.2.6. Providing Preload Hints . . . . . . . . . . . . . . . 58 128 6.3. Client Responsibilities . . . . . . . . . . . . . . . . . 59 129 6.3.1. General Client Responsibilities . . . . . . . . . . . 59 130 6.3.2. Loading the Media Playlist File . . . . . . . . . . . 60 131 6.3.3. Playing the Media Playlist File . . . . . . . . . . . 61 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 . . . . . . . . . . . . . . 65 137 7. Protocol Version Compatibility . . . . . . . . . . . . . . . 66 138 8. Playlist Examples . . . . . . . . . . . . . . . . . . . . . . 68 139 8.1. Simple Media Playlist . . . . . . . . . . . . . . . . . . 68 140 8.2. Live Media Playlist Using HTTPS . . . . . . . . . . . . . 68 141 8.3. Playlist with Encrypted Media Segments . . . . . . . . . 68 142 8.4. Master Playlist . . . . . . . . . . . . . . . . . . . . . 69 143 8.5. Master Playlist with I-Frames . . . . . . . . . . . . . . 69 144 8.6. Master Playlist with Alternative Audio . . . . . . . . . 70 145 8.7. Master Playlist with Alternative Video . . . . . . . . . 70 146 8.8. Session Data in a Master Playlist . . . . . . . . . . . . 71 147 8.9. CHARACTERISTICS Attribute Containing Multiple 148 Characteristics . . . . . . . . . . . . . . . . . . . . . 71 149 8.10. EXT-X-DATERANGE Carrying SCTE-35 Tags . . . . . . . . . . 72 150 8.11. Low-Latency Playlist . . . . . . . . . . . . . . . . . . 72 151 9. Contributors . . . . . . . . . . . . . . . . . . . . . . . . 73 152 10. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 73 153 11. Security Considerations . . . . . . . . . . . . . . . . . . . 75 154 12. References . . . . . . . . . . . . . . . . . . . . . . . . . 75 155 12.1. Normative References . . . . . . . . . . . . . . . . . . 75 156 12.2. Informative References . . . . . . . . . . . . . . . . . 79 157 Appendix A. Changes from RFC 8216 . . . . . . . . . . . . . . . 80 158 Appendix B. Server Configuration Profiles . . . . . . . . . . . 81 159 B.1. Low-Latency Server Configuration Profile . . . . . . . . 81 160 Appendix C. Low-Latency CDN Tune-in . . . . . . . . . . . . . . 83 161 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 84 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 Under certain conditions, like live streaming, where it is not 401 possible to know the cue duration at the time of the segment creation 402 and the subtitle cue interval is split over multiple Segments, the 403 cue time range in each Segment MAY be limited to the WebVTT time 404 range covered by the Segment. 406 Each WebVTT Segment MUST either start with a WebVTT header or have an 407 EXT-X-MAP tag applied to it. 409 In order to synchronize timestamps between audio/video and subtitles, 410 an X-TIMESTAMP-MAP metadata header SHOULD be added to each WebVTT 411 header. This header maps WebVTT cue timestamps to media timestamps 412 in other Renditions of the Variant Stream. Its format is: 414 X-TIMESTAMP-MAP=LOCAL:,MPEGTS: 415 e.g., X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000 417 indicating the media time to which the cue time MUST be mapped. The 418 cue timestamp in the LOCAL attribute MAY fall outside the range of 419 time covered by the segment. 421 The MPEGTS media timestamp MUST use a 90KHz timescale, even when non- 422 WebVTT Media Segments use a different timescale. 424 If a WebVTT segment does not have the X-TIMESTAMP-MAP, the client 425 MUST assume that the WebVTT cue time of 0 maps to an media timestamp 426 of 0. 428 When synchronizing WebVTT with PES timestamps, clients SHOULD account 429 for cases where the 33-bit PES timestamps have wrapped and the WebVTT 430 cue times have not. When the PES timestamp wraps, the WebVTT segment 431 SHOULD have a X-TIMESTAMP-MAP header that maps the current WebVTT 432 time to the new (low valued) PES timestamp. 434 3.1.5. IMSC Subtitles 436 An IMSC Segment is a Fragmented MPEG-4 (Section 3.1.2) Media Segment 437 that carries subtitle media according to MPEG-4 Part 30 438 [MP4_TIMED_TEXT]. This subtitle media MUST comply with the Text 439 Profile of IMSC1 [IMSC1]. 441 The Media Initialization Section of an IMSC Segment is specified in 442 Section 3.1.2. 444 Each IMSC Segment MUST contain all subtitle samples that are intended 445 to be displayed during the period indicated by the segment EXTINF 446 duration. Each Segment MUST contain definitions for all styles which 447 are applied to any part of any sample in the Segment. 449 3.2. Partial Segments 451 One component of viewer delay in a live stream is publishing latency: 452 a Segment cannot be distributed until it has been completely encoded 453 and packaged. A long Segment encoded in real-time introduces a delay 454 equal to its duration. Partial Segments provide a parallel channel 455 for distributing media at the live edge of the Media Playlist, where 456 the media is divided into a larger number of smaller pieces, such as 457 CMAF Chunks. These subsets are called Partial Segments. Because 458 each Partial Segment has a short duration, it can be packaged, 459 published, and added to the Media Playlist much earlier than its 460 Parent Segment. 462 A Partial Segment MUST be in one of the Supported Media Segment 463 Formats described in Section 3.1. A Partial Segment is associated 464 with a regular Media Segment, called its Parent Segment, by appearing 465 before it in the Media Playlist, and after the previous Media 466 Segment. Partial Segments are identified by the EXT-X-PART tag 467 (Section 4.4.4.9). 469 A Partial Segment MUST contain a subset of the media samples in its 470 Parent Segment. A Parent Segment and its entire set of Partial 471 Segments MUST contain the same set of media samples, with the same 472 timing and metadata. 474 Each Partial Segment has a Part Index, which is an integer indicating 475 the position of the Partial Segment within its Parent Segment. The 476 first Partial Segment has a Part Index of zero. 478 Each Partial Segment also has a Media Sequence Number, which is equal 479 to the Media Sequence Number of its Parent Segment. 481 4. Playlists 483 This section describes the Playlist files used by HTTP Live 484 Streaming. In this section, "MUST" and "MUST NOT" specify the rules 485 for the syntax and structure of legal Playlist files. Playlists that 486 violate these rules are invalid; clients MUST fail to parse them. 487 See Section 6.3.2. 489 The format of the Playlist files is derived from the M3U [M3U] 490 playlist file format and inherits two tags from that earlier file 491 format: EXTM3U (Section 4.4.1.1) and EXTINF (Section 4.4.4.1). 493 In the specification of tag syntax, a string enclosed by <> 494 identifies a tag parameter; its specific format is described in its 495 tag definition. If a parameter is further surrounded by [], it is 496 optional; otherwise, it is required. 498 Each Playlist file MUST be identifiable either by the path component 499 of its URI or by HTTP Content-Type. In the first case, the path MUST 500 end with either .m3u8 or .m3u. In the second, the HTTP Content-Type 501 MUST be "application/vnd.apple.mpegurl" or "audio/mpegurl". Clients 502 SHOULD refuse to parse Playlists that are not so identified. 504 4.1. Definition of a Playlist 506 Playlist files MUST be encoded in UTF-8 [RFC3629]. They MUST NOT 507 contain any Byte Order Mark (BOM); clients SHOULD fail to parse 508 Playlists that contain a BOM or do not parse as UTF-8. Playlist 509 files MUST NOT contain UTF-8 control characters (U+0000 to U+001F and 510 U+007F to U+009F), with the exceptions of CR (U+000D) and LF 511 (U+000A). All character sequences MUST be normalized according to 512 Unicode normalization form "NFC" [UNICODE]. Note that US-ASCII 513 [US_ASCII] conforms to these rules. 515 Lines in a Playlist file are terminated by either a single line feed 516 character or a carriage return character followed by a line feed 517 character. Each line is a URI, is blank, or starts with the 518 character '#'. Blank lines are ignored. Whitespace MUST NOT be 519 present, except for elements in which it is explicitly specified. 521 Lines that start with the character '#' are either comments or tags. 522 Tags begin with #EXT. They are case sensitive. All other lines that 523 begin with '#' are comments and SHOULD be ignored. 525 A URI line identifies a Media Segment or a Playlist file (see 526 Section 4.4.6.2). Each Media Segment is specified by a URI and the 527 tags that apply to it. 529 A Playlist is a Media Playlist if all URI lines in the Playlist 530 identify Media Segments. A Playlist is a Master Playlist if all URI 531 lines in the Playlist identify Media Playlists. A Playlist MUST be 532 either a Media Playlist or a Master Playlist; all other Playlists are 533 invalid. 535 A URI in a Playlist, whether it is a URI line or part of a tag, MAY 536 be relative. Any relative URI is considered to be relative to the 537 URI of the Playlist that contains it. 539 The duration of a Media Playlist is the sum of the durations of the 540 Media Segments within it. 542 The segment bit rate of a Media Segment is the size of the Media 543 Segment divided by its EXTINF duration (Section 4.4.4.1). Note that 544 this includes container overhead but does not include overhead 545 imposed by the delivery system, such as HTTP, TCP, or IP headers. 547 The peak segment bit rate of a Media Playlist is the largest bit rate 548 of any contiguous set of segments whose total duration is between 0.5 549 times the Target Duration and 1.5 times the Target Duration plus 0.5 550 seconds (since media segments may exceed the Target Duration by up to 551 0.5 seconds). The bit rate of a set is calculated by dividing the 552 sum of the segment sizes by the sum of the segment durations. 554 The average segment bit rate of a Media Playlist is the sum of the 555 sizes (in bits) of every Media Segment in the Media Playlist, divided 556 by the Media Playlist duration. Note that this includes container 557 overhead, but not HTTP or other overhead imposed by the delivery 558 system. 560 4.2. Attribute Lists 562 Certain tags have values that are attribute-lists. An attribute-list 563 is a comma-separated list of attribute/value pairs with no 564 whitespace. 566 An attribute/value pair has the following syntax: 568 AttributeName=AttributeValue 570 An AttributeName is an unquoted string containing characters from the 571 set [A..Z], [0..9], and '-'. Therefore, AttributeNames contain only 572 uppercase letters, not lowercase. There MUST NOT be any whitespace 573 between the AttributeName and the '=' character, nor between the '=' 574 character and the AttributeValue. 576 An AttributeValue is one of the following: 578 o decimal-integer: an unquoted string of characters from the set 579 [0..9] expressing an integer in base-10 arithmetic in the range 580 from 0 to 2^64-1 (18446744073709551615). A decimal-integer may be 581 from 1 to 20 characters long. 583 o hexadecimal-sequence: an unquoted string of characters from the 584 set [0..9] and [A..F] that is prefixed with 0x or 0X. The maximum 585 length of a hexadecimal-sequence depends on its AttributeNames. 587 o decimal-floating-point: an unquoted string of characters from the 588 set [0..9] and '.' that expresses a non-negative floating-point 589 number in decimal positional notation. 591 o signed-decimal-floating-point: an unquoted string of characters 592 from the set [0..9], '-', and '.' that expresses a signed 593 floating-point number in decimal positional notation. 595 o quoted-string: a string of characters within a pair of double 596 quotes (0x22). The following characters MUST NOT appear in a 597 quoted-string: line feed (0xA), carriage return (0xD), or double 598 quote (0x22). The string MUST be non-empty, unless specifically 599 allowed. Quoted-string AttributeValues SHOULD be constructed so 600 that byte-wise comparison is sufficient to test two quoted-string 601 AttributeValues for equality. Note that this implies case- 602 sensitive comparison. 604 o enumerated-string: an unquoted character string from a set that is 605 explicitly defined by the AttributeName. An enumerated-string 606 will never contain double quotes ("), commas (,), or whitespace. 608 o decimal-resolution: two decimal-integers separated by the "x" 609 character. The first integer is a horizontal pixel dimension 610 (width); the second is a vertical pixel dimension (height). 612 The type of the AttributeValue for a given AttributeName is specified 613 by the attribute definition. 615 A given AttributeName MUST NOT appear more than once in a given 616 attribute-list. Clients SHOULD refuse to parse such Playlists. 618 4.3. Variable Substitution 620 The following Playlist elements are subject to variable substitution: 622 o URI lines 624 o quoted-string AttributeValues 626 o hexadecimal-sequence AttributeValues 628 A Variable Reference is a string of the form "{$" (0x7B,0x24) 629 followed by a Variable Name followed by "}" (0x7D). Variable Names 630 are defined by the EXT-X-DEFINE tag (Section 4.4.2.3). 632 See Section 6.3.1 for more information about variable substitution. 634 4.4. Playlist Tags 636 Playlist tags specify either global parameters of the Playlist or 637 information about the Media Segments or Media Playlists that appear 638 after them. 640 4.4.1. Basic Tags 642 These tags are allowed in both Media Playlists and Master Playlists. 644 4.4.1.1. EXTM3U 646 The EXTM3U tag indicates that the file is an Extended M3U [M3U] 647 Playlist file. It MUST be the first line of every Media Playlist and 648 every Master Playlist. Its format is: 650 #EXTM3U 652 4.4.1.2. EXT-X-VERSION 654 The EXT-X-VERSION tag indicates the compatibility version of the 655 Playlist file, its associated media, and its server. 657 The EXT-X-VERSION tag applies to the entire Playlist file. Its 658 format is: 660 #EXT-X-VERSION: 662 where n is an integer indicating the protocol compatibility version 663 number. 665 It MUST appear in all Playlists containing tags or attributes that 666 are not compatible with protocol version 1 to support 667 interoperability with older clients. Section 7 specifies the minimum 668 value of the compatibility version number for any given Playlist 669 file. 671 A Playlist file MUST NOT contain more than one EXT-X-VERSION tag. If 672 a client encounters a Playlist with multiple EXT-X-VERSION tags, it 673 MUST fail to parse it. 675 4.4.2. Media or Master Playlist Tags 677 The tags in this section can appear in either Master Playlists or 678 Media Playlists. If one of these tags appears in a Master Playlist, 679 it SHOULD NOT appear in any Media Playlist referenced by that Master 680 Playlist. A tag that appears in both MUST have the same value; 681 otherwise, clients SHOULD ignore the value in the Media Playlist(s). 683 Tags in this section MUST NOT appear more than once in a Playlist. 684 If one does, clients MUST fail to parse the Playlist. The only 685 exception to this rule is EXT-X-DEFINE, which MAY appear more than 686 once. 688 4.4.2.1. EXT-X-INDEPENDENT-SEGMENTS 690 The EXT-X-INDEPENDENT-SEGMENTS tag indicates that all media samples 691 in a Media Segment can be decoded without information from other 692 segments. It applies to every Media Segment in the Playlist. 694 Its format is: 696 #EXT-X-INDEPENDENT-SEGMENTS 698 If the EXT-X-INDEPENDENT-SEGMENTS tag appears in a Master Playlist, 699 it applies to every Media Segment in every Media Playlist in the 700 Master Playlist. 702 4.4.2.2. EXT-X-START 704 The EXT-X-START tag indicates a preferred point at which to start 705 playing a Playlist. By default, clients SHOULD start playback at 706 this point when beginning a playback session. This tag is OPTIONAL. 708 Its format is: 710 #EXT-X-START: 712 The following attributes are defined: 714 TIME-OFFSET 716 The value of TIME-OFFSET is a signed-decimal-floating-point number 717 of seconds. A positive number indicates a time offset from the 718 beginning of the Playlist. A negative number indicates a negative 719 time offset from the end of the last Media Segment in the 720 Playlist. This attribute is REQUIRED. 722 The absolute value of TIME-OFFSET SHOULD NOT be larger than the 723 Playlist duration. If the absolute value of TIME-OFFSET exceeds 724 the duration of the Playlist, it indicates either the end of the 725 Playlist (if positive) or the beginning of the Playlist (if 726 negative). 728 If the Playlist does not contain the EXT-X-ENDLIST tag, the TIME- 729 OFFSET SHOULD NOT be within three Target Durations of the end of 730 the Playlist file. 732 PRECISE 734 The value is an enumerated-string; valid strings are YES and NO. 735 If the value is YES, clients SHOULD start playback at the Media 736 Segment containing the TIME-OFFSET, but SHOULD NOT render media 737 samples in that segment whose presentation times are prior to the 738 TIME-OFFSET. If the value is NO, clients SHOULD attempt to render 739 every media sample in that segment. This attribute is OPTIONAL. 740 If it is missing, its value should be treated as NO. 742 4.4.2.3. EXT-X-DEFINE 744 The EXT-X-DEFINE tag provides a Playlist variable definition or 745 declaration. This tag is OPTIONAL. 747 Its format is: 749 #EXT-X-DEFINE: 751 The following attributes are defined: 753 NAME 755 The value is a quoted-string which specifies the Variable Name. 756 All characters in the quoted-string MUST be from the following 757 set: [a..z], [A..Z], [0..9], '-', and '_'. 759 VALUE 761 The value is a quoted-string which specifies the Variable Value. 762 This attribute is REQUIRED if the EXT-X-DEFINE tag has a NAME 763 attribute. The quoted-string MAY be empty. 765 IMPORT 767 The value is a quoted-string which specifies the Variable Name and 768 indicates that its value is that of the variable of the same name 769 in the Master Playlist. EXT-X-DEFINE tags containing the IMPORT 770 attribute MUST NOT occur in Master Playlists; they are only 771 allowed in Media Playlists. 773 If the IMPORT attribute value does not match any Variable Name 774 declared in the Master Playlist, or if the Media Playlist was not 775 loaded from a Master Playlist, the parser MUST fail to parse the 776 Playlist. 778 An EXT-X-DEFINE tag MUST contain either a NAME or an IMPORT 779 attribute, but not both. 781 An EXT-X-DEFINE tag MUST NOT specify the same Variable Name as any 782 other EXT-X-DEFINE tag in the same Playlist. Parsers that encounter 783 duplicate Variable Name declarations MUST fail to parse the Playlist. 785 Variable Names are case-sensitive. 787 EXT-X-DEFINE tags do NOT implicitly persist across Playlist reloads. 789 4.4.3. Media Playlist Tags 791 Media Playlist tags describe global parameters of the Media Playlist. 792 There MUST NOT be more than one Media Playlist tag of each type in 793 any Media Playlist. 795 A Media Playlist tag MUST NOT appear in a Master Playlist 797 4.4.3.1. EXT-X-TARGETDURATION 799 The EXT-X-TARGETDURATION tag specifies the Target Duration, an upper 800 bound on the duration of all Media Segments in the Playlist. The 801 EXTINF duration of each Media Segment in a Playlist file, when 802 rounded to the nearest integer, MUST be less than or equal to the 803 Target Duration. Longer segments can trigger playback stalls or 804 other errors. It applies to the entire Playlist file. Its format 805 is: 807 #EXT-X-TARGETDURATION: 809 where s is a decimal-integer indicating the Target Duration in 810 seconds. The EXT-X-TARGETDURATION tag is REQUIRED. 812 4.4.3.2. EXT-X-MEDIA-SEQUENCE 814 The EXT-X-MEDIA-SEQUENCE tag indicates the Media Sequence Number of 815 the first Media Segment that appears in a Playlist file. Its format 816 is: 818 #EXT-X-MEDIA-SEQUENCE: 820 where number is a decimal-integer. 822 If the Media Playlist file does not contain an EXT-X-MEDIA-SEQUENCE 823 tag, then the Media Sequence Number of the first Media Segment in the 824 Media Playlist SHALL be considered to be 0. A client MUST NOT assume 825 that segments with the same Media Sequence Number in different Media 826 Playlists contain matching content (see Section 6.3.2). 828 A URI for a Media Segment is not required to contain its Media 829 Sequence Number. 831 See Section 6.2.1 and Section 6.3.5 for more information on setting 832 the EXT-X-MEDIA-SEQUENCE tag. 834 The EXT-X-MEDIA-SEQUENCE tag MUST appear before the first Media 835 Segment in the Playlist. 837 4.4.3.3. EXT-X-DISCONTINUITY-SEQUENCE 839 The EXT-X-DISCONTINUITY-SEQUENCE tag allows synchronization between 840 different Renditions of the same Variant Stream or different Variant 841 Streams that have EXT-X-DISCONTINUITY tags in their Media Playlists. 843 Its format is: 845 #EXT-X-DISCONTINUITY-SEQUENCE: 847 where number is a decimal-integer. 849 If the Media Playlist does not contain an EXT-X-DISCONTINUITY- 850 SEQUENCE tag, then the Discontinuity Sequence Number of the first 851 Media Segment in the Playlist SHALL be considered to be 0. 853 The EXT-X-DISCONTINUITY-SEQUENCE tag MUST appear before the first 854 Media Segment in the Playlist. 856 The EXT-X-DISCONTINUITY-SEQUENCE tag MUST appear before any EXT- 857 X-DISCONTINUITY tag. 859 See Section 6.2.1 and Section 6.2.2 for more information about 860 setting the value of the EXT-X-DISCONTINUITY-SEQUENCE tag. 862 4.4.3.4. EXT-X-ENDLIST 864 The EXT-X-ENDLIST tag indicates that no more Media Segments will be 865 added to the Media Playlist file. It MAY occur anywhere in the Media 866 Playlist file. Its format is: 868 #EXT-X-ENDLIST 870 4.4.3.5. EXT-X-PLAYLIST-TYPE 872 The EXT-X-PLAYLIST-TYPE tag provides mutability information about the 873 Media Playlist file. It applies to the entire Media Playlist file. 874 It is OPTIONAL. Its format is: 876 #EXT-X-PLAYLIST-TYPE: 878 where type-enum is either EVENT or VOD. 880 Section 6.2.1 defines the implications of the EXT-X-PLAYLIST-TYPE 881 tag. 883 If the EXT-X-PLAYLIST-TYPE value is EVENT, Media Segments can only be 884 added to the end of the Media Playlist. If the EXT-X-PLAYLIST-TYPE 885 value is Video On Demand (VOD), the Media Playlist cannot change. 887 If the EXT-X-PLAYLIST-TYPE tag is omitted from a Media Playlist, the 888 Playlist can be updated according to the rules in Section 6.2.1 with 889 no additional restrictions. For example, a live Playlist 890 (Section 6.2.2) MAY be updated to remove Media Segments in the order 891 that they appeared. 893 4.4.3.6. EXT-X-I-FRAMES-ONLY 895 The EXT-X-I-FRAMES-ONLY tag indicates that each Media Segment in the 896 Playlist describes a single I-frame. I-frames are encoded video 897 frames whose decoding does not depend on any other frame. I-frame 898 Playlists can be used for trick play, such as fast forward, rapid 899 reverse, and scrubbing. 901 The EXT-X-I-FRAMES-ONLY tag applies to the entire Playlist. Its 902 format is: 904 #EXT-X-I-FRAMES-ONLY 906 In a Playlist with the EXT-X-I-FRAMES-ONLY tag, the Media Segment 907 duration (EXTINF tag value) is the time between the presentation time 908 of the I-frame in the Media Segment and the presentation time of the 909 next I-frame in the Playlist, or the end of the presentation if it is 910 the last I-frame in the Playlist. 912 Media resources containing I-frame segments MUST begin with either a 913 Media Initialization Section (Section 3) or be accompanied by an EXT- 914 X-MAP tag indicating the Media Initialization Section so that clients 915 can load and decode I-frame segments in any order. The byte range of 916 an I-frame segment with an EXT-X-BYTERANGE tag applied to it 917 (Section 4.4.4.2) MUST NOT include its Media Initialization Section; 918 clients can assume that the Media Initialization Section is defined 919 by the EXT-X-MAP tag, or is located between the start of the resource 920 and the offset of the first I-frame segment in that resource. 922 Use of the EXT-X-I-FRAMES-ONLY REQUIRES a compatibility version 923 number of 4 or greater. 925 4.4.3.7. EXT-X-PART-INF 927 The EXT-X-PART-INF tag provides information about the Partial 928 Segments in the Playlist. It is REQUIRED if a Playlist contains one 929 or more EXT-X-PART tags. Its format is: 931 #EXT-X-PART-INF: 933 The following attributes are defined: 935 PART-TARGET 937 The value is a decimal-floating-point number of seconds indicating 938 the Part Target Duration. This attribute is REQUIRED. 940 4.4.3.8. EXT-X-SERVER-CONTROL 942 The EXT-X-SERVER-CONTROL tag allows the Server to indicate support 943 for Delivery Directives (Section 6.2.5). Its format is:. 945 #EXT-X-SERVER-CONTROL: 947 The following attributes are defined: 949 CAN-SKIP-UNTIL 951 Indicates that the Server can produce Playlist Delta Updates in 952 response to the _HLS_skip Delivery Directive. Its value is the 953 Skip Boundary, a decimal-floating-point number of seconds. The 954 Skip Boundary MUST be at least six times the Target Duration. 956 This attribute is OPTIONAL. It MAY appear in any Media Playlist. 958 CAN-SKIP-DATERANGES 960 A value of YES indicates that the Server can produce Playlist 961 Delta Updates that skip older EXT-X-DATERANGE tags in addition to 962 Media Segments. 964 This attribute is OPTIONAL. It REQUIRES the presence of the CAN- 965 SKIP-UNTIL attribute. 967 HOLD-BACK 969 The value is a decimal-floating-point number of seconds that 970 indicates the server-recommended minimum distance from the end of 971 the Playlist at which clients should begin to play or to which 972 they should seek, unless PART-HOLD-BACK applies. Its value MUST 973 be at least three times the Target Duration. 975 This attribute is OPTIONAL. Its absence implies a value of three 976 times the Target Duration. It MAY appear in any Media Playlist. 978 PART-HOLD-BACK 980 The value is a decimal-floating-point number of seconds that 981 indicates the server-recommended minimum distance from the end of 982 the Playlist at which clients should begin to play or to which 983 they should seek when playing in Low-Latency Mode. Its value MUST 984 be at least twice the Part Target Duration. Its value SHOULD be 985 at least three times the Part Target Duration. If different 986 Renditions have different Part Target Durations then PART-HOLD- 987 BACK SHOULD be at least three times the maximum Part Target 988 Duration. 990 PART-HOLD-BACK is REQUIRED if the Playlist contains the EXT-X- 991 PART-INF tag. 993 CAN-BLOCK-RELOAD 995 The value is an enumerated-string whose value is YES if the server 996 supports Blocking Playlist Reload (Section 6.2.5.2). This 997 attribute is OPTIONAL; its absence implies no support. 999 4.4.4. Media Segment Tags 1001 Each Media Segment is specified by a series of Media Segment tags 1002 followed by a URI. Some Media Segment tags apply to just the next 1003 segment; others apply to all subsequent segments until another 1004 instance of the same tag. 1006 A Media Segment tag MUST NOT appear in a Master Playlist. Clients 1007 MUST fail to parse Playlists that contain both Media Segment tags and 1008 Master Playlist tags (Section 4.4.6). 1010 4.4.4.1. EXTINF 1011 The EXTINF tag specifies the duration of a Media Segment. It applies 1012 only to the next Media Segment. This tag is REQUIRED for each Media 1013 Segment. Its format is: 1015 #EXTINF:,[] 1017 where duration is a decimal-floating-point or decimal-integer number 1018 (as described in Section 4.2) that specifies the duration of the 1019 Media Segment in seconds. Durations SHOULD be decimal-floating- 1020 point, with enough accuracy to avoid perceptible error when segment 1021 durations are accumulated. However, if the compatibility version 1022 number is less than 3, durations MUST be integers. Durations that 1023 are reported as integers SHOULD be rounded to the nearest integer. 1024 The remainder of the line following the comma is an optional human- 1025 readable informative title of the Media Segment expressed as UTF-8 1026 text. 1028 4.4.4.2. EXT-X-BYTERANGE 1030 The EXT-X-BYTERANGE tag indicates that a Media Segment is a sub-range 1031 of the resource identified by its URI. It applies only to the next 1032 URI line that follows it in the Playlist. Its format is: 1034 #EXT-X-BYTERANGE:<n>[@<o>] 1036 where n is a decimal-integer indicating the length of the sub-range 1037 in bytes. If present, o is a decimal-integer indicating the start of 1038 the sub-range, as a byte offset from the beginning of the resource. 1039 If o is not present, the sub-range begins at the next byte following 1040 the sub-range of the previous Media Segment. 1042 If o is not present, a previous Media Segment MUST appear in the 1043 Playlist file and MUST be a sub-range of the same media resource, or 1044 the Media Segment is undefined and the client MUST fail to parse the 1045 Playlist. 1047 A Media Segment without an EXT-X-BYTERANGE tag consists of the entire 1048 resource identified by its URI. 1050 Use of the EXT-X-BYTERANGE tag REQUIRES a compatibility version 1051 number of 4 or greater. 1053 4.4.4.3. EXT-X-DISCONTINUITY 1055 The EXT-X-DISCONTINUITY tag indicates a discontinuity between the 1056 Media Segment that follows it and the one that preceded it. 1058 Its format is: 1060 #EXT-X-DISCONTINUITY 1062 The EXT-X-DISCONTINUITY tag MUST be present if there is a change in 1063 any of the following characteristics: 1065 o file format 1067 o number, type, and identifiers of tracks 1069 o timestamp sequence 1071 The EXT-X-DISCONTINUITY tag SHOULD be present if there is a change in 1072 any of the following characteristics: 1074 o encoding parameters 1076 o encoding sequence 1078 See Section 3, Section 6.2.1, and Section 6.3.3 for more information 1079 about the EXT-X-DISCONTINUITY tag. 1081 4.4.4.4. EXT-X-KEY 1083 Media Segments MAY be encrypted. The EXT-X-KEY tag specifies how to 1084 decrypt them. It applies to every Media Segment and to every Media 1085 Initialization Section declared by an EXT-X-MAP tag that appears 1086 between it and the next EXT-X-KEY tag in the Playlist file with the 1087 same KEYFORMAT attribute or a METHOD of NONE (or the end of the 1088 Playlist file). Any Media Segment or Media Initialization 1089 Section that precedes the first EXT-X-KEY tag is unencrypted. Two or 1090 more EXT-X-KEY tags with different KEYFORMAT attributes MAY apply to 1091 the same Media Segment if they ultimately produce the same decryption 1092 key. The format is: 1094 #EXT-X-KEY:<attribute-list> 1096 The following attributes are defined: 1098 METHOD 1100 The value is an enumerated-string that specifies the encryption 1101 method. This attribute is REQUIRED. 1103 The methods defined are: NONE, AES-128, and SAMPLE-AES. 1105 An encryption method of NONE means that Media Segments are not 1106 encrypted. If the encryption method is NONE, other attributes 1107 MUST NOT be present. 1109 An encryption method of AES-128 signals that Media Segments are 1110 completely encrypted using the Advanced Encryption Standard (AES) 1111 [AES_128] with a 128-bit key, Cipher Block Chaining (CBC), and 1112 Public-Key Cryptography Standards #7 (PKCS7) padding [RFC5652]. 1113 CBC is restarted on each segment boundary, using either the 1114 Initialization Vector (IV) attribute value or the Media Sequence 1115 Number as the IV; see Section 5.2. 1117 An alternative to whole-segment encryption is Sample Encryption. 1118 With Sample Encryption, only media sample data - such as audio 1119 packets or video frames - is encrypted. The rest of the Media 1120 Segment is unencrypted. Sample Encryption allows parts of the 1121 Segment to be processed without (or before) decrypting the media 1122 itself. 1124 An encryption method of SAMPLE-AES means that the Media Segments 1125 are Sample Encrypted using the Advanced Encryption Standard 1126 [AES_128]. How these media streams are encrypted and encapsulated 1127 in a segment depends on the media encoding and the media format of 1128 the segment. fMP4 Media Segments are encrypted using the 'cbcs' 1129 scheme of Common Encryption [COMMON_ENC]. Encryption of other 1130 Media Segment formats containing H.264 [H_264], AAC [ISO_14496], 1131 AC-3 [AC_3], and Enhanced AC-3 [AC_3] media streams is described 1132 in the HTTP Live Streaming (HLS) Sample Encryption specification 1133 [SampleEnc]. The IV attribute MAY be present; see Section 5.2. 1135 URI 1137 The value is a quoted-string containing a URI that specifies how 1138 to obtain the key. This attribute is REQUIRED unless the METHOD 1139 is NONE. 1141 IV 1143 The value is a hexadecimal-sequence that specifies a 128-bit 1144 unsigned integer Initialization Vector to be used with the key. 1145 Use of the IV attribute REQUIRES a compatibility version number of 1146 2 or greater. See Section 5.2 for when the IV attribute is used. 1148 KEYFORMAT 1150 The value is a quoted-string that specifies how the key is 1151 represented in the resource identified by the URI; see Section 5 1152 for more detail. This attribute is OPTIONAL; its absence 1153 indicates an implicit value of "identity". Use of the KEYFORMAT 1154 attribute REQUIRES a compatibility version number of 5 or greater. 1156 KEYFORMATVERSIONS 1158 The value is a quoted-string containing one or more positive 1159 integers separated by the "/" character (for example, "1", "1/2", 1160 or "1/2/5"). If more than one version of a particular KEYFORMAT 1161 is defined, this attribute can be used to indicate which 1162 version(s) this instance complies with. This attribute is 1163 OPTIONAL; if it is not present, its value is considered to be "1". 1164 Use of the KEYFORMATVERSIONS attribute REQUIRES a compatibility 1165 version number of 5 or greater. 1167 If the Media Playlist file does not contain an EXT-X-KEY tag, then 1168 Media Segments are not encrypted. 1170 See Section 5 for the format of the Key file, and Section 5.2, 1171 Section 6.2.3, and Section 6.3.6 for additional information on Media 1172 Segment encryption. 1174 4.4.4.5. EXT-X-MAP 1176 The EXT-X-MAP tag specifies how to obtain the Media Initialization 1177 Section (Section 3) required to parse the applicable Media Segments. 1178 It applies to every Media Segment that appears after it in the 1179 Playlist until the next EXT-X-MAP tag or until the end of the 1180 Playlist. 1182 Its format is: 1184 #EXT-X-MAP:<attribute-list> 1186 The following attributes are defined: 1188 URI 1190 The value is a quoted-string containing a URI that identifies a 1191 resource that contains the Media Initialization Section. This 1192 attribute is REQUIRED. 1194 BYTERANGE 1196 The value is a quoted-string specifying a byte range into the 1197 resource identified by the URI attribute. This range SHOULD 1198 contain only the Media Initialization Section. The format of the 1199 byte range is described in Section 4.4.4.2. This attribute is 1200 OPTIONAL; if it is not present, the byte range is the entire 1201 resource indicated by the URI. 1203 An EXT-X-MAP tag SHOULD be supplied for Media Segments in Playlists 1204 with the EXT-X-I-FRAMES-ONLY tag when the first Media Segment (i.e., 1205 I-frame) in the Playlist (or the first segment following an EXT- 1206 X-DISCONTINUITY tag) does not immediately follow the Media 1207 Initialization Section at the beginning of its resource. 1209 Use of the EXT-X-MAP tag in a Media Playlist that contains the EXT- 1210 X-I-FRAMES-ONLY tag REQUIRES a compatibility version number of 5 or 1211 greater. Use of the EXT-X-MAP tag in a Media Playlist that DOES NOT 1212 contain the EXT-X-I-FRAMES-ONLY tag REQUIRES a compatibility version 1213 number of 6 or greater. 1215 If the Media Initialization Section declared by an EXT-X-MAP tag is 1216 encrypted with a METHOD of AES-128, the IV attribute of the EXT-X-KEY 1217 tag that applies to the EXT-X-MAP is REQUIRED. 1219 4.4.4.6. EXT-X-PROGRAM-DATE-TIME 1221 The EXT-X-PROGRAM-DATE-TIME tag associates the first sample of a 1222 Media Segment with an absolute date and/or time. It applies only to 1223 the next Media Segment. Its format is: 1225 #EXT-X-PROGRAM-DATE-TIME:<date-time-msec> 1227 where date-time-msec is an ISO/IEC 8601:2004 [ISO_8601] date/time 1228 representation, such as YYYY-MM-DDThh:mm:ss.SSSZ. It SHOULD indicate 1229 a time zone and fractional parts of seconds, to at least millisecond 1230 accuracy. 1232 For example: 1234 #EXT-X-PROGRAM-DATE-TIME:2010-02-19T14:54:23.031+08:00 1236 See Section 6.2.1 and Section 6.3.3 for more information on the EXT- 1237 X-PROGRAM-DATE-TIME tag. 1239 4.4.4.7. EXT-X-GAP 1241 The EXT-X-GAP tag indicates that the segment URI to which it applies 1242 does not contain media data and SHOULD NOT be loaded by clients. It 1243 applies only to the next Media Segment. 1245 Its format is: 1247 #EXT-X-GAP 1248 See Section 6.2.1 and Section 6.3.3 for more information on the EXT- 1249 X-GAP tag. 1251 4.4.4.8. EXT-X-BITRATE 1253 The EXT-X-BITRATE tag identifies the approximate segment bit rate of 1254 the Media Segment(s) to which it applies. It applies to every Media 1255 Segment between it and the next EXT-X-BITRATE tag in the Playlist 1256 file (or the end of the Playlist file) that does not have an EXT- 1257 X-BYTERANGE tag applied to it. Its format is: 1259 #EXT-X-BITRATE:<rate> 1261 where rate is a decimal-integer of kilobits per second. 1263 This tag is OPTIONAL. If it is present then its value MUST be no 1264 less than 90% of the segment bit rate of each Media Segment to which 1265 it is applied and no greater than 110% of the segment bit rate of 1266 each Media Segment to which it is applied. 1268 4.4.4.9. EXT-X-PART 1270 The EXT-X-PART tag identifies a Partial Segment. It is OPTIONAL. 1271 Its format is: 1273 #EXT-X-PART:<attribute-list> 1275 The following attributes are defined: 1277 URI 1279 The value is the URI for the Partial Segment. This attribute is 1280 REQUIRED. 1282 DURATION 1284 The value is the duration of the Partial Segment as a decimal- 1285 floating-point number of seconds. This attribute is REQUIRED. 1287 INDEPENDENT 1289 The value is an enumerated-string whose value is YES if the 1290 Partial Segment contains an independent frame. This attribute is 1291 OPTIONAL; however every Partial Segment containing an independent 1292 frame SHOULD carry it to increase the efficiency with which 1293 clients can join and switch Renditions. 1295 BYTERANGE 1296 Indicates that the Partial Segment is a subrange of the resource 1297 specified by the URI attribute. The value is a quoted-string 1298 whose contents have the same format as the EXT-X-BYTERANGE tag: 1299 "<n>[@<o>]". 1301 GAP 1303 The value is an enumerated-string whose value is YES if the 1304 Partial Segment is not available. It is REQUIRED for such Partial 1305 Segments. 1307 All Media Segment Tags (Section 4.4.4) except for EXT-X-BYTERANGE and 1308 EXT-X-GAP that are applied to a Parent Segment MUST appear before the 1309 first EXT-X-PART tag of that Parent Segment. 1311 The duration of a Partial Segment MUST be less than or equal to the 1312 Part Target Duration. The duration of each Partial Segment MUST be 1313 at least 85% of the Part Target Duration, with the exception of 1314 Partial Segments with the INDEPENDENT=YES attribute and the final 1315 Partial Segment of any Parent Segment. 1317 4.4.5. Media Metadata Tags 1319 Media Metadata tags provide information about the playlist that is 1320 not associated with specific Media Segments. There MAY be more than 1321 one Media Metadata tag of each type in any Media Playlist. The only 1322 exception to this rule is EXT-X-SKIP, which MUST NOT appear more than 1323 once. 1325 4.4.5.1. EXT-X-DATERANGE 1327 The EXT-X-DATERANGE tag associates a Date Range (i.e., a range of 1328 time defined by a starting and ending date) with a set of attribute/ 1329 value pairs. Its format is: 1331 #EXT-X-DATERANGE:<attribute-list> 1333 where the defined attributes are: 1335 ID 1337 A quoted-string that uniquely identifies a Date Range in the 1338 Playlist. This attribute is REQUIRED. 1340 CLASS 1342 A client-defined quoted-string that specifies some set of 1343 attributes and their associated value semantics. All Date Ranges 1344 with the same CLASS attribute value MUST adhere to these 1345 semantics. This attribute is OPTIONAL. 1347 START-DATE 1349 A quoted-string containing the [ISO_8601] date/time at which the 1350 Date Range begins. This attribute is REQUIRED. 1352 END-DATE 1354 A quoted-string containing the [ISO_8601] date/time at which the 1355 Date Range ends. It MUST be equal to or later than the value of 1356 the START-DATE attribute. This attribute is OPTIONAL. 1358 DURATION 1360 The duration of the Date Range expressed as a decimal-floating- 1361 point number of seconds. It MUST NOT be negative. A single 1362 instant in time (e.g., crossing a finish line) SHOULD be 1363 represented with a duration of 0. This attribute is OPTIONAL. 1365 PLANNED-DURATION 1367 The expected duration of the Date Range expressed as a decimal- 1368 floating-point number of seconds. It MUST NOT be negative. This 1369 attribute SHOULD be used to indicate the expected duration of a 1370 Date Range whose actual duration is not yet known. It is 1371 OPTIONAL. 1373 X-<client-attribute> 1375 The "X-" prefix defines a namespace reserved for client-defined 1376 attributes. The client-attribute MUST be a legal AttributeName. 1377 Clients SHOULD use a reverse-DNS syntax when defining their own 1378 attribute names to avoid collisions. The attribute value MUST be 1379 a quoted-string, a hexadecimal-sequence, or a decimal-floating- 1380 point. An example of a client-defined attribute is X-COM-EXAMPLE- 1381 AD-ID="XYZ123". These attributes are OPTIONAL. 1383 SCTE35-CMD, SCTE35-OUT, SCTE35-IN 1385 Used to carry SCTE-35 data; see Section 4.4.5.1.1 for more 1386 information. These attributes are OPTIONAL. 1388 END-ON-NEXT 1390 An enumerated-string whose value MUST be YES. This attribute 1391 indicates that the end of the range containing it is equal to the 1392 START-DATE of its Following Range. The Following Range is the 1393 Date Range of the same CLASS that has the earliest START-DATE 1394 after the START-DATE of the range in question. This attribute is 1395 OPTIONAL. 1397 An EXT-X-DATERANGE tag with an END-ON-NEXT=YES attribute MUST have a 1398 CLASS attribute. Other EXT-X-DATERANGE tags with the same CLASS 1399 attribute MUST NOT specify Date Ranges that overlap. 1401 An EXT-X-DATERANGE tag with an END-ON-NEXT=YES attribute MUST NOT 1402 contain DURATION or END-DATE attributes. 1404 A Date Range with neither a DURATION, an END-DATE, nor an END-ON- 1405 NEXT=YES attribute has an unknown duration, even if it has a PLANNED- 1406 DURATION. 1408 If a Playlist contains an EXT-X-DATERANGE tag, it MUST also contain 1409 at least one EXT-X-PROGRAM-DATE-TIME tag. 1411 If a Playlist contains two EXT-X-DATERANGE tags with the same ID 1412 attribute value, then any AttributeName that appears in both tags 1413 MUST have the same AttributeValue. 1415 If a Date Range contains both a DURATION attribute and an END-DATE 1416 attribute, the value of the END-DATE attribute MUST be equal to the 1417 value of the START-DATE attribute plus the value of the DURATION 1418 attribute. 1420 Clients SHOULD ignore EXT-X-DATERANGE tags with illegal syntax. 1422 4.4.5.1.1. Mapping SCTE-35 into EXT-X-DATERANGE 1424 Splice information carried in source media according to the SCTE-35 1425 specification [SCTE35] MAY be represented in a Media Playlist using 1426 EXT-X-DATERANGE tags. 1428 Each SCTE-35 splice_info_section() containing a splice_null(), 1429 splice_schedule(), bandwidth_reservation(), or private_cmd() SHOULD 1430 be represented by an EXT-X-DATERANGE tag with an SCTE35-CMD attribute 1431 whose value is the big-endian binary representation of the 1432 splice_info_section(), expressed as a hexadecimal-sequence. 1434 An SCTE-35 splice out/in pair signaled by a pair of splice_insert() 1435 commands SHOULD be represented by one or more EXT-X-DATERANGE tags 1436 carrying the same ID attribute, which MUST be unique to that splice 1437 out/in pair. The "out" splice_info_section() (with 1438 out_of_network_indicator set to 1) MUST be placed in an SCTE35-OUT 1439 attribute, with the same formatting as SCTE35-CMD. The "in" 1440 splice_info_section() (with out_of_network_indicator set to 0) MUST 1441 be placed in an SCTE35-IN attribute, with the same formatting as 1442 SCTE35-CMD. 1444 An SCTE-35 splice out/in pair signaled by a pair of time_signal() 1445 commands, each carrying a single segmentation_descriptor(), SHOULD be 1446 represented by one or more EXT-X-DATERANGE tags carrying the same ID 1447 attribute, which MUST be unique to that splice out/in pair. The 1448 "out" splice_info_section() MUST be placed in an SCTE35-OUT 1449 attribute; the "in" splice_info_section() MUST be placed in an 1450 SCTE35-IN attribute. 1452 Different types of segmentation, as indicated by the 1453 segmentation_type_id in the segmentation_descriptor(), SHOULD be 1454 represented by separate EXT-X-DATERANGE tags, even if two or more 1455 segmentation_descriptor()s arrive in the same splice_info_section(). 1456 In that case, each EXT-X-DATERANGE tag will have an SCTE35-OUT, 1457 SCTE35-IN, or SCTE35-CMD attribute whose value is the entire 1458 splice_info_section(). 1460 An SCTE-35 time_signal() command that does not signal a splice out or 1461 in point SHOULD be represented by an EXT-X-DATERANGE tag with an 1462 SCTE35-CMD attribute. 1464 The START-DATE of an EXT-X-DATERANGE tag containing an SCTE35-OUT 1465 attribute MUST be the date and time that corresponds to the program 1466 time of that splice. 1468 The START-DATE of an EXT-X-DATERANGE tag containing an SCTE35-CMD 1469 MUST be the date and time specified by the splice_time() in the 1470 command or the program time at which the command appeared in the 1471 source stream if the command does not specify a splice_time(). 1473 An EXT-X-DATERANGE tag containing an SCTE35-OUT attribute MAY contain 1474 a PLANNED-DURATION attribute. Its value MUST be the planned duration 1475 of the splice. 1477 The DURATION of an EXT-X-DATERANGE tag containing an SCTE35-IN 1478 attribute MUST be the actual (not planned) program duration between 1479 the corresponding out-point and that in-point. 1481 The END-DATE of an EXT-X-DATERANGE tag containing an SCTE35-IN 1482 attribute MUST be the actual (not planned) program date and time of 1483 that in-point. 1485 If the actual end date and time is not known when an SCTE35-OUT 1486 attribute is added to the Playlist, the DURATION attribute and the 1487 END-TIME attribute MUST NOT be present; the actual end date of the 1488 splice SHOULD be signaled by another EXT-X-DATERANGE tag once it has 1489 been established. 1491 A canceled splice SHOULD NOT appear in the Playlist as an EXT- 1492 X-DATERANGE tag. 1494 An EXT-X-DATERANGE tag announcing a splice SHOULD be added to a 1495 Playlist at the same time as the last pre-splice Media Segment, or 1496 earlier if possible. 1498 The ID attribute of an EXT-X-DATERANGE tag MAY contain a 1499 splice_event_id and/or a segmentation_event_id, but it MUST be unique 1500 in the Playlist. If there is a possibility that an SCTE-35 id will 1501 be reused, the ID attribute value MUST include disambiguation, such 1502 as a date or sequence number. 1504 4.4.5.2. EXT-X-SKIP 1506 A server produces a Playlist Delta Update (Section 6.2.5.1), by 1507 replacing tags earlier than the Skip Boundary with an EXT-X-SKIP tag. 1509 When replacing Media Segments, the EXT-X-SKIP tag replaces the 1510 segment URI lines and all Media Segment Tags tags that are applied to 1511 those segments. This tag MUST NOT appear more than once in a 1512 Playlist 1514 Its format is: 1516 #EXT-X-SKIP:<attribute-list> 1518 The following attributes are defined: 1520 SKIPPED-SEGMENTS 1522 The value is the count of Media Segments were replaced by the EXT- 1523 X-SKIP tag. This attribute is REQUIRED. 1525 RECENTLY-REMOVED-DATERANGES 1527 The value is a quoted-string consisting of a tab (0x9) delimited 1528 list of EXT-X-DATERANGE IDs that have been removed from the 1529 Playlist recently. See Section 6.2.5.1 for more information. 1530 This attribute is REQUIRED if the Client requested an update that 1531 skips EXT-X-DATERANGE tags. The quoted-string MAY be empty. 1533 4.4.5.3. EXT-X-PRELOAD-HINT 1535 The EXT-X-PRELOAD-HINT tag allows a Client loading media from a live 1536 stream to reduce the time to obtain a resource from the Server by 1537 issuing its request before the resource is available to be delivered. 1538 The server will hold onto the request ("block") until it can respond. 1540 Its format is: 1542 #EXT-X-PRELOAD-HINT:<attribute-list> 1544 The following attributes are defined: 1546 TYPE 1548 The value is an enumerated-string that specifies the type of the 1549 hinted resource. If the value is PART, the resource is a Partial 1550 Segment. If the value is MAP, the resource is a Media 1551 Initialization Section. This attribute is REQUIRED. 1553 URI 1555 The value is a URI identifying the hinted resource. It MUST match 1556 the URI that will be subsequently added to the Playlist as a non- 1557 hinted resource (for example, the URI of an EXT-X-PART tag). The 1558 URI MAY be relative to the URI of the Playlist or it MAY be 1559 absolute. The hostname MAY differ from the hostname of the 1560 Playlist URI. This attribute is REQUIRED. 1562 BYTERANGE-START 1564 The value is a decimal-integer specifying the byte offset of the 1565 first byte of the hinted resource, from the beginning of the 1566 resource identified by the URI attribute. This attribute is 1567 OPTIONAL. Its absence implies a value of 0. 1569 BYTERANGE-LENGTH 1571 The value is a decimal-integer specifying the length of the hinted 1572 resource. This attribute is OPTIONAL. Its absence indicates that 1573 the last byte of the hinted resource is the last byte of the 1574 resource identified by the URI attribute. In this case, you 1575 SHOULD use the recommended last-byte-pos [RFC8673] value of 1576 2^^53-1 (9007199254740991) in the HTTP Range request. 1578 Note that when a hinted Partial Segment eventually appears in the 1579 Playlist as an EXT-X-PART tag, it MAY have a different Discontinuity 1580 Sequence Number, Media Initialization Section, or encryption 1581 configuration. In other words, the Partial Segment can be preceded 1582 by an EXTINF tag indicating the end of the previous Parent Segment 1583 and an EXT-X-DISCONTINUITY, EXT-X-MAP, or EXT-X-KEY tag. 1585 A Playlist containing an EXT-X-ENDLIST tag MUST NOT contain an EXT-X- 1586 PRELOAD-HINT tag. 1588 4.4.5.4. EXT-X-RENDITION-REPORT 1590 The EXT-X-RENDITION-REPORT tag carries information about an 1591 associated Rendition that is as up-to-date as the Playlist that 1592 contains it. Its format is: 1594 #EXT-X-RENDITION-REPORT:<attribute-list> 1596 The following attributes are defined: 1598 URI 1600 The value is the URI for the Media Playlist of the specified 1601 Rendition. It MUST be relative to the URI of the Media Playlist 1602 containing the EXT-X-RENDITION-REPORT tag. This attribute is 1603 REQUIRED. 1605 LAST-MSN 1607 The value is a decimal-integer specifying the Media Sequence 1608 Number of the last Media Segment currently in the specified 1609 Rendition. If the Rendition contains Partial Segments then this 1610 value is the Media Sequence Number of the last Partial Segment. 1611 This attribute is REQUIRED. 1613 LAST-PART 1615 The value is a decimal-integer that indicates the Part Index of 1616 the last Partial Segment currently in the specified Rendition 1617 whose Media Sequence Number is equal to the LAST-MSN attribute 1618 value. This attribute is REQUIRED if the Rendition contains a 1619 Partial Segment. 1621 A server MAY omit adding an attribute to an EXT-X-RENDITION-REPORT 1622 tag - even a mandatory attribute - if its value is the same as that 1623 of the Rendition Report of the Media Playlist to which the EXT-X- 1624 RENDITION-REPORT tag is being added. Doing so reduces the size of 1625 the Rendition Report. 1627 4.4.6. Master Playlist Tags 1629 Master Playlist tags define the Variant Streams, Renditions, and 1630 other global parameters of the presentation. 1632 Master Playlist tags MUST NOT appear in a Media Playlist; clients 1633 MUST fail to parse any Playlist that contains both a Master Playlist 1634 tag and either a Media Playlist tag or a Media Segment tag. 1636 4.4.6.1. EXT-X-MEDIA 1638 The EXT-X-MEDIA tag is used to relate Media Playlists that contain 1639 alternative Renditions (Section 4.4.6.2.1) of the same content. For 1640 example, three EXT-X-MEDIA tags can be used to identify audio-only 1641 Media Playlists that contain English, French, and Spanish Renditions 1642 of the same presentation. Or, two EXT-X-MEDIA tags can be used to 1643 identify video-only Media Playlists that show two different camera 1644 angles. 1646 Its format is: 1648 #EXT-X-MEDIA:<attribute-list> 1650 The following attributes are defined: 1652 TYPE 1654 The value is an enumerated-string; valid strings are AUDIO, VIDEO, 1655 SUBTITLES, and CLOSED-CAPTIONS. This attribute is REQUIRED. 1657 Typically, closed-caption [CEA608] media is carried in the video 1658 stream. Therefore, an EXT-X-MEDIA tag with TYPE of CLOSED- 1659 CAPTIONS does not specify a Rendition; the closed-caption media is 1660 present in the Media Segments of every video Rendition. 1662 URI 1664 The value is a quoted-string containing a URI that identifies the 1665 Media Playlist file. This attribute is OPTIONAL; see 1666 Section 4.4.6.2.1. If the TYPE is CLOSED-CAPTIONS, the URI 1667 attribute MUST NOT be present. 1669 GROUP-ID 1671 The value is a quoted-string that specifies the group to which the 1672 Rendition belongs. See Section 4.4.6.1.1. This attribute is 1673 REQUIRED. 1675 LANGUAGE 1677 The value is a quoted-string containing one of the standard Tags 1678 for Identifying Languages [RFC5646], which identifies the primary 1679 language used in the Rendition. This attribute is OPTIONAL. 1681 ASSOC-LANGUAGE 1683 The value is a quoted-string containing a language tag [RFC5646] 1684 that identifies a language that is associated with the Rendition. 1685 An associated language is often used in a different role than the 1686 language specified by the LANGUAGE attribute (e.g., written versus 1687 spoken, or a fallback dialect). This attribute is OPTIONAL. 1689 NAME 1691 The value is a quoted-string containing a human-readable 1692 description of the Rendition. If the LANGUAGE attribute is 1693 present, then this description SHOULD be in that language. This 1694 attribute is REQUIRED. 1696 STABLE-RENDITION-ID 1698 The value is a quoted-string which is a stable identifier for the 1699 URI within the Master Playlist. All characters in the quoted- 1700 string MUST be from the following set: [a..z], [A..Z], [0..9], 1701 '+', '/', '=', '.', '-', and '_'. This attribute is OPTIONAL. 1703 The STABLE-RENDITION-ID allows the URI of a Rendition to change 1704 between two distinct downloads of the Master Playlist. IDs are 1705 matched using a byte-for-byte comparison. 1707 DEFAULT 1709 The value is an enumerated-string; valid strings are YES and NO. 1710 If the value is YES, then the client SHOULD play this Rendition of 1711 the content in the absence of information from the user indicating 1712 a different choice. This attribute is OPTIONAL. Its absence 1713 indicates an implicit value of NO. 1715 AUTOSELECT 1717 The value is an enumerated-string; valid strings are YES and NO. 1718 This attribute is OPTIONAL. Its absence indicates an implicit 1719 value of NO. If the value is YES, then the client MAY choose to 1720 play this Rendition in the absence of explicit user preference 1721 because it matches the current playback environment, such as 1722 chosen system language. 1724 If the AUTOSELECT attribute is present, its value MUST be YES if 1725 the value of the DEFAULT attribute is YES. 1727 FORCED 1729 The value is an enumerated-string; valid strings are YES and NO. 1730 This attribute is OPTIONAL. Its absence indicates an implicit 1731 value of NO. The FORCED attribute MUST NOT be present unless the 1732 TYPE is SUBTITLES. 1734 A value of YES indicates that the Rendition contains content that 1735 is considered essential to play. When selecting a FORCED 1736 Rendition, a client SHOULD choose the one that best matches the 1737 current playback environment (e.g., language). 1739 A value of NO indicates that the Rendition contains content that 1740 is intended to be played in response to explicit user request. 1742 INSTREAM-ID 1744 The value is a quoted-string that specifies a Rendition within the 1745 segments in the Media Playlist. This attribute is REQUIRED if the 1746 TYPE attribute is CLOSED-CAPTIONS, in which case it MUST have one 1747 of the values: "CC1", "CC2", "CC3", "CC4", or "SERVICEn" where n 1748 MUST be an integer between 1 and 63 (e.g., "SERVICE9" or 1749 "SERVICE42"). 1751 The values "CC1", "CC2", "CC3", and "CC4" identify a Line 21 Data 1752 Services channel [CEA608]. The "SERVICE" values identify a 1753 Digital Television Closed Captioning [CEA708] service block 1754 number. 1756 For all other TYPE values, the INSTREAM-ID MUST NOT be specified. 1758 CHARACTERISTICS 1760 The value is a quoted-string containing one or more Media 1761 Characteristic Tags (MCTs) separated by comma (,) characters. A 1762 Media Characteristic Tag has the same format as the payload of a 1763 media characteristic tag atom [MCT] This attribute is OPTIONAL. 1764 Each MCT indicates an individual characteristic of the Rendition. 1766 A SUBTITLES Rendition MAY include the following characteristics: 1767 "public.accessibility.transcribes-spoken-dialog", 1768 "public.accessibility.describes-music-and-sound", and 1769 "public.easy-to-read" (which indicates that the subtitles have 1770 been edited for ease of reading). 1772 An AUDIO Rendition MAY include the following characteristic: 1773 "public.accessibility.describes-video". 1775 The CHARACTERISTICS attribute MAY include private MCTs. 1777 CHANNELS 1779 The value is a quoted-string that specifies an ordered, slash- 1780 separated ("/") list of parameters. 1782 If the TYPE attribute is AUDIO, then the first parameter is a 1783 count of audio channels expressed as a decimal-integer, indicating 1784 the maximum number of independent, simultaneous audio channels 1785 present in any Media Segment in the Rendition. For example, an 1786 AC-3 5.1 Rendition would have a CHANNELS="6" attribute. 1788 If the TYPE attribute is AUDIO, then the second parameter 1789 identifies the encoding of object-based audio used by the 1790 Rendition. This parameter is a comma-separated list of Audio 1791 Object Coding Identifiers. It is optional. An Audio Object 1792 Coding Identifier is a string containing characters from the set 1793 [A..Z], [0..9], and '-'. They are codec-specific. A parameter 1794 value of consisting solely of the dash character (0x2D) indicates 1795 that the audio is not object-based. 1797 No other CHANNELS parameters are currently defined. 1799 All audio EXT-X-MEDIA tags SHOULD have a CHANNELS attribute. If a 1800 Master Playlist contains two Renditions with the same NAME encoded 1801 with the same codec but a different number of channels, then the 1802 CHANNELS attribute is REQUIRED; otherwise, it is OPTIONAL. 1804 The LANGUAGE and ASSOC-LANGUAGE attributes can be used, for example, 1805 to link Norwegian Renditions that use different spoken and written 1806 languages: 1808 #EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subtitles", 1809 NAME="Bokmael",AUTOSELECT=YES,LANGUAGE="nb", 1810 ASSOC-LANGUAGE="no",URI="nb-subtitles.m3u8" 1812 This allows automatic selection of the Bokmael subtitles in this 1813 Media Playlist when the user picks an audio variant in Norwegian. 1815 4.4.6.1.1. Rendition Groups 1817 A set of one or more EXT-X-MEDIA tags with the same GROUP-ID value 1818 and the same TYPE value defines a Group of Renditions. Each member 1819 of the Group MUST be an alternative Rendition of the same content; 1820 otherwise, playback errors can occur. 1822 All EXT-X-MEDIA tags in a Playlist MUST meet the following 1823 constraints: 1825 o All EXT-X-MEDIA tags in the same Group MUST have different NAME 1826 attributes. 1828 o A Group MUST NOT have more than one member with a DEFAULT 1829 attribute of YES. 1831 o Each EXT-X-MEDIA tag with an AUTOSELECT=YES attribute SHOULD have 1832 a combination of LANGUAGE [RFC5646], ASSOC-LANGUAGE, FORCED, and 1833 CHARACTERISTICS attributes that is distinct from those of other 1834 AUTOSELECT=YES members of its Group. 1836 A Playlist MAY contain multiple Groups of the same TYPE in order to 1837 provide multiple encodings of that media type. If it does so, each 1838 Group of the same TYPE MUST have the same set of members, and each 1839 corresponding member MUST have identical attributes with the 1840 exception of the URI and CHANNELS attributes. 1842 Each member in a Group of Renditions MAY have a different sample 1843 format. For example, an English Rendition can be encoded with AC-3 1844 5.1 while a Spanish Rendition is encoded with AAC stereo. However, 1845 any EXT-X-STREAM-INF tag (Section 4.4.6.2) or EXT-X-I-FRAME-STREAM- 1846 INF tag (Section 4.4.6.3) that references such a Group MUST have a 1847 CODECS attribute that lists every sample format present in any 1848 Rendition in the Group, or client playback failures can occur. In 1849 the example above, the CODECS attribute would include 1850 "ac-3,mp4a.40.2". 1852 4.4.6.2. EXT-X-STREAM-INF 1854 The EXT-X-STREAM-INF tag specifies a Variant Stream, which is a set 1855 of Renditions that can be combined to play the presentation. The 1856 attributes of the tag provide information about the Variant Stream. 1858 The URI line that follows the EXT-X-STREAM-INF tag specifies a Media 1859 Playlist that carries a Rendition of the Variant Stream. The URI 1860 line is REQUIRED. Clients that do not support multiple video 1861 Renditions SHOULD play this Rendition. 1863 Its format is: 1865 #EXT-X-STREAM-INF:<attribute-list> 1866 <URI> 1867 The following attributes are defined: 1869 BANDWIDTH 1871 The value is a decimal-integer of bits per second. It represents 1872 the peak segment bit rate of the Variant Stream. 1874 If all the Media Segments in a Variant Stream have already been 1875 created, the BANDWIDTH value MUST be the largest sum of peak 1876 segment bit rates that is produced by any playable combination of 1877 Renditions. (For a Variant Stream with a single Media Playlist, 1878 this is just the peak segment bit rate of that Media Playlist.) 1879 An inaccurate value can cause playback stalls or prevent clients 1880 from playing the variant. 1882 If the Master Playlist is to be made available before all Media 1883 Segments in the presentation have been encoded, the BANDWIDTH 1884 value SHOULD be the BANDWIDTH value of a representative period of 1885 similar content, encoded using the same settings. 1887 Every EXT-X-STREAM-INF tag MUST include the BANDWIDTH attribute. 1889 AVERAGE-BANDWIDTH 1891 The value is a decimal-integer of bits per second. It represents 1892 the average segment bit rate of the Variant Stream. 1894 If all the Media Segments in a Variant Stream have already been 1895 created, the AVERAGE-BANDWIDTH value MUST be the largest sum of 1896 average segment bit rates that is produced by any playable 1897 combination of Renditions. (For a Variant Stream with a single 1898 Media Playlist, this is just the average segment bit rate of that 1899 Media Playlist.) An inaccurate value can cause playback stalls or 1900 prevent clients from playing the variant. 1902 If the Master Playlist is to be made available before all Media 1903 Segments in the presentation have been encoded, the AVERAGE- 1904 BANDWIDTH value SHOULD be the AVERAGE-BANDWIDTH value of a 1905 representative period of similar content, encoded using the same 1906 settings. 1908 The AVERAGE-BANDWIDTH attribute is OPTIONAL. 1910 SCORE 1912 The value is a positive decimal-floating-point number. It is an 1913 abstract, relative measure of the playback quality-of-experience 1914 of the Variant Stream. 1916 The value can be based on any metric or combination of metrics 1917 that can be consistently applied to all Variant Streams. The 1918 value SHOULD consider all media in the Variant Stream, including 1919 video, audio and subtitles. A Variant Stream with a SCORE 1920 attribute MUST be considered by the Playlist author to be more 1921 desirable than any Variant Stream with a lower SCORE attribute in 1922 the same Master Playlist. 1924 The SCORE attribute is OPTIONAL, but if any Variant Stream 1925 contains the SCORE attribute, then all Variant Streams in the 1926 Master Playlist SHOULD have a SCORE attribute. See Section 6.3.1 1927 for more information. 1929 CODECS 1931 The value is a quoted-string containing a comma-separated list of 1932 formats, where each format specifies a media sample type that is 1933 present in one or more Renditions specified by the Variant Stream. 1934 Valid format identifiers are those in the ISO Base Media File 1935 Format Name Space defined by "The 'Codecs' and 'Profiles' 1936 Parameters for "Bucket" Media Types" [RFC6381]. 1938 For example, a stream containing AAC low complexity (AAC-LC) audio 1939 and H.264 Main Profile Level 3.0 video would have a CODECS value 1940 of "mp4a.40.2,avc1.4d401e". 1942 Note that if a Variant Stream specifies one or more Renditions 1943 that include IMSC subtitles, the CODECS attribute MUST indicate 1944 this with a format identifier such as "stpp.ttml.im1t". 1946 Every EXT-X-STREAM-INF tag SHOULD include a CODECS attribute. 1948 RESOLUTION 1950 The value is a decimal-resolution describing the optimal pixel 1951 resolution at which to display all the video in the Variant 1952 Stream. 1954 The RESOLUTION attribute is OPTIONAL but is recommended if the 1955 Variant Stream includes video. 1957 FRAME-RATE 1959 The value is a decimal-floating-point describing the maximum frame 1960 rate for all the video in the Variant Stream, rounded to three 1961 decimal places. 1963 The FRAME-RATE attribute is OPTIONAL but is recommended if the 1964 Variant Stream includes video. The FRAME-RATE attribute SHOULD be 1965 included if any video in a Variant Stream exceeds 30 frames per 1966 second. 1968 HDCP-LEVEL 1970 The value is an enumerated-string; valid strings are TYPE-0, TYPE- 1971 1, and NONE. This attribute is advisory. A value of TYPE-0 1972 indicates that the Variant Stream could fail to play unless the 1973 output is protected by High-bandwidth Digital Content Protection 1974 (HDCP) Type 0 [HDCP] or equivalent. A value of TYPE-1 indicates 1975 that the Variant Stream could fail to play unless the output is 1976 protected by HDCP Type 1 or equivalent. A value of NONE indicates 1977 that the content does not require output copy protection. 1979 Encrypted Variant Streams with different HDCP levels SHOULD use 1980 different media encryption keys. 1982 The HDCP-LEVEL attribute is OPTIONAL. It SHOULD be present if any 1983 content in the Variant Stream will fail to play without HDCP. 1984 Clients without output copy protection SHOULD NOT load a Variant 1985 Stream with an HDCP-LEVEL attribute unless its value is NONE. 1987 ALLOWED-CPC 1989 The ALLOWED-CPC attribute allows a server to indicate that the 1990 playback of a Variant Stream containing encrypted Media Segments 1991 is to be restricted to devices that guarantee a certain level of 1992 content protection robustness. Its value is a quoted-string 1993 containing a comma-separated list of entries. Each entry consists 1994 of a KEYFORMAT attribute value followed by a colon character (:) 1995 followed by a sequence of Content Protection Configuration (CPC) 1996 Labels separated by slash (/) characters. Each CPC Label is a 1997 string containing characters from the set [A..Z], [0..9], and '-'. 1999 For example: ALLOWED-CPC="com.example.drm1:SMART-TV/PC, 2000 com.example.drm2:HW" 2002 A CPC Label identifies a class of playback device that implements 2003 the KEYFORMAT with a certain level of content protection 2004 robustness. Each KEYFORMAT can define its own set of CPC Labels. 2005 The "identity" KEYFORMAT does not define any labels. A KEYFORMAT 2006 that defines CPC Labels SHOULD also specify its robustness 2007 requirements in a secure manner in each key response. 2009 A client MAY play the Variant Stream if it implements one of the 2010 listed KEYFORMAT schemes with content protection robustness that 2011 matches one or more of the CPC Labels in the list. If it does not 2012 match any of the CPC Labels then it SHOULD NOT attempt to play the 2013 Variant Stream. 2015 The ALLOWED-CPC attribute is OPTIONAL. If it is not present or 2016 does not contain a particular KEYFORMAT then all clients that 2017 support that KEYFORMAT MAY play the Variant Stream. 2019 VIDEO-RANGE 2021 The value is an enumerated-string; valid strings are SDR, HLG and 2022 PQ. 2024 The value MUST be SDR if the video in the Variant Stream is 2025 encoded using one of the following reference opto-electronic 2026 transfer characteristic functions specified by the 2027 TransferCharacteristics code point: [CICP] 1, 6, 13, 14, 15. Note 2028 that different TransferCharacteristics code points can use the 2029 same transfer function. 2031 The value MUST be HLG if the video in the Variant Stream is 2032 encoded using a reference opto-electronic transfer characteristic 2033 function specified by the TransferCharacteristics code point 18, 2034 or consists of such video mixed with video qualifying as SDR (see 2035 above). 2037 The value MUST be PQ if the video in the Variant Stream is encoded 2038 using a reference opto-electronic transfer characteristic function 2039 specified by the TransferCharacteristics code point 16, or 2040 consists of such video mixed with video qualifying as SDR or HLG 2041 (see above). 2043 This attribute is OPTIONAL. Its absence implies a value of SDR. 2044 Clients that do not recognize the attribute value SHOULD NOT 2045 select the Variant Stream. 2047 STABLE-VARIANT-ID 2049 The value is a quoted-string which is a stable identifier for the 2050 URI within the Master Playlist. All characters in the quoted- 2051 string MUST be from the following set: [a..z], [A..Z], [0..9], 2052 '+', '/', '=', '.', '-', and '_'. This attribute is OPTIONAL. 2054 The STABLE-VARIANT-ID allows the URI of the Variant Stream to 2055 change between two distinct downloads of the Master Playlist. IDs 2056 are matched using a byte-for-byte comparison. 2058 AUDIO 2059 The value is a quoted-string. It MUST match the value of the 2060 GROUP-ID attribute of an EXT-X-MEDIA tag elsewhere in the Master 2061 Playlist whose TYPE attribute is AUDIO. It indicates the set of 2062 audio Renditions that SHOULD be used when playing the 2063 presentation. See Section 4.4.6.2.1. 2065 The AUDIO attribute is OPTIONAL. 2067 VIDEO 2069 The value is a quoted-string. It MUST match the value of the 2070 GROUP-ID attribute of an EXT-X-MEDIA tag elsewhere in the Master 2071 Playlist whose TYPE attribute is VIDEO. It indicates the set of 2072 video Renditions that SHOULD be used when playing the 2073 presentation. See Section 4.4.6.2.1. 2075 The VIDEO attribute is OPTIONAL. 2077 SUBTITLES 2079 The value is a quoted-string. It MUST match the value of the 2080 GROUP-ID attribute of an EXT-X-MEDIA tag elsewhere in the Master 2081 Playlist whose TYPE attribute is SUBTITLES. It indicates the set 2082 of subtitle Renditions that can be used when playing the 2083 presentation. See Section 4.4.6.2.1. 2085 The SUBTITLES attribute is OPTIONAL. 2087 CLOSED-CAPTIONS 2089 The value can be either a quoted-string or an enumerated-string 2090 with the value NONE. If the value is a quoted-string, it MUST 2091 match the value of the GROUP-ID attribute of an EXT-X-MEDIA tag 2092 elsewhere in the Playlist whose TYPE attribute is CLOSED-CAPTIONS, 2093 and it indicates the set of closed-caption Renditions that can be 2094 used when playing the presentation. See Section 4.4.6.2.1. 2096 If the value is the enumerated-string value NONE, all EXT-X- 2097 STREAM-INF tags MUST have this attribute with a value of NONE, 2098 indicating that there are no closed captions in any Variant Stream 2099 in the Master Playlist. Having closed captions in one Variant 2100 Stream but not another can trigger playback inconsistencies. 2102 The CLOSED-CAPTIONS attribute is OPTIONAL. 2104 4.4.6.2.1. Alternative Renditions 2106 When an EXT-X-STREAM-INF tag contains an AUDIO, VIDEO, SUBTITLES, or 2107 CLOSED-CAPTIONS attribute, it indicates that alternative Renditions 2108 of the content are available for playback of that Variant Stream. 2110 When defining alternative Renditions, the following constraints MUST 2111 be met to prevent client playback errors: 2113 o All playable combinations of Renditions associated with an EXT-X- 2114 STREAM-INF tag MUST have an aggregate bandwidth less than or equal 2115 to the BANDWIDTH attribute of the EXT-X-STREAM-INF tag. 2117 o If an EXT-X-STREAM-INF tag contains a RESOLUTION attribute and a 2118 VIDEO attribute, then every alternative video Rendition MUST have 2119 an optimal display resolution matching the value of the RESOLUTION 2120 attribute. 2122 o Every alternative Rendition associated with an EXT-X-STREAM-INF 2123 tag MUST meet the constraints for a Variant Stream described in 2124 Section 6.2.4. 2126 The URI attribute of the EXT-X-MEDIA tag is REQUIRED if the media 2127 type is SUBTITLES, but OPTIONAL if the media type is VIDEO or AUDIO. 2128 If the media type is VIDEO or AUDIO, a missing URI attribute 2129 indicates that the media data for this Rendition is included in the 2130 Media Playlist of any EXT-X-STREAM-INF tag referencing this EXT- 2131 X-MEDIA tag. If the media TYPE is AUDIO and the URI attribute is 2132 missing, clients MUST assume that the audio data for this Rendition 2133 is present in every video Rendition specified by the EXT-X-STREAM-INF 2134 tag. 2136 The URI attribute of the EXT-X-MEDIA tag MUST NOT be included if the 2137 media type is CLOSED-CAPTIONS. 2139 4.4.6.3. EXT-X-I-FRAME-STREAM-INF 2141 The EXT-X-I-FRAME-STREAM-INF tag identifies a Media Playlist file 2142 containing the I-frames of a multimedia presentation. It stands 2143 alone, in that it does not apply to a particular URI in the Master 2144 Playlist. Its format is: 2146 #EXT-X-I-FRAME-STREAM-INF:<attribute-list> 2148 All attributes defined for the EXT-X-STREAM-INF tag (Section 4.4.6.2) 2149 are also defined for the EXT-X-I-FRAME-STREAM-INF tag, except for the 2150 FRAME-RATE, AUDIO, SUBTITLES, and CLOSED-CAPTIONS attributes. In 2151 addition, the following attribute is defined: 2153 URI 2155 The value is a quoted-string containing a URI that identifies the 2156 I-frame Media Playlist file. That Playlist file MUST contain an 2157 EXT-X-I-FRAMES-ONLY tag. 2159 Every EXT-X-I-FRAME-STREAM-INF tag MUST include a BANDWIDTH attribute 2160 and a URI attribute. 2162 The provisions in Section 4.4.6.2.1 also apply to EXT-X-I-FRAME- 2163 STREAM-INF tags with a VIDEO attribute. 2165 A Master Playlist that specifies alternative VIDEO Renditions and 2166 I-frame Playlists SHOULD include an alternative I-frame VIDEO 2167 Rendition for each regular VIDEO Rendition, with the same NAME and 2168 LANGUAGE attributes. 2170 4.4.6.4. EXT-X-SESSION-DATA 2172 The EXT-X-SESSION-DATA tag allows arbitrary session data to be 2173 carried in a Master Playlist. 2175 Its format is: 2177 #EXT-X-SESSION-DATA:<attribute-list> 2179 The following attributes are defined: 2181 DATA-ID 2183 The value of DATA-ID is a quoted-string that identifies a 2184 particular data value. The DATA-ID SHOULD conform to a reverse 2185 DNS naming convention, such as "com.example.movie.title"; however, 2186 there is no central registration authority, so Playlist authors 2187 SHOULD take care to choose a value that is unlikely to collide 2188 with others. This attribute is REQUIRED. 2190 VALUE 2192 VALUE is a quoted-string. It contains the data identified by 2193 DATA-ID. If the LANGUAGE is specified, VALUE SHOULD contain a 2194 human-readable string written in the specified language. 2196 URI 2198 The value is a quoted-string containing a URI. The resource 2199 identified by the URI MUST be formatted as JSON [RFC8259]; 2200 otherwise, clients may fail to interpret the resource. 2202 LANGUAGE 2204 The value is a quoted-string containing a language tag [RFC5646] 2205 that identifies the language of the VALUE. This attribute is 2206 OPTIONAL. 2208 Each EXT-X-SESSION-DATA tag MUST contain either a VALUE or URI 2209 attribute, but not both. 2211 A Playlist MAY contain multiple EXT-X-SESSION-DATA tags with the same 2212 DATA-ID attribute. A Playlist MUST NOT contain more than one EXT-X- 2213 SESSION-DATA tag with the same DATA-ID attribute and the same 2214 LANGUAGE attribute. 2216 4.4.6.5. EXT-X-SESSION-KEY 2218 The EXT-X-SESSION-KEY tag allows encryption keys from Media Playlists 2219 to be specified in a Master Playlist. This allows the client to 2220 preload these keys without having to read the Media Playlist(s) 2221 first. 2223 Its format is: 2225 #EXT-X-SESSION-KEY:<attribute-list> 2227 All attributes defined for the EXT-X-KEY tag (Section 4.4.4.4) are 2228 also defined for the EXT-X-SESSION-KEY, except that the value of the 2229 METHOD attribute MUST NOT be NONE. If an EXT-X-SESSION-KEY is used, 2230 the values of the METHOD, KEYFORMAT, and KEYFORMATVERSIONS attributes 2231 MUST match any EXT-X-KEY with the same URI value. 2233 EXT-X-SESSION-KEY tags SHOULD be added if multiple Variant Streams or 2234 Renditions use the same encryption keys and formats. An EXT-X- 2235 SESSION-KEY tag is not associated with any particular Media Playlist. 2237 A Master Playlist MUST NOT contain more than one EXT-X-SESSION-KEY 2238 tag with the same METHOD, URI, IV, KEYFORMAT, and KEYFORMATVERSIONS 2239 attribute values. 2241 The EXT-X-SESSION-KEY tag is optional. 2243 5. Key Files 2245 5.1. Structure of Key Files 2247 An EXT-X-KEY tag with a URI attribute identifies a Key file. A Key 2248 file contains a cipher key that can decrypt Media Segments in the 2249 Playlist. 2251 [AES_128] encryption uses 16-octet keys. If the KEYFORMAT of an EXT- 2252 X-KEY tag is "identity", the Key file is a single packed array of 16 2253 octets in binary format. 2255 5.2. IV for AES-128 2257 [AES_128] REQUIRES the same 16-octet IV to be supplied when 2258 encrypting and decrypting. Varying this IV increases the strength of 2259 the cipher. 2261 An IV attribute on an EXT-X-KEY tag with a KEYFORMAT of "identity" 2262 specifies an IV that can be used when decrypting Media Segments 2263 encrypted with that Key file. IV values for AES-128 are 128-bit 2264 numbers. 2266 An EXT-X-KEY tag with a KEYFORMAT of "identity" that does not have an 2267 IV attribute indicates that the Media Sequence Number is to be used 2268 as the IV when decrypting a Media Segment, by putting its big-endian 2269 binary representation into a 16-octet (128-bit) buffer and padding 2270 (on the left) with zeros. 2272 6. Client/Server Responsibilities 2274 6.1. Introduction 2276 This section describes how the server generates the Playlist and 2277 Media Segments and how the client should download them for playback. 2279 6.2. Server Responsibilities 2281 6.2.1. General Server Responsibilities 2283 The production of the source media is outside the scope of this 2284 document, which simply presumes a source of continuous encoded media 2285 containing the presentation. 2287 The server MUST divide the source media into individual Media 2288 Segments whose duration (when rounded to a whole second) is less than 2289 or equal to the Target Duration. Segments longer than that can 2290 trigger playback stalls and other errors. 2292 The server SHOULD attempt to divide the source media at points that 2293 support effective decode of individual Media Segments, such as on 2294 packet and key frame boundaries. 2296 The server MUST create a URI for every Media Segment that enables its 2297 clients to obtain the segment data. If a server supports partial 2298 loading of resources (e.g., via HTTP Range requests), it MAY specify 2299 segments as sub-ranges of larger resources using the EXT-X-BYTERANGE 2300 tag. 2302 The absence of media data (due to, for example, the temporary 2303 unavailability of an encoder) SHOULD be signaled by adding one or 2304 more Media Segments to the Playlist whose Segment durations add up to 2305 the duration of absent media; these Media Segments MUST have EXT- 2306 X-GAP tags applied to them. Similarly, such Partial Segments MUST 2307 have a GAP=YES attribute. Attempting to download these segments MAY 2308 produce an error, such as HTTP 404 or 410. 2310 A Media Segment MUST be available for immediate download at the full 2311 speed of the link to the Client when it is added to a Playlist unless 2312 it has been marked with an EXT-X-GAP tag; otherwise playback errors 2313 can occur. Once download starts, its transfer rate SHOULD NOT be 2314 constrained by the segment production process. 2316 A Partial Segment MUST be similarly available at the time it is added 2317 to a Playlist. 2319 HTTP servers SHOULD transfer text files -- such as Playlists and 2320 WebVTT segments -- using the "gzip" Content-Encoding if the client 2321 indicates that it is prepared to accept it. 2323 The server must create a Media Playlist file (Section 4) that 2324 contains a URI for each Media Segment that the server wishes to make 2325 available, in the order in which they are to be played. 2327 The value of the EXT-X-VERSION tag (Section 4.4.1.2) SHOULD NOT be 2328 greater than what is required for the tags and attributes in the 2329 Playlist (see Section 7). 2331 Changes to the Playlist file MUST be made atomically from the point 2332 of view of the clients, or playback errors MAY occur. 2334 The server MUST NOT change the Media Playlist file, except to: 2336 Append lines to it (Section 6.2.1). 2338 Remove Media Segment URIs from the Playlist in the order that they 2339 appear, along with any tags that apply only to those segments 2340 (Section 6.2.2). 2342 Remove Media Metadata tags that no longer apply to the 2343 presentation (Section 6.2.1). 2345 Remove EXT-X-PART tags no longer at the live edge (Section 6.2.2). 2347 Increment the value of the EXT-X-MEDIA-SEQUENCE or EXT-X- 2348 DISCONTINUITY-SEQUENCE tags (Section 6.2.2). 2350 Add an EXT-X-ENDLIST tag to the Playlist (Section 6.2.1). 2352 A Media Playlist has further constraints on its updates if it 2353 contains an EXT-X-PLAYLIST-TYPE tag. An EXT-X-PLAYLIST-TYPE tag with 2354 a value of VOD indicates that the Playlist file MUST NOT change. An 2355 EXT-X-PLAYLIST-TYPE tag with a value of EVENT indicates that the 2356 Server MUST NOT change or remove any part of the Playlist file, with 2357 the exception of EXT-X-PART tags and Media Metadata tags as described 2358 above; the Server MAY append lines to the Playlist. 2360 The value of the EXT-X-TARGETDURATION tag in the Media Playlist MUST 2361 NOT change. A typical Target Duration is 6 seconds. 2363 Playlist changes other than those allowed here can trigger playback 2364 errors and inconsistent client behavior. 2366 Each Media Segment in a Media Playlist has an integer Discontinuity 2367 Sequence Number. The Discontinuity Sequence Number can be used in 2368 addition to the timestamps within the media to synchronize Media 2369 Segments across different Renditions. 2371 A segment's Discontinuity Sequence Number is the value of the EXT-X- 2372 DISCONTINUITY-SEQUENCE tag (or zero if none) plus the number of EXT- 2373 X-DISCONTINUITY tags in the Playlist preceding the URI line of the 2374 segment. 2376 The server MAY associate an absolute date and time with a Media 2377 Segment by applying an EXT-X-PROGRAM-DATE-TIME tag to it. This 2378 defines an informative mapping of the (wall-clock) date and time 2379 specified by the tag to the first media timestamp in the segment, 2380 which may be used as a basis for seeking, for display, or for other 2381 purposes. If a server provides this mapping, it SHOULD apply an EXT- 2382 X-PROGRAM-DATE-TIME tag to every segment that has an EXT- 2383 X-DISCONTINUITY tag applied to it. 2385 The Server MUST NOT add any EXT-X-PROGRAM-DATE-TIME tag to a Playlist 2386 that would cause the mapping between program date and Media Segment 2387 to become ambiguous. 2389 When applied to live content, a reasonable default for the EXT-X- 2390 PROGRAM-DATE-TIME tag is the date and time that the content was 2391 captured (recorded). 2393 The server MUST NOT remove an EXT-X-DATERANGE tag from a Playlist if 2394 any date in the range maps to a Media Segment in the Playlist. 2396 The server MUST NOT reuse the ID attribute value of an EXT- 2397 X-DATERANGE tag for any new Date Range in the same Playlist. 2399 Once the Following Range of a Date Range with an END-ON-NEXT=YES 2400 attribute is added to a Playlist, the Server MUST NOT subsequently 2401 add a Date Range with the same CLASS attribute whose START-DATE is 2402 between that of the END-ON-NEXT=YES range and its Following Range. 2404 For Date Ranges with a PLANNED-DURATION attribute, the Server SHOULD 2405 signal the actual end of the range once it has been established. It 2406 can do so by adding another EXT-X-DATERANGE tag with the same ID 2407 attribute value and either a DURATION or an END-DATE attribute or, if 2408 the Date Range has an END-ON-NEXT=YES attribute, by adding a 2409 Following Range. 2411 If the Media Playlist contains the final Media Segment of the 2412 presentation, then the Playlist file MUST contain the EXT-X-ENDLIST 2413 tag; this allows clients to minimize unproductive Playlist reloads. 2415 If a Media Playlist does not contain the EXT-X-ENDLIST tag, the 2416 server MUST make a new version of the Playlist file available that 2417 contains at least one new Media Segment. It MUST be made available 2418 no later than 1.5 times the Target Duration after the previous time 2419 the Playlist was updated with a Media Segment. This allows clients 2420 to utilize the network efficiently. 2422 If a Media Playlist without an EXT-X-ENDLIST tag contains Partial 2423 Segments, the Server MUST add a new Partial Segment to the Playlist 2424 within one Part Target Duration after it added the previous Partial 2425 Segment. 2427 If the server wishes to remove an entire presentation, it SHOULD 2428 provide a clear indication to clients that the Playlist file is no 2429 longer available (e.g., with an HTTP 404 or 410 response). It MUST 2430 ensure that all Media Segments in the Playlist file remain available 2431 to clients for at least the duration of the Playlist file at the time 2432 of removal to prevent interruption of in-progress playback. 2434 6.2.2. Live Playlists 2436 The server MAY limit the availability of Media Segments by removing 2437 Media Segments from the Playlist file (Section 6.2.1). If Media 2438 Segments are to be removed, the Playlist file MUST contain an EXT-X- 2439 MEDIA-SEQUENCE tag. Its value MUST be incremented by 1 for every 2440 Media Segment that is removed from the Playlist file; it MUST NOT 2441 decrease or wrap. Clients can malfunction if each Media Segment does 2442 not have a consistent, unique Media Sequence Number. 2444 EXT-X-PART tags SHOULD be removed from the Playlist after they are 2445 greater than three Target Durations from the end of the Playlist. 2447 Media Segments and EXT-X-PART tags MUST be removed from the Playlist 2448 in the order that they appear in the Playlist; otherwise, client 2449 playback can malfunction. 2451 The server MUST NOT remove a Media Segment from a Playlist file 2452 without an EXT-X-ENDLIST tag if that would produce a Playlist whose 2453 duration is less than three times the Target Duration. Doing so can 2454 trigger playback stalls. 2456 The Availability Duration of a Media Segment is the duration of the 2457 segment plus the duration of the longest-duration Playlist 2458 distributed by the server containing that segment. If the server 2459 removes a Media Segment URI from a Playlist that contains an EXT- 2460 X-ENDLIST tag, clients MUST be able to download the corresponding 2461 Media Segment until the time of removal plus the segment's 2462 Availability Duration. If the server removes a Media Segment URI 2463 from a Playlist that does not contain an EXT-X-ENDLIST tag, clients 2464 MUST be able to download the segment until the time at which it first 2465 appeared in the Playlist plus the segment's Availability Duration. 2467 If the server wishes to remove segments from a Media Playlist 2468 containing an EXT-X-DISCONTINUITY tag, the Media Playlist MUST 2469 contain an EXT-X-DISCONTINUITY-SEQUENCE tag. Without the EXT-X- 2470 DISCONTINUITY-SEQUENCE tag, it can be impossible for a client to 2471 locate corresponding segments between Renditions. 2473 If the server removes an EXT-X-DISCONTINUITY tag from the Media 2474 Playlist, it MUST increment the value of the EXT-X-DISCONTINUITY- 2475 SEQUENCE tag so that the Discontinuity Sequence Numbers of the 2476 segments still in the Media Playlist remain unchanged. The value of 2477 the EXT-X-DISCONTINUITY-SEQUENCE tag MUST NOT decrease or wrap. 2478 Clients can malfunction if each Media Segment does not have a 2479 consistent Discontinuity Sequence Number. 2481 If a server plans to remove a Media Segment after it is delivered to 2482 clients over HTTP, it SHOULD ensure that the HTTP response contains 2483 an Expires header that reflects the planned time-to-live. 2485 A Live Playlist MUST NOT contain the EXT-X-PLAYLIST-TYPE tag, as no 2486 value of that tag allows Media Segments to be removed. 2488 6.2.3. Encrypting Media Segments 2490 Media Segments MAY be encrypted. Every encrypted Media Segment MUST 2491 have an EXT-X-KEY tag (Section 4.4.4.4) applied to it with a URI that 2492 the client can use to obtain a Key file (Section 5) containing the 2493 decryption key. 2495 A Media Segment can only be encrypted with one encryption METHOD, 2496 using one encryption key and IV. However, a server MAY offer 2497 multiple ways to retrieve that key by providing multiple EXT-X-KEY 2498 tags, each with a different KEYFORMAT attribute value. 2500 The server MAY set the HTTP Expires header in the key response to 2501 indicate the duration for which the key can be cached. 2503 Any unencrypted Media Segment in a Playlist MUST be in the scope of 2504 an EXT-X-KEY tag that specifies an encryption METHOD of NONE or 2505 precedes the first EXT-X-KEY tag. Otherwise, the client will 2506 misinterpret those segments as encrypted. 2508 If the encryption METHOD is AES-128 and the Playlist does not contain 2509 the EXT-X-I-FRAMES-ONLY tag, AES encryption as described in 2510 Section 4.4.4.4 SHALL be applied to individual Media Segments. 2512 If the encryption METHOD is AES-128 and the Playlist contains an EXT- 2513 X-I-FRAMES-ONLY tag, the entire resource MUST be encrypted using 2514 AES-128 CBC with PKCS7 padding [RFC5652]. Encryption MAY be 2515 restarted on 16-byte block boundaries, unless the first block 2516 contains an I-frame. The IV used for encryption MUST be either the 2517 Media Sequence Number of the Media Segment or the value of the IV 2518 attribute of the EXT-X-KEY tag, as described in Section 5.2. These 2519 constraints allow a client to load and decrypt individual I-frames 2520 specified as sub-ranges of regular encrypted Media Segments, and 2521 their Media Initialization Sections. 2523 If the encryption METHOD indicates Sample Encryption, media samples 2524 MAY be encrypted prior to encapsulation in a Media Segment. 2526 The server MUST NOT remove an EXT-X-KEY tag from the Playlist file if 2527 it applies to any Media Segment in the Playlist file, or clients who 2528 subsequently load that Playlist will be unable to decrypt those Media 2529 Segments. 2531 6.2.4. Providing Variant Streams 2533 A server MAY offer multiple Media Playlist files to provide different 2534 encodings of the same presentation. If it does so, it SHOULD provide 2535 a Master Playlist file that lists each Variant Stream to allow 2536 clients to switch between encodings dynamically. 2538 Master Playlists describe regular Variant Streams with EXT-X-STREAM- 2539 INF tags and I-frame Variant Streams with EXT-X-I-FRAME-STREAM-INF 2540 tags. 2542 If an EXT-X-STREAM-INF tag or EXT-X-I-FRAME-STREAM-INF tag contains 2543 the CODECS attribute, the attribute value MUST include every media 2544 format [RFC6381] present in any Media Segment in any of the 2545 Renditions specified by the Variant Stream. 2547 The server MUST meet the following constraints when producing Variant 2548 Streams in order to allow clients to switch between them seamlessly: 2550 Each Variant Stream MUST present the same content. 2552 Matching content in Variant Streams MUST have matching timestamps. 2553 This allows clients to synchronize the media. 2555 Matching content in Variant Streams MUST have matching 2556 Discontinuity Sequence Numbers (see Section 4.4.3.3). 2558 Each Media Playlist in each Variant Stream MUST have the same 2559 Target Duration. The only exceptions are SUBTITLES Renditions and 2560 Media Playlists containing an EXT-X-I-FRAMES-ONLY tag, which MAY 2561 have different Target Durations if they have an EXT-X-PLAYLIST- 2562 TYPE of VOD. 2564 Content that appears in a Media Playlist of one Variant Stream but 2565 not in another MUST appear either at the beginning or at the end 2566 of the Media Playlist file and MUST NOT be longer than the Target 2567 Duration. 2569 If any Media Playlists have an EXT-X-PLAYLIST-TYPE tag, all Media 2570 Playlists MUST have an EXT-X-PLAYLIST-TYPE tag with the same 2571 value. 2573 If the Playlist contains an EXT-X-PLAYLIST-TYPE tag with the value 2574 of VOD, the first segment of every Media Playlist in every Variant 2575 Stream MUST start at the same media timestamp. 2577 If any Media Playlist in a Master Playlist contains an EXT-X- 2578 PROGRAM-DATE-TIME tag, then all Media Playlists in that Master 2579 Playlist MUST contain EXT-X-PROGRAM-DATE-TIME tags with consistent 2580 mappings of date and time to media timestamps. 2582 Each Variant Stream MUST contain the same set of Date Ranges. The 2583 EXT-X-DATERANGE tags of corresponding Date Ranges MUST have the 2584 same ID attribute value and contain the same set of attribute/ 2585 value pairs. 2587 If any Media Playlist in a Master Playlist contains an EXT-X- 2588 SERVER-CONTROL tag, then all Media Playlists in that Master 2589 Playlist MUST contain that tag, with the same attributes and 2590 values. 2592 In addition, for broadest compatibility, Variant Streams SHOULD 2593 contain the same encoded audio bitstream. This allows clients to 2594 switch between Variant Streams without audible glitching. 2596 The rules for Variant Streams also apply to alternative Renditions 2597 (see Section 4.4.6.2.1). 2599 6.2.5. Delivery Directives Interface 2601 A server MAY provide a set of services to its clients by implementing 2602 support for Delivery Directives. Delivery Directives are transmitted 2603 by the Client to the Server as Query Parameters in Playlist request 2604 URIs. 2606 Servers advertise the availability of Delivery Directives using the 2607 EXT-X-SERVER-CONTROL tag (Section 4.4.3.8). 2609 Currently-defined Delivery Directives are _HLS_skip, _HLS_msn and 2610 _HLS_part. 2612 6.2.5.1. Playlist Delta Updates 2614 Live presentations involve frequent Playlist downloads. When 2615 Playlists are large and a Client already has the previous version, 2616 the transfer cost can be reduced considerably by sending only the 2617 newest information in response to a Playlist update request. 2619 A Server advertises support for Playlist Delta Updates that skip 2620 older Media Segments by adding the CAN-SKIP-UNTIL attribute to the 2621 EXT-X-SERVER-CONTROL tag. A Server can also offer support for 2622 Playlist Delta Updates that skip older EXT-X-DATERANGE tags by adding 2623 the CAN-SKIP-DATERANGES attribute to the EXT-X-SERVER-CONTROL tag. 2625 When a Server receives a request for a Playlist containing the CAN- 2626 SKIP-UNTIL attribute but no EXT-X-ENDLIST tag, and the requested URI 2627 contains an _HLS_skip directive whose value is YES or v2, it MUST 2628 respond with a Playlist Delta Update. 2630 The Playlist Delta Update is a version of the Playlist in which Media 2631 Segments that are further from the end of the Playlist than the Skip 2632 Boundary (Section 4.4.3.8), as well as their associated tags, are 2633 replaced by an EXT-X-SKIP tag (Section 4.4.5.2). 2635 When the _HLS_skip directive has a value of v2, the Playlist Delta 2636 Update additionally MUST NOT contain EXT-X-DATERANGE tags that were 2637 added to the Playlist more than CAN-SKIP-UNTIL seconds before the 2638 Playlist request. The RECENTLY-REMOVED-DATERANGES attribute of the 2639 EXT-X-SKIP tag MUST list the date ranges that were removed from the 2640 Playlist within CAN-SKIP-UNTIL seconds of the Playlist request. 2642 All tags that were not skipped MUST remain in the Playlist Delta 2643 Update. 2645 A Server MUST ignore the _HLS_skip directive if the Playlist does not 2646 contain the CAN-SKIP-UNTIL attribute, or if it contains an EXT- 2647 X-ENDLIST tag. 2649 6.2.5.2. Blocking Playlist Reload 2651 A Server MAY offer Blocking Playlist Reloads, which enable immediate 2652 client discovery of Playlist updates as an alternative to polling. 2654 A Server advertises support for Blocking Playlist Reload by adding 2655 the CAN-BLOCK-RELOAD=YES attribute to the EXT-X-SERVER-CONTROL tag. 2657 A Client requests a Blocking Playlist Reload using an _HLS_msn 2658 directive with a decimal-integer value M. When the Playlist URI 2659 contains an _HLS_msn directive and no _HLS_part directive, the Server 2660 MUST defer responding to the request until the Playlist contains a 2661 Media Segment with a Media Sequence Number of M or later or it 2662 responds with an error. 2664 The Playlist URI MAY also contain an _HLS_part directive with a 2665 decimal-integer value N. When the Playlist URI contains both an 2666 _HLS_msn directive and an _HLS_part directive, the Server MUST defer 2667 responding to the request until the Playlist contains the Partial 2668 Segment with Part Index N and with a Media Sequence Number of M or 2669 later or it responds with an error. 2671 If the Client requests a Part Index greater than that of the final 2672 Partial Segment of the Parent Segment, the Server MUST treat the 2673 request as one for Part Index 0 of the following Parent Segment. 2675 The Server MUST deliver the entire Playlist, even if the requested 2676 Media Segment is not the last one in the Playlist, and even if it is 2677 no longer in the Playlist. 2679 A Server MUST ignore _HLS_msn and _HLS_part if the Playlist contains 2680 an EXT-X-ENDLIST tag. 2682 If the _HLS_msn is greater than the Media Sequence Number of the last 2683 Media Segment in the current Playlist plus two, or if the _HLS_part 2684 exceeds the last Partial Segment in the current Playlist by the 2685 Advance Part Limit, then the server SHOULD immediately return Bad 2686 Request, such as HTTP 400. The Advance Part Limit is three divided 2687 by the Part Target Duration if the Part Target Duration is less than 2688 one second, or three otherwise. 2690 If the Playlist URI contains an _HLS_part directive but no _HLS_msn 2691 directive, the Server MUST return Bad Request, such as HTTP 400. 2693 A Server that cannot provide the requested Playlist after blocking 2694 for more than three Target Durations SHOULD return Service 2695 Unavailable, such as HTTP 503. 2697 6.2.6. Providing Preload Hints 2699 The Server MAY add EXT-X-PRELOAD-HINT tags (Section 4.4.5.3) to the 2700 Playlist to allow Clients playing the stream to request upcoming 2701 resources in advance. 2703 A hinted resource MUST be available for request when its EXT-X- 2704 PRELOAD-HINT tag is added to the Playlist. 2706 When processing requests for a URI or a byte range of a URI that 2707 includes one or more Partial Segments that are not yet completely 2708 available to be sent - such as requests made in response to an EXT-X- 2709 PRELOAD-HINT tag - the server MUST refrain from transmitting any 2710 bytes belonging to a Partial Segment until all bytes of that Partial 2711 Segment can be transmitted at the full speed of the link to the 2712 client. If the requested range includes more than one Partial 2713 Segment then the server MUST enforce this delivery guarantee for each 2714 Partial Segment in turn. This enables the client to perform accurate 2715 Adaptive Bit Rate (ABR) measurements. 2717 The Server SHOULD NOT hint a byte range that it does not expect its 2718 clients to require in the near term. 2720 The server SHOULD respond with "Not Found" (such as HTTP 404) to a 2721 request for a resource that it cannot find and that is not specified 2722 by an EXT-X-PRELOAD-HINT tag in an active Media Playlist. 2724 A server MAY choose not to publish previously-hinted resources if the 2725 planned segmentation changes, such as the case of early return from 2726 an ad. The server SHOULD respond to client requests for those 2727 resources with "Not Found" (such as HTTP 404). 2729 If a Partial Segment is created as a subrange of a larger resource 2730 and its length is not known at the time that its hint is added to the 2731 Playlist, the BYTERANGE-LENGTH attribute SHOULD be omitted. The 2732 BYTERANGE-OFFSET SHOULD indicate the Partial Segment's starting 2733 offset into the larger resource. 2735 The Server SHOULD NOT add more than one EXT-X-PRELOAD-HINT tag with 2736 the same TYPE to a Playlist. 2738 6.3. Client Responsibilities 2740 6.3.1. General Client Responsibilities 2742 How the client obtains the URI to the Playlist file is outside the 2743 scope of this document; it is presumed to have done so. 2745 The client obtains the Playlist file from the URI. If the Playlist 2746 file so obtained is a Master Playlist, the client can select a 2747 Variant Stream to load from the Master Playlist. 2749 Clients MUST ensure that loaded Playlists comply with Section 4 and 2750 that the EXT-X-VERSION tag, if present, specifies a protocol version 2751 supported by the client; if either check fails, the client MUST NOT 2752 attempt to use the Playlist, or unintended behavior could occur. 2754 When parsing Playlist elements that are subject to variable 2755 substitution, a Variable Reference whose Variable Name has been 2756 provided by an EXT-X-DEFINE tag that precedes the Variable Reference 2757 MUST be replaced by the corresponding Variable Value. Such 2758 replacements themselves are NOT subject to variable substitution. 2760 When parsing Playlist elements that are subject to variable 2761 substitution, a Variable Reference whose Variable Name has NOT been 2762 provided by an EXT-X-DEFINE tag preceding the Variable Reference MUST 2763 trigger a parsing error. 2765 If any URI element in a Playlist contains an URI scheme that the 2766 client cannot handle, the client MUST stop playback. All clients 2767 MUST support HTTP schemes. 2769 To support forward compatibility, when parsing Playlists, clients 2770 MUST: 2772 o ignore any unrecognized tags. 2774 o ignore any attribute/value pair with an unrecognized 2775 AttributeName. 2777 o ignore any tag containing an attribute/value pair of type 2778 enumerated-string whose AttributeName is recognized but whose 2779 AttributeValue is not recognized, unless the definition of the 2780 attribute says otherwise. 2782 When identifying playable Renditions, Clients SHOULD consider an 2783 audio Rendition having unrecognized CHANNELS parameters to be 2784 playable if its associated CODECS attribute is supported. However, 2785 an equivalent Rendition with the same audio codec and recognized 2786 CHANNELS parameters SHOULD be preferred if it is present in the 2787 Master Playlist. 2789 When all Variant Streams have a SCORE attribute, the client SHOULD 2790 use the SCORE value to choose a Variant Stream after all other 2791 playability constraints have been applied. If several Variant 2792 Streams have the highest SCORE value then other criteria MAY be used 2793 to chose among them. 2795 Algorithms used by the client to switch between Variant Streams are 2796 beyond the scope of this document. 2798 6.3.2. Loading the Media Playlist File 2800 Every time a Media Playlist is loaded or reloaded from a Playlist 2801 URI, the client MUST determine the next Media Segment to load, as 2802 described in Section 6.3.5, if it intends to play the presentation 2803 normally (i.e., in Playlist order at the nominal playback rate). 2805 If the Media Playlist contains the EXT-X-MEDIA-SEQUENCE tag, the 2806 client SHOULD assume that each Media Segment in it will become 2807 unavailable at the time that the Playlist file was loaded plus the 2808 duration of the Playlist file. 2810 A client MAY use the segment Media Sequence Number to track the 2811 location of a Media Segment within a Playlist when the Playlist is 2812 reloaded. 2814 A client MUST NOT assume that segments with the same Media Sequence 2815 Number in different Variant Streams or Renditions have the same 2816 position in the presentation; Playlists MAY have independent Media 2817 Sequence Numbers. Instead, a client MUST use the relative position 2818 of each segment on the Playlist timeline and its Discontinuity 2819 Sequence Number to locate corresponding segments. 2821 Clients using Delivery Directives (Section 6.2.5) MUST ensure that 2822 all query parameters appear in UTF-8 order within the URI. This 2823 improves Server cache utilization. 2825 A client MUST load the Media Playlist file of every Rendition 2826 selected for playback in order to locate the media specific to that 2827 Rendition. But, to prevent unnecessary load on the server, it SHOULD 2828 NOT load the Playlist file of any other Rendition. 2830 For some Variant Streams, it is possible to select Renditions that do 2831 not include the Rendition specified by the EXT-X-STREAM-INF tag. As 2832 noted above, the client SHOULD NOT load that Rendition in those 2833 cases. 2835 6.3.3. Playing the Media Playlist File 2837 The client SHALL choose which Media Segment to play first from the 2838 Media Playlist when playback starts. If the EXT-X-ENDLIST tag is not 2839 present and the client intends to play the media normally, the client 2840 SHOULD NOT choose a segment closer to the end of the Playlist than 2841 described by the HOLD-BACK and PART-HOLD-BACK attributes. Doing so 2842 can trigger playback stalls. 2844 Normal playback can be achieved by playing Media Segments or Partial 2845 Segments in the order that they appear in the Playlist. The client 2846 MAY present the available media in any way it wishes, including 2847 normal playback, random access, and trick modes. 2849 The client SHOULD NOT attempt to load Media Segments that have been 2850 marked with an EXT-X-GAP tag, or to load Partial Segments with a 2851 GAP=YES attribute. Instead, clients are encouraged to look for 2852 another Variant Stream of the same Rendition which does not have the 2853 same gap, and play that instead. 2855 The encoding parameters for samples in a Media Segment and across 2856 multiple Media Segments in a Media Playlist SHOULD remain consistent. 2857 However, clients SHOULD deal with encoding changes as they are 2858 encountered, for example, by scaling video content to accommodate a 2859 resolution change. If the Variant Stream includes a RESOLUTION 2860 attribute, clients SHOULD display all video within a rectangle with 2861 the same proportions as that resolution. 2863 Clients SHOULD be prepared to handle multiple tracks of a particular 2864 type (e.g., audio or video). A client with no other preference 2865 SHOULD choose the track with the lowest numerical track identifier 2866 that it can play. 2868 Clients SHOULD ignore private streams inside Transport Streams that 2869 they do not recognize. Private streams can be used to support 2870 different devices with the same stream, although stream authors 2871 SHOULD be sensitive to the additional network load that this imposes. 2873 The client MUST be prepared to reset its parser(s) and decoder(s) 2874 before playing a Media Segment that has an EXT-X-DISCONTINUITY tag 2875 applied to it; otherwise, playback errors can occur. 2877 The client SHOULD attempt to load Media Segments in advance of when 2878 they will be required for uninterrupted playback to compensate for 2879 temporary variations in latency and throughput. 2881 The client MAY use the value of the EXT-X-PROGRAM-DATE-TIME tag to 2882 display the program origination time to the user. If the value 2883 includes time zone information, the client SHALL take it into 2884 account; if it does not, the client MAY assume the time to be local. 2886 Note that dates in Playlists can refer to when the content was 2887 produced (or to other times), which have no relation to the time of 2888 playback. 2890 If the first EXT-X-PROGRAM-DATE-TIME tag in a Playlist appears after 2891 one or more Media Segment URIs, the client SHOULD extrapolate 2892 backward from that tag (using EXTINF durations and/or media 2893 timestamps) to associate dates with those segments. To associate a 2894 date with any other Media Segment that does not have an EXT-X- 2895 PROGRAM-DATE-TIME tag applied to it directly, the client SHOULD 2896 extrapolate forward from the last EXT-X-PROGRAM-DATE-TIME tag 2897 appearing before that segment in the Playlist. 2899 6.3.4. Reloading the Media Playlist File 2901 The client MUST periodically reload a Media Playlist file to learn 2902 what media is currently available, unless it contains an EXT-X- 2903 PLAYLIST-TYPE tag with a value of VOD, or a value of EVENT and the 2904 EXT-X-ENDLIST tag is also present. 2906 However, the client MUST NOT attempt to reload the Playlist file more 2907 frequently than specified by this section, in order to limit the 2908 collective load on the server. 2910 When a client loads a Playlist file for the first time or reloads a 2911 Playlist file and finds that it has changed since the last time it 2912 was loaded, the client MUST wait for at least the duration of the 2913 last segment in the Playlist before attempting to reload the Playlist 2914 file again, measured from the last time the client began loading the 2915 Playlist file. 2917 If the client reloads a Playlist file and finds that it has not 2918 changed, then it MUST wait for a period of one-half the Target 2919 Duration before retrying. If the Playlist file remains unchanged 2920 when reloaded and it has been at least 1.5 times the Target Duration 2921 since the last time the client loaded a changed Playlist then the 2922 client MAY conclude that the server is not behaving properly and 2923 switch to a different Variant Stream or trigger a playback error. 2925 After reloading a Media Playlist, the client SHOULD verify that each 2926 Media Segment in it has the same URI (and byte range, if specified) 2927 as the Media Segment with the same Media Sequence Number in the 2928 previous Media Playlist. It SHOULD halt playback if it does not, as 2929 this normally indicates a server error. 2931 In order to reduce server load, the client SHOULD NOT reload the 2932 Playlist files of Variant Streams or alternate Renditions that are 2933 not currently being played. If it decides to switch playback to a 2934 different Variant Stream, it SHOULD stop reloading the Playlist of 2935 the old Variant Stream and begin loading the Playlist of the new 2936 Variant Stream. It can use the EXTINF durations and the constraints 2937 in Section 6.2.4 to determine the approximate location of 2938 corresponding media. Once media from the new Variant Stream has been 2939 loaded, the timestamps in the Media Segments can be used to 2940 synchronize the old and new timelines precisely. 2942 A client MUST NOT attempt to use the Media Sequence Number to 2943 synchronize between streams (see Section 6.3.2). 2945 6.3.5. Determining the Next Segment to Load 2947 The client MUST examine the Media Playlist file every time it is 2948 loaded or reloaded to determine the next Media Segment to load, as 2949 the set of available media MAY have changed. 2951 The first segment to load is generally the segment that the client 2952 has chosen to play first (see Section 6.3.3). 2954 In order to play the presentation normally, the next Media Segment to 2955 load is the one with the lowest Media Sequence Number that is greater 2956 than the Media Sequence Number of the last Media Segment loaded. 2958 6.3.6. Decrypting Encrypted Media Segments 2960 If a Media Playlist file contains an EXT-X-KEY tag that specifies a 2961 Key file URI, the client can obtain that Key file and use the key 2962 inside it to decrypt all Media Segments to which that EXT-X-KEY tag 2963 applies. 2965 A client MUST ignore any EXT-X-KEY tag with an unsupported or 2966 unrecognized KEYFORMAT attribute, to allow for cross-device 2967 addressability. If the Playlist contains a Media Segment to which 2968 only EXT-X-KEY tags with unrecognized or unsupported KEYFORMAT 2969 attributes are applied, playback SHOULD fail. 2971 A client MUST NOT attempt to decrypt any segments whose EXT-X-KEY tag 2972 has a METHOD attribute that it does not recognize. 2974 If the encryption METHOD is AES-128, AES-128 CBC decryption SHALL be 2975 applied to individual Media Segments, whose encryption format is 2976 described in Section 4.4.4.4. 2978 If the encryption METHOD is AES-128 and the Media Segment is part of 2979 an I-frame Playlist (Section 4.4.3.6) and it has an EXT-X-BYTERANGE 2980 tag applied to it, special care needs to be taken in loading and 2981 decrypting the segment, because the resource identified by the URI is 2982 encrypted in 16-byte blocks from the start of the resource. 2984 The decrypted I-frame can be recovered by first widening its byte 2985 range, as specified by the EXT-X-BYTERANGE tag, so that it starts and 2986 ends on 16-byte boundaries from the start of the resource. 2988 Next, the byte range is widened further to include a 16-byte block at 2989 the beginning of the range. This 16-byte block allows the correct IV 2990 for the following block to be calculated. 2992 The widened byte range can then be loaded and decrypted with AES-128 2993 CBC using an arbitrary IV. The number of bytes added to the 2994 beginning and the end of the original byte range are discarded from 2995 the decrypted bytes; what remains is the decrypted I-frame. 2997 If the encryption METHOD indicates Sample Encryption, decryption 2998 SHALL be applied to encrypted media samples within the Media Segment. 3000 An EXT-X-KEY tag with a METHOD of NONE indicates that the Media 3001 Segments it applies to are not encrypted. 3003 6.3.7. Requesting Playlist Delta Updates 3005 If a Media Playlist file contains an EXT-X-SERVER-CONTROL tag with a 3006 CAN-SKIP-UNTIL attribute and no EXT-X-ENDLIST tag, a Client MAY use 3007 the _HLS_skip Delivery Directive to request Playlist Delta Updates. 3009 A Client SHOULD NOT request a Playlist Delta Update unless it already 3010 has a version of the Playlist that is no older than one-half of the 3011 Skip Boundary. 3013 The client can request a Playlist Delta Update that skips older Media 3014 Segments by adding an "_HLS_skip=YES" directive to the Media Playlist 3015 URI when it requests the Playlist. 3017 Alternately, if the EXT-X-SERVER-CONTROL tag contains a CAN-SKIP- 3018 DATERANGES=YES attribute, the client can request a Playlist Delta 3019 Update that skips both older Segments and older EXT-X-DATERANGE tags 3020 by adding an "_HLS_skip=v2" directive to the Media Playlist URI when 3021 it requests the Playlist. 3023 A Client MUST merge the contents of a Playlist Delta Update with its 3024 previous version of the Playlist to form an up-to-date version of the 3025 Playlist. If a Client receives a Playlist containing an EXT-X-SKIP 3026 tag and finds that it does not already have all of the information 3027 that was skipped, it MUST obtain a complete copy of the Playlist by 3028 reissuing its Playlist request without the _HLS_skip directive. 3030 6.3.8. Issuing Blocking Requests 3032 Clients MUST NOT request Blocking Playlist Reloads unless the 3033 Playlist contains an EXT-X-SERVER-CONTROL tag with a CAN-BLOCK- 3034 RELOAD=YES attribute. 3036 If Blocking Playlist Reloads are supported, Clients SHOULD use the 3037 _HLS_msn Delivery Directive (and _HLS_part, if the Playlist contains 3038 Partial Segments) to obtain Playlist updates in preference to the 3039 polling regime described in Section 6.3.4. 3041 If up-to-date information on the next expected Media Sequence Number 3042 of a Rendition is not available, a Client SHOULD use a tune-in 3043 algorithm such as the one described in Appendix C to obtain a recent 3044 version of the Playlist. 3046 Clients MUST ignore EXT-X-PRELOAD-HINT tags with unrecognized TYPE 3047 attributes. Clients SHOULD ignore all but the first EXT-X-PRELOAD- 3048 HINT tag in a Playlist with a particular TYPE attribute. 3050 When processing a Playlist containing an EXT-X-PRELOAD-HINT tag with 3051 TYPE=PART, a Client with sufficient space in its download pipeline 3052 that is not already loading the hinted resource SHOULD request it. 3053 This will typically happen at the same time as its blocking request 3054 for the next Playlist update. 3056 When processing a Playlist containing an EXT-X-PRELOAD-HINT tag with 3057 TYPE=MAP, a Client with sufficient space in its download pipeline 3058 that has not already cached the hinted Media Initialization 3059 Section SHOULD request it. 3061 A Client SHOULD cancel a request for a hinted resource if it is not 3062 present in a subsequent Playlist update, such as in an EXT-X-PRELOAD- 3063 HINT tag or as part of another tag such as EXT-X-PART. The client 3064 SHOULD ignore the results of such requests. 3066 A Client SHOULD recognize when a Partial Segment indicated by an EXT- 3067 X-PART tag is a subrange of a hint download and obtain the Partial 3068 Segment from the hint download. Clients SHOULD recognize contiguous 3069 ranges between existing Partial Segments and Partial Segment hints 3070 and avoid duplicate downloads. 3072 7. Protocol Version Compatibility 3074 Protocol compatibility is specified by the EXT-X-VERSION tag. A 3075 Playlist that contains tags or attributes that are not compatible 3076 with protocol version 1 MUST include an EXT-X-VERSION tag. 3078 A client MUST NOT attempt playback if it does not support the 3079 protocol version specified by the EXT-X-VERSION tag, or unintended 3080 behavior could occur. 3082 A Media Playlist MUST indicate an EXT-X-VERSION of 2 or higher if it 3083 contains: 3085 o The IV attribute of the EXT-X-KEY tag. 3087 A Media Playlist MUST indicate an EXT-X-VERSION of 3 or higher if it 3088 contains: 3090 o Floating-point EXTINF duration values. 3092 A Media Playlist MUST indicate an EXT-X-VERSION of 4 or higher if it 3093 contains: 3095 o The EXT-X-BYTERANGE tag. 3097 o The EXT-X-I-FRAMES-ONLY tag. 3099 A Media Playlist MUST indicate an EXT-X-VERSION of 5 or higher if it 3100 contains: 3102 o An EXT-X-KEY tag with a METHOD of SAMPLE-AES. 3104 o The KEYFORMAT and KEYFORMATVERSIONS attributes of the EXT-X-KEY 3105 tag. 3107 o The EXT-X-MAP tag. 3109 A Media Playlist MUST indicate an EXT-X-VERSION of 6 or higher if it 3110 contains: 3112 o The EXT-X-MAP tag in a Media Playlist that does not contain EXT- 3113 X-I-FRAMES-ONLY. 3115 Note that in protocol version 6, the semantics of the EXT- 3116 X-TARGETDURATION tag changed slightly. In protocol version 5 and 3117 earlier it indicated the maximum segment duration; in protocol 3118 version 6 and later it indicates the the maximum segment duration 3119 rounded to the nearest integer number of seconds. 3121 A Master Playlist MUST indicate an EXT-X-VERSION of 7 or higher if it 3122 contains: 3124 o "SERVICE" values for the INSTREAM-ID attribute of the EXT-X-MEDIA 3125 tag. 3127 A Playlist MUST indicate an EXT-X-VERSION of 8 or higher if it 3128 contains: 3130 o Variable substitution. 3132 A Playlist MUST indicate an EXT-X-VERSION of 9 or higher if it 3133 contains: 3135 o The EXT-X-SKIP tag. 3137 A Playlist MUST indicate an EXT-X-VERSION of 10 or higher if it 3138 contains: 3140 o An EXT-X-SKIP tag that replaces EXT-X-DATERANGE tags in a Playlist 3141 Delta Update. 3143 The EXT-X-MEDIA tag and the AUDIO, VIDEO, and SUBTITLES attributes of 3144 the EXT-X-STREAM-INF tag are backward compatible to protocol version 3145 1, but playback on older clients may not be desirable. A server MAY 3146 consider indicating an EXT-X-VERSION of 4 or higher in the Master 3147 Playlist but is not required to do so. 3149 The PROGRAM-ID attribute of the EXT-X-STREAM-INF and the EXT-X-I- 3150 FRAME-STREAM-INF tags was removed in protocol version 6. 3152 The EXT-X-ALLOW-CACHE tag was removed in protocol version 7. 3154 8. Playlist Examples 3156 8.1. Simple Media Playlist 3158 #EXTM3U 3159 #EXT-X-TARGETDURATION:10 3160 #EXT-X-VERSION:3 3161 #EXTINF:9.009, 3162 http://media.example.com/first.ts 3163 #EXTINF:9.009, 3164 http://media.example.com/second.ts 3165 #EXTINF:3.003, 3166 http://media.example.com/third.ts 3167 #EXT-X-ENDLIST 3169 8.2. Live Media Playlist Using HTTPS 3171 #EXTM3U 3172 #EXT-X-VERSION:3 3173 #EXT-X-TARGETDURATION:8 3174 #EXT-X-MEDIA-SEQUENCE:2680 3176 #EXTINF:7.975, 3177 https://priv.example.com/fileSequence2680.ts 3178 #EXTINF:7.941, 3179 https://priv.example.com/fileSequence2681.ts 3180 #EXTINF:7.975, 3181 https://priv.example.com/fileSequence2682.ts 3183 8.3. Playlist with Encrypted Media Segments 3184 #EXTM3U 3185 #EXT-X-VERSION:3 3186 #EXT-X-MEDIA-SEQUENCE:7794 3187 #EXT-X-TARGETDURATION:15 3189 #EXT-X-KEY:METHOD=AES-128,URI="https://priv.example.com/key.php?r=52" 3191 #EXTINF:2.833, 3192 http://media.example.com/fileSequence52-A.ts 3193 #EXTINF:15.0, 3194 http://media.example.com/fileSequence52-B.ts 3195 #EXTINF:13.333, 3196 http://media.example.com/fileSequence52-C.ts 3198 #EXT-X-KEY:METHOD=AES-128,URI="https://priv.example.com/key.php?r=53" 3200 #EXTINF:15.0, 3201 http://media.example.com/fileSequence53-A.ts 3203 8.4. Master Playlist 3205 #EXTM3U 3206 #EXT-X-STREAM-INF:BANDWIDTH=1280000,AVERAGE-BANDWIDTH=1000000 3207 http://example.com/low.m3u8 3208 #EXT-X-STREAM-INF:BANDWIDTH=2560000,AVERAGE-BANDWIDTH=2000000 3209 http://example.com/mid.m3u8 3210 #EXT-X-STREAM-INF:BANDWIDTH=7680000,AVERAGE-BANDWIDTH=6000000 3211 http://example.com/hi.m3u8 3212 #EXT-X-STREAM-INF:BANDWIDTH=65000,CODECS="mp4a.40.5" 3213 http://example.com/audio-only.m3u8 3215 8.5. Master Playlist with I-Frames 3217 #EXTM3U 3218 #EXT-X-STREAM-INF:BANDWIDTH=1280000 3219 low/audio-video.m3u8 3220 #EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=86000,URI="low/iframe.m3u8" 3221 #EXT-X-STREAM-INF:BANDWIDTH=2560000 3222 mid/audio-video.m3u8 3223 #EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=150000,URI="mid/iframe.m3u8" 3224 #EXT-X-STREAM-INF:BANDWIDTH=7680000 3225 hi/audio-video.m3u8 3226 #EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=550000,URI="hi/iframe.m3u8" 3227 #EXT-X-STREAM-INF:BANDWIDTH=65000,CODECS="mp4a.40.5" 3228 audio-only.m3u8 3230 8.6. Master Playlist with Alternative Audio 3232 In this example, the CODECS attributes have been condensed for space. 3233 A '\' is used to indicate that the tag continues on the following 3234 line with whitespace removed: 3236 #EXTM3U 3237 #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="aac",NAME="English", \ 3238 DEFAULT=YES,AUTOSELECT=YES,LANGUAGE="en", \ 3239 URI="main/english-audio.m3u8" 3240 #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="aac",NAME="Deutsch", \ 3241 DEFAULT=NO,AUTOSELECT=YES,LANGUAGE="de", \ 3242 URI="main/german-audio.m3u8" 3243 #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="aac",NAME="Commentary", \ 3244 DEFAULT=NO,AUTOSELECT=NO,LANGUAGE="en", \ 3245 URI="commentary/audio-only.m3u8" 3246 #EXT-X-STREAM-INF:BANDWIDTH=1280000,CODECS="...",AUDIO="aac" 3247 low/video-only.m3u8 3248 #EXT-X-STREAM-INF:BANDWIDTH=2560000,CODECS="...",AUDIO="aac" 3249 mid/video-only.m3u8 3250 #EXT-X-STREAM-INF:BANDWIDTH=7680000,CODECS="...",AUDIO="aac" 3251 hi/video-only.m3u8 3252 #EXT-X-STREAM-INF:BANDWIDTH=65000,CODECS="mp4a.40.5",AUDIO="aac" 3253 main/english-audio.m3u8 3255 8.7. Master Playlist with Alternative Video 3257 This example shows three different video Renditions (Main, 3258 Centerfield, and Dugout) and three different Variant Streams (low, 3259 mid, and high). In this example, clients that did not support the 3260 EXT-X-MEDIA tag and the VIDEO attribute of the EXT-X-STREAM-INF tag 3261 would only be able to play the video Rendition "Main". 3263 Since the EXT-X-STREAM-INF tag has no AUDIO attribute, all video 3264 Renditions would be required to contain the audio. 3266 In this example, the CODECS attributes have been condensed for space. 3267 A '\' is used to indicate that the tag continues on the following 3268 line with whitespace removed: 3270 #EXTM3U 3271 #EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="low",NAME="Main", \ 3272 DEFAULT=YES,URI="low/main/audio-video.m3u8" 3273 #EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="low",NAME="Centerfield", \ 3274 DEFAULT=NO,URI="low/centerfield/audio-video.m3u8" 3275 #EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="low",NAME="Dugout", \ 3276 DEFAULT=NO,URI="low/dugout/audio-video.m3u8" 3278 #EXT-X-STREAM-INF:BANDWIDTH=1280000,CODECS="...",VIDEO="low" 3279 low/main/audio-video.m3u8 3281 #EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="mid",NAME="Main", \ 3282 DEFAULT=YES,URI="mid/main/audio-video.m3u8" 3283 #EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="mid",NAME="Centerfield", \ 3284 DEFAULT=NO,URI="mid/centerfield/audio-video.m3u8" 3285 #EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="mid",NAME="Dugout", \ 3286 DEFAULT=NO,URI="mid/dugout/audio-video.m3u8" 3288 #EXT-X-STREAM-INF:BANDWIDTH=2560000,CODECS="...",VIDEO="mid" 3289 mid/main/audio-video.m3u8 3291 #EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="hi",NAME="Main", \ 3292 DEFAULT=YES,URI="hi/main/audio-video.m3u8" 3293 #EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="hi",NAME="Centerfield", \ 3294 DEFAULT=NO,URI="hi/centerfield/audio-video.m3u8" 3295 #EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="hi",NAME="Dugout", \ 3296 DEFAULT=NO,URI="hi/dugout/audio-video.m3u8" 3298 #EXT-X-STREAM-INF:BANDWIDTH=7680000,CODECS="...",VIDEO="hi" 3299 hi/main/audio-video.m3u8 3301 8.8. Session Data in a Master Playlist 3303 In this example, only the EXT-X-SESSION-DATA is shown: 3305 #EXT-X-SESSION-DATA:DATA-ID="com.example.lyrics",URI="lyrics.json" 3307 #EXT-X-SESSION-DATA:DATA-ID="com.example.title",LANGUAGE="en", \ 3308 VALUE="This is an example" 3309 #EXT-X-SESSION-DATA:DATA-ID="com.example.title",LANGUAGE="es", \ 3310 VALUE="Este es un ejemplo" 3312 8.9. CHARACTERISTICS Attribute Containing Multiple Characteristics 3314 Certain characteristics are valid in combination, as in: 3316 CHARACTERISTICS= 3317 "public.accessibility.transcribes-spoken-dialog,public.easy-to-read" 3319 8.10. EXT-X-DATERANGE Carrying SCTE-35 Tags 3321 This example shows two EXT-X-DATERANGE tags that describe a single 3322 Date Range, with an SCTE-35 "out" splice_insert() command that is 3323 subsequently updated with an SCTE-35 "in" splice_insert() command. 3325 #EXTM3U 3326 ... 3327 #EXT-X-DATERANGE:ID="splice-6FFFFFF0",START-DATE="2014-03-05T11: 3328 15:00Z",PLANNED-DURATION=59.993,SCTE35-OUT=0xFC002F0000000000FF0 3329 00014056FFFFFF000E011622DCAFF000052636200000000000A0008029896F50 3330 000008700000000 3332 ... Media Segment declarations for 60s worth of media 3334 #EXT-X-DATERANGE:ID="splice-6FFFFFF0",DURATION=59.993,SCTE35-IN= 3335 0xFC002A0000000000FF00000F056FFFFFF000401162802E6100000000000A00 3336 08029896F50000008700000000 3337 ... 3339 8.11. Low-Latency Playlist 3341 This example shows the end of a Playlist that contains Partial 3342 Segments. Note that EXT-X-PART tags have been removed from earlier 3343 Parent Segments. The Playlist also includes a Preload Hint, a 3344 Rendition Report, and a mid-roll advertisement. 3346 #EXTM3U 3347 #EXT-X-TARGETDURATION:4 3348 ... 3349 #EXTINF:4.00008, 3350 fileSequence268.mp4 3351 #EXTINF:4.00008, 3352 fileSequence269.mp4 3353 #EXTINF:4.00008, 3354 fileSequence270.mp4 3355 #EXT-X-PART:DURATION=2.00004,INDEPENDENT=YES,URI="filePart271.0.mp4" 3356 #EXT-X-PART:DURATION=2.00004,URI="filePart271.1.mp4" 3357 #EXTINF:4.00008, 3358 fileSequence271.mp4 3359 #EXT-X-PART:DURATION=2.00004,INDEPENDENT=YES,URI="filePart272.0.mp4" 3360 #EXT-X-PART:DURATION=0.50001,URI="filePart272.1.mp4" 3361 #EXTINF:2.50005, 3362 fileSequence272.mp4 3363 #EXT-X-DISCONTINUITY 3364 #EXT-X-PART:DURATION=2.00004,INDEPENDENT=YES,URI="midRoll273.0.mp4" 3365 #EXT-X-PART:DURATION=2.00004,URI="midRoll273.1.mp4" 3366 #EXTINF:4.00008, 3367 midRoll273.mp4 3368 #EXT-X-PART:DURATION=2.00004,INDEPENDENT=YES,URI="midRoll274.0.mp4" 3369 #EXT-X-PRELOAD-HINT:TYPE=PART,URI="midRoll274.1.mp4" 3370 #EXT-X-RENDITION-REPORT:URI="/1M/LL-HLS.m3u8",LAST-MSN=274,LAST-PART=1 3372 9. Contributors 3374 Significant contributions to the design of this protocol were made by 3375 Jim Batson, David Biderman, Bill May, Roger Pantos, Alan Tseng, and 3376 Eryk Vershen. Stuart Cheshire helped edit the specification. 3378 Significant contributions to the update of this protocol were made by 3379 Bill May, Eryk Vershen, and Peng Zhou. 3381 In particular, Bill May co-authored the first edition of HTTP Live 3382 Streaming, [RFC8216], and continues to provide valuable guidance and 3383 input. 3385 10. IANA Considerations 3387 IANA has registered the following media type [RFC2046]: 3389 Type name: application 3391 Subtype name: vnd.apple.mpegurl 3393 Required parameters: none 3394 Optional parameters: none 3396 Encoding considerations: encoded as UTF-8, which is 8-bit text. This 3397 media type may require encoding on transports not capable of handling 3398 8-bit text. See Section 4 for more information. 3400 Security considerations: See Section 11. 3402 Compression: this media type does not employ compression. 3404 Interoperability considerations: There are no byte-ordering issues, 3405 since files are 8-bit text. Applications could encounter 3406 unrecognized tags, which SHOULD be ignored. 3408 Published specification: see Section 4. 3410 Applications that use this media type: Multimedia applications such 3411 as the iPhone media player in iOS 3.0 and later and QuickTime Player 3412 in Mac OS X version 10.6 and later. 3414 Fragment identifier considerations: no Fragment Identifiers are 3415 defined for this media type. 3417 Query parameter considerations: the definition of all query 3418 parameters for resources of this media type which begin with the 3419 string "_HLS_" are reserved by this specification. Currently-defined 3420 query parameters are specified in Section 6.2.5. 3422 Additional information: 3424 Deprecated alias names for this type: none 3425 Magic number(s): #EXTM3U 3426 File extension(s): .m3u8, .m3u (see Section 4) 3427 Macintosh file type code(s): none 3429 Person & email address to contact for further information: David 3430 Singer, singer AT apple.com. 3432 Intended usage: LIMITED USE 3434 Restrictions on usage: none 3436 Author: Roger Pantos 3438 Change Controller: David Singer 3440 11. Security Considerations 3442 Since the protocol generally uses HTTP to transfer data, most of the 3443 same security considerations apply. See Section 15 of HTTP 3444 [RFC7230]. 3446 Media file parsers are typically subject to "fuzzing" attacks. 3447 Implementors SHOULD pay particular attention to code that will parse 3448 data received from a server and ensure that all possible inputs are 3449 handled correctly. 3451 Playlist files contain URIs, which clients will use to make network 3452 requests of arbitrary entities. Clients SHOULD range-check responses 3453 to prevent buffer overflows. See also the Security Considerations 3454 section of "Uniform Resource Identifier (URI): Generic Syntax" 3455 [RFC3986]. 3457 Apart from URI resolution, this format does not employ any form of 3458 active content. 3460 Clients SHOULD limit each playback session to a reasonable number of 3461 concurrent downloads (for example, four) to avoid contributing to 3462 denial-of-service attacks. 3464 HTTP requests often include session state ("cookies"), which may 3465 contain private user data. Implementations MUST follow cookie 3466 restriction and expiry rules specified by "HTTP State Management 3467 Mechanism" [RFC6265] to protect themselves from attack. See also the 3468 Security Considerations section of that document, and "Use of HTTP 3469 State Management" [RFC2964]. 3471 Encryption keys are specified by URI. The delivery of these keys 3472 SHOULD be secured by a mechanism such as HTTP Over TLS [RFC2818] 3473 (formerly SSL) in conjunction with a secure realm or a session token. 3475 12. References 3477 12.1. Normative References 3479 [AC_3] Advanced Television Systems Committee, "Digital Audio 3480 Compression (AC-3) (E-AC-3)", ATSC Standard A/52:2010, 3481 November 2010, <http://atsc.org/wp- 3482 content/uploads/2015/03/A52-201212-17.pdf>. 3484 [AES_128] National Institute of Standards and Technology, "Advanced 3485 Encryption Standard (AES)", FIPS PUB 197, DOI 3486 10.6028/NIST.FIPS.197, November 2001, 3487 <http://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.197.pdf>. 3489 [CEA608] Consumer Technology Association, "Line 21 Data Services", 3490 ANSI/CTA Standard 608-E, April 2008, 3491 <https://standards.cta.tech/kwspub/published_docs/ANSI- 3492 CTA-608-E-R-2014-Preview.pdf>. 3494 [CEA708] Consumer Technology Association, "Digital Television (DTV) 3495 Closed Captioning", ANSI/CTA Standard CEA-708-E, August 3496 2013, <https://standards.cta.tech/kwspub/published_docs/ 3497 ANSI-CTA-708-E-Preview.pdf>. 3499 [CICP] International Organization for Standardization, 3500 "Information technology - MPEG systems technologies - Part 3501 8: Coding-independent code points", ISO/IEC International 3502 Standard 23001-8:2016, 2016, <https://www.iso.org/obp/ 3503 ui/#iso:std:iso-iec:23001:-8:ed-2:v1:en>. 3505 [CMAF] International Organization for Standardization, 3506 "Information technology -- Multimedia application format 3507 (MPEG-A) -- Part 19: Common media application format 3508 (CMAF) for segmented media", ISO/IEC International 3509 Standard 23000-19:2017, December 2017, 3510 <https://www.iso.org/standard/71975.html>. 3512 [COMMON_ENC] 3513 International Organization for Standardization, 3514 "Information technology -- MPEG systems technologies -- 3515 Part 7: Common encryption in ISO base media file format 3516 files", ISO/IEC International Standard 23001-7:2016, 3517 February 2016, <http://www.iso.org/iso/ 3518 catalogue_detail.htm?csnumber=68042>. 3520 [H_264] International Telecommunications Union, "Advanced video 3521 coding for generic audiovisual services", January 2012, 3522 <http://www.itu.int/rec/T-REC-H.264>. 3524 [HDCP] Digital Content Protection LLC, "High-bandwidth Digital 3525 Content Protection System - Mapping HDCP to HDMI", 3526 February 2013, <http://www.digital- 3527 cp.com/sites/default/files/specifications/ 3528 HDCP%20on%20HDMI%20Specification%20Rev2_2_Final1.pdf>. 3530 [IMSC1] W3C, "TTML Profiles for Internet Media Subtitles and 3531 Captions 1.0 (IMSC1)", April 2016, 3532 <https://www.w3.org/TR/ttml-imsc1/>. 3534 [ISO_13818] 3535 International Organization for Standardization, "Generic 3536 coding of moving pictures and associated audio 3537 information", ISO/IEC International Standard 13818:2007, 3538 October 2007, 3539 <http://www.iso.org/iso/catalogue_detail?csnumber=44169>. 3541 [ISO_13818_3] 3542 International Organization for Standardization, "Generic 3543 coding of moving pictures and associated audio information 3544 -- Part 3: Audio", ISO/IEC International 3545 Standard 13818-3:1998, April 1998, 3546 <http://www.iso.org/iso/home/store/catalogue_tc/ 3547 catalogue_detail.htm?csnumber=26797>. 3549 [ISO_13818_7] 3550 International Organization for Standardization, "Generic 3551 coding of moving pictures and associated audio information 3552 -- Part 7: Advanced Audio Coding (AAC)", ISO/IEC 3553 International Standard 13818-7:2006, January 2006, 3554 <http://www.iso.org/iso/home/store/catalogue_tc/ 3555 catalogue_detail.htm?csnumber=43345>. 3557 [ISO_14496] 3558 International Organization for Standardization, 3559 "Information technology -- Coding of audio-visual objects 3560 -- Part 3: Audio", ISO/IEC International 3561 Standard 14496-3:2009, 2009, 3562 <http://www.iso.org/iso/catalogue_detail?csnumber=53943>. 3564 [ISO_8601] 3565 International Organization for Standardization, "Data 3566 elements and interchange formats -- Information 3567 interchange -- Representation of dates and times", ISO/IEC 3568 International Standard 8601:2004, December 2004, 3569 <http://www.iso.org/iso/catalogue_detail?csnumber=40874>. 3571 [ISOBMFF] International Organization for Standardization, 3572 "Information technology -- Coding of audio-visual objects 3573 -- Part 12: ISO base media file format", ISO/IEC 3574 International Standard 14496-12:2015, December 2015, 3575 <http://www.iso.org/iso/ 3576 catalogue_detail.htm?csnumber=68960>. 3578 [MP4_TIMED_TEXT] 3579 International Organization for Standardization, 3580 "Information technology -- Coding of audio-visual objects 3581 -- Part 30: Timed text and other visual overlays in ISO 3582 base media file format", ISO/IEC International 3583 Standard 14496-30:2014, March 2014, 3584 <https://www.iso.org/standard/63107.html>. 3586 [RFC2046] Freed, N. and N. Borenstein, "Multipurpose Internet Mail 3587 Extensions (MIME) Part Two: Media Types", RFC 2046, 3588 DOI 10.17487/RFC2046, November 1996, 3589 <https://www.rfc-editor.org/info/rfc2046>. 3591 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 3592 Requirement Levels", BCP 14, RFC 2119, 3593 DOI 10.17487/RFC2119, March 1997, 3594 <https://www.rfc-editor.org/info/rfc2119>. 3596 [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, 3597 DOI 10.17487/RFC2818, May 2000, 3598 <https://www.rfc-editor.org/info/rfc2818>. 3600 [RFC2964] Moore, K. and N. Freed, "Use of HTTP State Management", 3601 BCP 44, RFC 2964, DOI 10.17487/RFC2964, October 2000, 3602 <https://www.rfc-editor.org/info/rfc2964>. 3604 [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 3605 10646", STD 63, RFC 3629, DOI 10.17487/RFC3629, November 3606 2003, <https://www.rfc-editor.org/info/rfc3629>. 3608 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 3609 Resource Identifier (URI): Generic Syntax", STD 66, 3610 RFC 3986, DOI 10.17487/RFC3986, January 2005, 3611 <https://www.rfc-editor.org/info/rfc3986>. 3613 [RFC5646] Phillips, A., Ed. and M. Davis, Ed., "Tags for Identifying 3614 Languages", BCP 47, RFC 5646, DOI 10.17487/RFC5646, 3615 September 2009, <https://www.rfc-editor.org/info/rfc5646>. 3617 [RFC5652] Housley, R., "Cryptographic Message Syntax (CMS)", STD 70, 3618 RFC 5652, DOI 10.17487/RFC5652, September 2009, 3619 <https://www.rfc-editor.org/info/rfc5652>. 3621 [RFC6265] Barth, A., "HTTP State Management Mechanism", RFC 6265, 3622 DOI 10.17487/RFC6265, April 2011, 3623 <https://www.rfc-editor.org/info/rfc6265>. 3625 [RFC6381] Gellens, R., Singer, D., and P. Frojdh, "The 'Codecs' and 3626 'Profiles' Parameters for "Bucket" Media Types", RFC 6381, 3627 DOI 10.17487/RFC6381, August 2011, 3628 <https://www.rfc-editor.org/info/rfc6381>. 3630 [RFC7230] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 3631 Protocol (HTTP/1.1): Message Syntax and Routing", 3632 RFC 7230, DOI 10.17487/RFC7230, June 2014, 3633 <https://www.rfc-editor.org/info/rfc7230>. 3635 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 3636 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 3637 May 2017, <https://www.rfc-editor.org/info/rfc8174>. 3639 [RFC8216] Pantos, R., Ed. and W. May, "HTTP Live Streaming", 3640 RFC 8216, DOI 10.17487/RFC8216, August 2017, 3641 <https://www.rfc-editor.org/info/rfc8216>. 3643 [RFC8259] Bray, T., Ed., "The JavaScript Object Notation (JSON) Data 3644 Interchange Format", STD 90, RFC 8259, 3645 DOI 10.17487/RFC8259, December 2017, 3646 <https://www.rfc-editor.org/info/rfc8259>. 3648 [RFC8673] Pratt, C., Thakore, D., and B. Stark, "HTTP Random Access 3649 and Live Content", RFC 8673, DOI 10.17487/RFC8673, 3650 November 2019, <https://www.rfc-editor.org/info/rfc8673>. 3652 [SCTE35] Society of Cable Telecommunications Engineers, "Digital 3653 Program Insertion Cueing Message for Cable", ANSI/SCTE 35, 3654 August 2014, <http://www.scte.org/documents/pdf/Standards/ 3655 ANSI_SCTE%2035%202014.pdf>. 3657 [US_ASCII] 3658 American National Standards Institute, "Coded Character 3659 Sets - 7-Bit American National Standard Code for 3660 Information Interchange (7-Bit ASCII)", ANSI X3.4, 3661 December 1986. 3663 [WebVTT] World Wide Web Consortium (W3C), ""WebVTT: The Web Video 3664 Text Tracks Format", Draft Community Group Report", July 3665 2013, <http://dev.w3.org/html5/webvtt/>. 3667 12.2. Informative References 3669 [ID3] ID3.org, "The ID3 audio file data tagging format", 3670 <http://www.id3.org/Developer_Information>. 3672 [M3U] "M3U (MP3 URL)", <http://wikipedia.org/wiki/M3U>. 3674 [MCT] Apple Inc., "QuickTime File Format Specification - Media 3675 Characteristic Tags", <https://developer.apple.com/library 3676 /archive/documentation/QuickTime/QTFF/QTFFChap2/ 3677 qtff2.html>. 3679 [SampleEnc] 3680 Apple Inc., "MPEG-2 Stream Encryption Format for HTTP Live 3681 Streaming", 3682 <https://developer.apple.com/library/ios/documentation/ 3683 AudioVideo/Conceptual/HLS_Sample_Encryption/>. 3685 [UNICODE] The Unicode Consortium, "The Unicode Standard", 3686 <https://www.unicode.org/versions/latest/>. 3688 Appendix A. Changes from RFC 8216 3690 Several changes have been made since the publication of RFC 8216 3691 [RFC8216]. 3693 The following tags have been added: EXT-X-GAP, EXT-X-BITRATE, EXT-X- 3694 SERVER-CONTROL, EXT-X-SKIP, EXT-X-PART-INF, EXT-X-PART, EXT-X- 3695 PRELOAD-HINT, and EXT-X-RENDITION-REPORT. 3697 The EXT-X-DEFINE tag was introduced to support variable substitution. 3699 IMSC has been added to the set of recognized subtitle formats. 3701 The VIDEO-RANGE, ALLOWED-CPC, and STABLE-VARIANT-ID attributes have 3702 been added to the EXT-X-STREAM-INF and EXT-X-I-FRAME-STREAM-INF tags. 3704 The STABLE-RENDITION-ID attribute has been added to the EXT-X-MEDIA 3705 tag. 3707 TYPE-1 has been added as a defined value for the HDCP-LEVEL 3708 attribute. 3710 Redefined the CHANNELS attribute value. 3712 The minimum new segment publication latency has been removed from 3713 server timing model. 3715 The Availability Duration of a Media Segment now depends on the 3716 presence of an EXT-X-ENDLIST tag. 3718 The recommended playlist offset to join a live stream has changed. 3720 The minimum delay before reloading a Playlist file has changed. 3722 The definition of peak segment bit rate was changed to ensure every 3723 segment is included in at least one contiguous set. 3725 Media Metadata tags such as EXT-X-DATERANGE may be removed from 3726 playlists. 3728 Partial Segments were defined as a means to reduce publishing 3729 latency. 3731 Delivery Directives were introduced, including support for Playlist 3732 Delta Updates and Blocking Playlist Reload. 3734 A Low-Latency Server Configuration Profile was added to Appendix B. 3736 Correct the reference for the semantics of the CHARACTERISTICS 3737 attribute. 3739 Appendix C was added. 3741 There have been a number of minor editorial changes. 3743 Appendix B. Server Configuration Profiles 3745 Server Configuration Profiles specify additional requirements that 3746 optimize delivery of HTTP Live Streaming for certain use cases. 3748 B.1. Low-Latency Server Configuration Profile 3750 Playing at a reduced delay from live requires certain stream and 3751 transport features to support the timely delivery of media. Clients 3752 SHOULD verify that the server meets these requirements before playing 3753 at a delay-from-live of less than two Target Durations. Because the 3754 Low-Latency extensions are additions rather than replacements, 3755 clients can and SHOULD fall back to regular-latency playback if they 3756 discover that the server does not meet the requirements of this 3757 configuration profile. 3759 This profile places the following requirements on stream production: 3761 All Media Playlists have EXT-X-PROGRAM-DATE-TIME tags. This 3762 allows more-precise mapping between Segments across Renditions. 3763 Note that real-time clocks are NOT required to be synchronized 3764 between client and server. 3766 Each (non-Partial) Media Segment in a Media Playlist will contain 3767 at least one independent frame. 3769 A Playlist that contains an EXT-X-PART tag but no EXT-X-ENDLIST 3770 tag will also contain an EXT-X-PRELOAD-HINT tag that specifies the 3771 next Partial Segment that is expected to be added to the Playlist. 3773 If the Partial Segment specified by an EXT-X-PRELOAD-HINT tag has 3774 a different Media Initialization Section than the last Partial 3775 Segment in the Playlist, the Playlist will also contain an EXT-X- 3776 PRELOAD-HINT tag with TYPE=MAP that hints the Media Initialization 3777 Section of the hinted Partial Segment. 3779 Each Media Playlist contains one EXT-X-RENDITION-REPORT tag for 3780 each Media Playlist (Rendition) in the Master Playlist, except for 3781 the Media Playlist to which the EXT-X-RENDITION-REPORT tag is 3782 being added, and Playlists that contain the EXT-X-I-FRAMES-ONLY 3783 tag. 3785 This profile places the following requirements on stream delivery: 3787 HTTP-delivered Playlists and Segments are served via HTTP/2. 3788 Efficient delivery requires HTTP/2 priority control (dependencies 3789 and weights) and support for Ping frames. 3791 Each server offers the entire set of Variant Streams in the master 3792 Playlist. This allows rapid bit rate switching without connection 3793 reestablishment. 3795 Servers support HTTP Range requests if Media Playlists contain the 3796 BYTERANGE, BYTERANGE-START, or BYTERANGE-LENGTH attributes. 3798 TCP connections support Selective Acknowledgment (SACK) across the 3799 entire route from client to server. This improves the performance 3800 of TCP loss recovery 3802 Playlist requests are idempotent. 3804 Playlists are delivered in GZIP format. This speeds up Media 3805 Playlist reload and Rendition switching. 3807 All Renditions in a Master Playlist are updated in sync, within an 3808 accuracy of one Part Target Duration. 3810 CDNs and other proxy caches recognize blocking requests for 3811 Playlists and Media Segments whose cache fill is already pending, 3812 and hold the duplicate requests until they can be delivered from 3813 that cache fill. This minimizes the load on the active origin. 3815 HTTP caches used to deliver Playlists or Segments will set the Age 3816 HTTP Response header. 3818 In addition, the following configurations are recommended: 3820 TCP connections should set Explicit Congestion Notification (ECN) 3821 during congestion. They should also use TCP timestamps, TAIL LOSS 3822 probe, and TCP RACK. These configurations improve the performance 3823 of TCP loss recovery. See RFC 2018, RFC 3168, RFC 7323, and IETF 3824 draft-ietf-tcpm-rack for more information about these TCP options. 3826 Servers should support TLS 1.3 or higher. This reduces time to 3827 connect. Servers should also support TLS 1.3 0-RTT connections 3828 for Media Playlists and Media Segments. 3830 Blocking Playlist Reload allows longer caching of Playlists 3831 without detriment to Clients. Successful responses to blocking 3832 Playlist requests should be cached for six Target Durations. 3833 Unsuccessful responses (such as 404s) should be cached for four 3834 Target Durations. Successful responses to non-blocking Playlist 3835 requests should be cached for half the Target Duration. 3836 Unsuccessful responses to non-blocking Playlist requests should be 3837 cached for for one Target Duration. 3839 Successful responses to blocking Media segment requests should be 3840 cached for six Target Durations. Unsuccessful responses should be 3841 cached for one Target Duration. 3843 Origin servers should use Cache-Control headers to communicate the 3844 desired cache lifetime. 3846 The recommended Target Duration is six seconds. 3848 The recommended GOP size is between one and two seconds. Smaller 3849 GOPs allow faster switching between Renditions. 3851 Appendix C. Low-Latency CDN Tune-in 3853 Clients SHOULD support delivery of low-latency streams through CDNs 3854 and other HTTP caches. Correctly implementing PART-HOLD-BACK, the 3855 server-recommended playback delay from live, requires that the client 3856 first obtain a reasonably up-to-date version of the Media Playlist. 3858 There are various approaches that a client may take to obtain a 3859 recent version of a Media Playlist. The following algorithm 3860 typically requires two Playlist requests to obtain a Playlist that is 3861 within one Part Target Duration of the current Playlist: 3863 1. Send a request for the Media Playlist that does not include an 3864 _HLS_msn or _HLS_part directive. 3866 2. Record the first Playlist response, including its received time 3867 and Age header. If there's no Age header in the first Playlist 3868 response, consider the Playlist to be up to date. (No Age header 3869 means that the response came directly from the origin, rather 3870 than being held for a period of time in an intervening HTTP 3871 cache.) 3873 3. If there is an Age header in the first Playlist response, set the 3874 goalDuration to match the Age value. Increase the goalDuration 3875 by one second if the Part Target Duration is less than 1.0. 3877 4. While the Age value is greater than or equal to the floor of the 3878 Part Target Duration: 3880 A. Set currentGoal to be the goalDuration plus the amount of 3881 time since the first Playlist response. 3883 B. If the current version of the Playlist has at least 3884 currentGoal more media in it than the first Playlist, 3885 consider the current Playlist to be up to date. 3887 C. Use the Target Duration and the Part Target Duration to 3888 estimate how many more segments and parts the server will add 3889 to the Playlist to contribute at least currentGoal more media 3890 to it. 3892 D. Request the Media Playlist again, using the _HLS_msn and 3893 _HLS_part directives to obtain the Playlist that has the 3894 estimated additional duration of media since the first 3895 Playlist. 3897 E. Update the current Playlist and the Age value from the 3898 Playlist response. 3900 Author's Address 3902 Roger Pantos (editor) 3903 Apple Inc. 3904 Cupertino, California 3905 United States 3907 Email: http-live-streaming-review@group.apple.com