idnits 2.17.1 draft-ietf-payload-vp8-11.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. 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 : ---------------------------------------------------------------------------- ** The document seems to lack separate sections for Informative/Normative References. All references will be assumed normative when checking for downward references. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (February 10, 2014) is 3728 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) ** Obsolete normative reference: RFC 4566 (Obsoleted by RFC 8866) ** Downref: Normative reference to an Informational RFC: RFC 6386 Summary: 3 errors (**), 0 flaws (~~), 1 warning (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Payload Working Group P. Westin 3 Internet-Draft H. Lundin 4 Intended status: Standards Track M. Glover 5 Expires: August 14, 2014 J. Uberti 6 F. Galligan 7 Google 8 February 10, 2014 10 RTP Payload Format for VP8 Video 11 draft-ietf-payload-vp8-11 13 Abstract 15 This memo describes an RTP payload format for the VP8 video codec. 16 The payload format has wide applicability, as it supports 17 applications from low bit-rate peer-to-peer usage, to high bit-rate 18 video conferences. 20 Status of this Memo 22 This Internet-Draft is submitted in full conformance with the 23 provisions of BCP 78 and BCP 79. 25 Internet-Drafts are working documents of the Internet Engineering 26 Task Force (IETF). Note that other groups may also distribute 27 working documents as Internet-Drafts. The list of current Internet- 28 Drafts is at http://datatracker.ietf.org/drafts/current/. 30 Internet-Drafts are draft documents valid for a maximum of six months 31 and may be updated, replaced, or obsoleted by other documents at any 32 time. It is inappropriate to use Internet-Drafts as reference 33 material or to cite them other than as "work in progress." 35 This Internet-Draft will expire on August 14, 2014. 37 Copyright Notice 39 Copyright (c) 2014 IETF Trust and the persons identified as the 40 document authors. All rights reserved. 42 This document is subject to BCP 78 and the IETF Trust's Legal 43 Provisions Relating to IETF Documents 44 (http://trustee.ietf.org/license-info) in effect on the date of 45 publication of this document. Please review these documents 46 carefully, as they describe your rights and restrictions with respect 47 to this document. Code Components extracted from this document must 48 include Simplified BSD License text as described in Section 4.e of 49 the Trust Legal Provisions and are provided without warranty as 50 described in the Simplified BSD License. 52 Table of Contents 54 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 55 2. Conventions, Definitions and Acronyms . . . . . . . . . . . . 4 56 3. Media Format Description . . . . . . . . . . . . . . . . . . . 5 57 4. Payload Format . . . . . . . . . . . . . . . . . . . . . . . . 6 58 4.1. RTP Header Usage . . . . . . . . . . . . . . . . . . . . . 6 59 4.2. VP8 Payload Descriptor . . . . . . . . . . . . . . . . . . 7 60 4.3. VP8 Payload Header . . . . . . . . . . . . . . . . . . . . 11 61 4.4. Aggregated and Fragmented Payloads . . . . . . . . . . . . 12 62 4.5. Frame reconstruction algorithm . . . . . . . . . . . . . . 12 63 4.5.1. Partition reconstruction algorithm . . . . . . . . . . 13 64 4.6. Examples of VP8 RTP Stream . . . . . . . . . . . . . . . . 13 65 4.6.1. Key frame in a single RTP packet . . . . . . . . . . . 13 66 4.6.2. Non-discardable VP8 interframe in a single RTP 67 packet; no PictureID . . . . . . . . . . . . . . . . . 14 68 4.6.3. VP8 partitions in separate RTP packets . . . . . . . . 15 69 4.6.4. VP8 frame fragmented across RTP packets . . . . . . . 16 70 4.6.5. VP8 frame with long PictureID . . . . . . . . . . . . 18 71 5. Using VP8 with RPSI and SLI Feedback . . . . . . . . . . . . . 19 72 5.1. RPSI . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 73 5.2. SLI . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 74 5.3. Example . . . . . . . . . . . . . . . . . . . . . . . . . 20 75 6. Payload Format Parameters . . . . . . . . . . . . . . . . . . 23 76 6.1. Media Type Definition . . . . . . . . . . . . . . . . . . 23 77 6.2. SDP Parameters . . . . . . . . . . . . . . . . . . . . . . 24 78 6.2.1. Mapping of MIME Parameters to SDP . . . . . . . . . . 24 79 6.2.2. Offer/Answer Considerations . . . . . . . . . . . . . 25 80 7. Security Considerations . . . . . . . . . . . . . . . . . . . 26 81 8. Congestion Control . . . . . . . . . . . . . . . . . . . . . . 27 82 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 28 83 10. References . . . . . . . . . . . . . . . . . . . . . . . . . . 29 84 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 30 86 1. Introduction 88 This memo describes an RTP payload specification applicable to the 89 transmission of video streams encoded using the VP8 video codec 90 [RFC6386]. The format described in this document can be used both in 91 peer-to-peer and video conferencing applications. 93 VP8 is based on decomposition of frames into square sub-blocks of 94 pixels, prediction of such sub-blocks using previously constructed 95 blocks, and adjustment of such predictions (as well as synthesis of 96 unpredicted blocks) using a discrete cosine transform (hereafter 97 abbreviated as DCT). In one special case, however, VP8 uses a 98 "Walsh-Hadamard" (hereafter abbreviated as WHT) transform instead of 99 a DCT. An encoded VP8 frame is divided into two or more partitions, 100 as described in [RFC6386]. The first partition (prediction or mode) 101 contains prediction mode parameters and motion vectors for all 102 macroblocks. The remaining partitions all contain the quantized DCT/ 103 WHT coefficients for the residuals. There can be 1, 2, 4, or 8 DCT/ 104 WHT partitions per frame, depending on encoder settings. 106 In summary, the payload format described in this document enables a 107 number of features in VP8, including: 109 o Taking partition boundaries into consideration, to improve loss 110 robustness and facilitate efficient packet loss concealment at the 111 decoder. 113 o Temporal scalability. 115 o Advanced use of reference frames to enable efficient error 116 recovery. 118 o Marking of frames that have no impact on the decoding of any other 119 frame, so that these non-reference frames can be discarded in a 120 server or media-aware network element if needed. 122 2. Conventions, Definitions and Acronyms 124 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 125 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 126 document are to be interpreted as described in [RFC2119]. 128 3. Media Format Description 130 The VP8 codec uses three different reference frames for interframe 131 prediction: the previous frame, the golden frame, and the altref 132 frame. The payload specification in this memo has elements that 133 enable advanced use of the reference frames, e.g., for improved loss 134 robustness. 136 One specific use case of the three reference frame types is temporal 137 scalability. By setting up the reference hierarchy in the 138 appropriate way, up to five temporal layers can be encoded. (How to 139 set up the reference hierarchy for temporal scalability is not within 140 the scope of this memo.) 142 Another property of the VP8 codec is that it applies data 143 partitioning to the encoded data. Thus, an encoded VP8 frame can be 144 divided into two or more partitions, as described in "VP8 Data Format 145 and Decoding Guide" [RFC6386]. The first partition (prediction or 146 mode) contains prediction mode parameters and motion vectors for all 147 macroblocks. The remaining partitions all contain the transform 148 coefficients for the residuals. The first partition is decodable 149 without the remaining residual partitions. The subsequent partitions 150 may be useful even if some part of the frame is lost. This memo 151 allows the partitions to be sent separately or in the same RTP 152 packet. It may be beneficial for decoder error-concealment to send 153 the partitions in different packets, even though it is not mandatory 154 according to this specification. 156 The format specification is described in Section 4. In Section 5, a 157 method to acknowledge receipt of reference frames using RTCP 158 techniques is described. 160 The payload partitioning and the acknowledging method both serve as 161 motivation for three of the fields included in the payload format: 162 the "PID", "1st partition size" and "PictureID" fields. The ability 163 to encode a temporally scalable stream motivates the "TL0PICIDX" and 164 "TID" fields. 166 4. Payload Format 168 This section describes how the encoded VP8 bitstream is encapsulated 169 in RTP. To handle network losses usage of RTP/AVPF [RFC4585] is 170 RECOMMENDED. All integer fields in the specifications are encoded as 171 unsigned integers in network octet order. 173 4.1. RTP Header Usage 175 The general RTP payload format for VP8 is depicted below. 177 0 1 2 3 178 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 179 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 180 |V=2|P|X| CC |M| PT | sequence number | 181 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 182 | timestamp | 183 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 184 | synchronization source (SSRC) identifier | 185 +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 186 | contributing source (CSRC) identifiers | 187 | .... | 188 +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 189 | VP8 payload descriptor (integer #bytes) | 190 : : 191 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 192 | : VP8 payload header (3 octets) | 193 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 194 | VP8 pyld hdr : | 195 +-+-+-+-+-+-+-+-+ | 196 : Bytes 4..N of VP8 payload : 197 | | 198 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 199 | : OPTIONAL RTP padding | 200 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 202 The VP8 payload descriptor and VP8 payload header will be described 203 in the sequel. OPTIONAL RTP padding MUST NOT be included unless the 204 P bit is set. 206 Figure 1 208 Marker bit (M): Set for the very last packet of each encoded frame 209 in line with the normal use of the M bit in video formats. This 210 enables a decoder to finish decoding the picture, where it 211 otherwise may need to wait for the next packet to explicitly know 212 that the frame is complete. 214 Timestamp: The RTP timestamp indicates the time when the frame was 215 sampled at a clock rate of 90 kHz. 217 Sequence number: The sequence numbers are monotonically increasing 218 and set as packets are sent. 220 The remaining RTP header fields are used as specified in 221 [RFC3550]. 223 4.2. VP8 Payload Descriptor 225 The first octets after the RTP header are the VP8 payload descriptor, 226 with the following structure. 228 0 1 2 3 4 5 6 7 229 +-+-+-+-+-+-+-+-+ 230 |X|R|N|S|R| PID | (REQUIRED) 231 +-+-+-+-+-+-+-+-+ 232 X: |I|L|T|K| RSV | (OPTIONAL) 233 +-+-+-+-+-+-+-+-+ 234 I: |M| PictureID | (OPTIONAL) 235 +-+-+-+-+-+-+-+-+ 236 L: | TL0PICIDX | (OPTIONAL) 237 +-+-+-+-+-+-+-+-+ 238 T/K: |TID|Y| KEYIDX | (OPTIONAL) 239 +-+-+-+-+-+-+-+-+ 241 Figure 2 243 X: Extended control bits present. When set to one, the extension 244 octet MUST be provided immediately after the mandatory first 245 octet. If the bit is zero, all optional fields MUST be omitted. 247 R: Bit reserved for future use. MUST be set to zero and MUST be 248 ignored by the receiver. 250 N: Non-reference frame. When set to one, the frame can be discarded 251 without affecting any other future or past frames. If the 252 reference status of the frame is unknown, this bit SHOULD be set 253 to zero to avoid discarding frames needed for reference. 255 Informative note: This document does not describe how to 256 determine if an encoded frame is non-reference. The reference 257 status of an encoded frame is preferably provided from the 258 encoder implementation. 260 S: Start of VP8 partition. SHOULD be set to 1 when the first payload 261 octet of the RTP packet is the beginning of a new VP8 partition, 262 and MUST NOT be 1 otherwise. The S bit MUST be set to 1 for the 263 first packet of each encoded frame. 265 PID: Partition index. Denotes which VP8 partition the first payload 266 octet of the packet belongs to. The first VP8 partition 267 (containing modes and motion vectors) MUST be labeled with PID = 268 0. PID SHOULD be incremented for each subsequent partition, but 269 MAY be kept at 0 for all packets. PID MUST NOT be larger than 8. 270 If more than one packet in an encoded frame contains the same PID, 271 the S bit MUST NOT be set for any other packet than the first 272 packet with that PID. 274 When the X bit is set to 1 in the first octet, the OPTIONAL extension 275 bit field MUST be present in the second octet. If the X bit is 0, 276 the extension bit field MUST NOT be present, and all bits below MUST 277 be implicitly interpreted as 0. 279 I: PictureID present. When set to one, the OPTIONAL PictureID MUST 280 be present after the extension bit field and specified as below. 281 Otherwise, PictureID MUST NOT be present. 283 L: TL0PICIDX present. When set to one, the OPTIONAL TL0PICIDX MUST 284 be present and specified as below, and the T bit MUST be set to 1. 285 Otherwise, TL0PICIDX MUST NOT be present. 287 T: TID present. When set to one, the OPTIONAL TID/KEYIDX octet MUST 288 be present. The TID|Y part of the octet MUST be specified as 289 below. If K (below) is set to one but T is set to zero, the TID/ 290 KEYIDX octet MUST be present, but the TID|Y field MUST be ignored. 291 If neither T nor K is set to one, the TID/KEYIDX octet MUST NOT be 292 present. 294 K: KEYIDX present. When set to one, the OPTIONAL TID/KEYIDX octet 295 MUST be present. The KEYIDX part of the octet MUST be specified 296 as below. If T (above) is set to one but K is set to zero, the 297 TID/KEYIDX octet MUST be present, but the KEYIDX field MUST be 298 ignored. If neither T nor K is set to one, the TID/KEYIDX octet 299 MUST NOT be present. 301 RSV: Bits reserved for future use. MUST be set to zero and MUST be 302 ignored by the receiver. 304 After the extension bit field follow the extension data fields that 305 are enabled. 307 M: The most significant bit of the first octet is an extension flag. 308 The field MUST be present if the I bit is equal to one. If set 309 the PictureID field MUST contain 16 bits else it MUST contain 8 310 bits including this MSB, see PictureID. 312 PictureID: 8 or 16 bits including the M bit. This is a running 313 index of the frames. The field MUST be present if the I bit is 314 equal to one. The 7 following bits carry (parts of) the 315 PictureID. If the extension flag is one, the PictureID continues 316 in the next octet forming a 15 bit index, where the 8 bits in the 317 second octet are the least significant bits of the PictureID. If 318 the extension flag is zero, there is no extension, and the 319 PictureID is the 7 remaining bits of the first (and only) octet. 320 The sender may choose 7 or 15 bits index. The PictureID SHOULD 321 start on a random number, and MUST wrap after reaching the maximum 322 ID. The receiver MUST NOT assume that the number of bits in 323 PictureID stay the same through the session. 325 TL0PICIDX: 8 bits temporal level zero index. The field MUST be 326 present if the L bit is equal to 1, and MUST NOT be present 327 otherwise. TL0PICIDX is a running index for the temporal base 328 layer frames, i.e., the frames with TID set to 0. If TID is 329 larger than 0, TL0PICIDX indicates which base layer frame the 330 current image depends on. TL0PICIDX MUST be incremented when TID 331 is 0. The index SHOULD start on a random number, and MUST restart 332 at 0 after reaching the maximum number 255. 334 TID: 2 bits temporal layer index. The TID/KEYIDX octet MUST be 335 present when either the T bit or the K bit or both are equal to 1, 336 and MUST NOT be present otherwise. The TID field MUST be ignored 337 by the receiver when the T bit is set equal to 0. The TID field 338 indicates which temporal layer the packet represents. The lowest 339 layer, i.e., the base layer, MUST have TID set to 0. Higher 340 layers SHOULD increment the TID according to their position in the 341 layer hierarchy. 343 Y: 1 layer sync bit. The TID/KEYIDX octet MUST be present when 344 either the T bit or the K bit or both are equal to 1, and MUST NOT 345 be present otherwise. The Y bit SHOULD be set to 1 if the current 346 frame depends only on the base layer (TID = 0) frame with 347 TL0PICIDX equal to that of the current frame. The Y bit MUST be 348 set to 0 if the current frame depends any other frame than the 349 base layer (TID = 0) frame with TL0PICIDX equal to that of the 350 current frame. If the Y bit is set when the T bit is equal to 0 351 the current frame MUST only depend on a past base layer (TID=0) 352 key frame as signaled by a change in the KEYIDX field. 353 Additionally this frame MUST NOT depend on any of the three codec 354 buffers (as defined by [RFC6386]) that have been updated since the 355 last time the KEYIDX field was changed. 357 Informative note: This document does not describe how to 358 determine the dependence status for a frame; this information 359 is preferably provided from the encoder implementation. In the 360 case of unknown status, the Y bit can safely be set to 0. 362 KEYIDX: 5 bits temporal key frame index. The TID/KEYIDX octet MUST 363 be present when either the T bit or the K bit or both are equal to 364 1, and MUST NOT be present otherwise. The KEYIDX field MUST be 365 ignored by the receiver when the K bit is set equal to 0. The 366 KEYIDX field is a running index for key frames. KEYIDX MAY start 367 on a random number, and MUST restart at 0 after reaching the 368 maximum number 31. When in use, the KEYIDX SHOULD be present for 369 both key frames and interframes. The sender MUST increment KEYIDX 370 for key frames which convey parameter updates critical to the 371 interpretation of subsequent frames, and SHOULD leave the KEYIDX 372 unchanged for key frames that do not contain these critical 373 updates. A receiver SHOULD NOT decode an interframe if it has not 374 received and decoded a key frame with the same KEYIDX after the 375 last KEYIDX wrap-around. 377 Informative note: This document does not describe how to 378 determine if a key frame updates critical parameters; this 379 information is preferably provided from the encoder 380 implementation. A sender that does not have this information 381 may either omit the KEYIDX field (set K equal to 0), or 382 increment the KEYIDX on every key frame. The benefit with the 383 latter is that any key frame loss will be detected by the 384 receiver, which can signal for re-transmission or request a new 385 key frame. 387 Informative note: Implementations doing splicing of VP8 streams will 388 have to make sure the rules for incrementing TL0PICIDX and KEYIDX 389 are obeyed across the splice. This will likely require rewriting 390 values of TL0PICIDX and KEYIDX after the splice. 392 4.3. VP8 Payload Header 394 The beginning of an encoded VP8 frame is referred to as an 395 "uncompressed data chunk" in [RFC6386], and co-serve as payload 396 header in this RTP format. The codec bitstream format specifies two 397 different variants of the uncompressed data chunk: a 3 octet version 398 for interframes and a 10 octet version for key frames. The first 3 399 octets are common to both variants. In the case of a key frame the 400 remaining 7 octets are considered to be part of the remaining payload 401 in this RTP format. Note that the header is present only in packets 402 which have the S bit equal to one and the PID equal to zero in the 403 payload descriptor. Subsequent packets for the same frame do not 404 carry the payload header. 406 0 1 2 3 4 5 6 7 407 +-+-+-+-+-+-+-+-+ 408 |Size0|H| VER |P| 409 +-+-+-+-+-+-+-+-+ 410 | Size1 | 411 +-+-+-+-+-+-+-+-+ 412 | Size2 | 413 +-+-+-+-+-+-+-+-+ 414 | Bytes 4..N of | 415 | VP8 payload | 416 : : 417 +-+-+-+-+-+-+-+-+ 418 | OPTIONAL RTP | 419 | padding | 420 : : 421 +-+-+-+-+-+-+-+-+ 423 Figure 3 425 H: Show frame bit as defined in [RFC6386]. 427 VER: A version number as defined in [RFC6386]. 429 P: Inverse key frame flag. When set to 0 the current frame is a key 430 frame. When set to 1 the current frame is an interframe. Defined 431 in [RFC6386] 433 SizeN: The size of the first partition in bytes is calculated from 434 the 19 bits in Size0, Size1, and Size2 as 1stPartitionSize = Size0 435 + 8 * Size1 + 2048 * Size2. [RFC6386]. 437 4.4. Aggregated and Fragmented Payloads 439 An encoded VP8 frame can be divided into two or more partitions, as 440 described in Section 1. One packet can contain a fragment of a 441 partition, a complete partition, or an aggregate of fragments and 442 partitions. In the preferred use case, the S bit and PID fields 443 described in Section 4.2 should be used to indicate what the packet 444 contains. The PID field should indicate which partition the first 445 octet of the payload belongs to, and the S bit indicates that the 446 packet starts on a new partition. Aggregation of encoded partitions 447 is done without explicit signaling. Partitions MUST be aggregated in 448 decoding order. Two fragments from different partitions MAY be 449 aggregated into the same packet. An aggregation MUST have exactly 450 one payload descriptor. Aggregated partitions MUST represent parts 451 of one and the same video frame. Consequently, an aggregated packet 452 will have one or no payload header, depending on whether the 453 aggregate contains the beginning of the first partition of a frame or 454 not, respectively. Note that the length of the first partition can 455 always be obtained from the first partition size parameter in the VP8 456 payload header. 458 The VP8 bitstream format [RFC6386] specifies that if multiple DCT/WHT 459 partitions are produced, the location of each partition start is 460 found at the end of the first (prediction/mode) partition. In this 461 RTP payload specification, the location offsets are considered to be 462 part of the first partition. 464 It is OPTIONAL for a packetizer implementing this RTP specification 465 to pay attention to the partition boundaries within an encoded frame. 466 If packetization of a frame is done without considering the partition 467 boundaries, the PID field MAY be set to zero for all packets, and the 468 S bit MUST NOT be set to one for any other packet than the first. 470 4.5. Frame reconstruction algorithm 472 Example of frame reconstruction algorithm. 474 1: Collect all packets with a given RTP timestamp. 476 2: Go through packets in order, sorted by sequence numbers, if 477 packets are missing, send NACK as defined in [RFC4585] or decode 478 with missing partitions, see Section 4.5.1 below. 480 3: A frame is complete if the frame has no missing sequence numbers, 481 the first packet in the frame contains S=1 with partId=0 and the 482 last packet in the frame has the marker bit set. 484 4.5.1. Partition reconstruction algorithm 486 Example of partition reconstruction algorithm. 488 1: Scan for the start of a new partition; S=1. 490 2: Continue scan to detect end of partition; hence a new S=1 491 (previous packet was the end of the partition) is found or the 492 marker bit is set. If a loss it detected before the end of the 493 partition, abandon all packets in this partition and continue the 494 scan repeating 1. 496 3: Store the packets in the complete partition, continue the scan 497 repeating 1 until end of frame is reached. 499 4: Send all complete partitions to the decoder. If no complete 500 partition is found discard the whole frame. 502 4.6. Examples of VP8 RTP Stream 504 A few examples of how the VP8 RTP payload can be used are included 505 below. 507 4.6.1. Key frame in a single RTP packet 509 0 1 2 3 4 5 6 7 510 +-+-+-+-+-+-+-+-+ 511 | RTP header | 512 | M = 1 | 513 +-+-+-+-+-+-+-+-+ 514 |1|0|0|1|0|0 0 0| X = 1; S = 1; PID = 0 515 +-+-+-+-+-+-+-+-+ 516 |1|0|0|0|0 0 0 0| I = 1 517 +-+-+-+-+-+-+-+-+ 518 |0 0 0 0 1 0 0 1| PictureID = 17 519 +-+-+-+-+-+-+-+-+ 520 |Size0|1| VER |0| P = 0 521 +-+-+-+-+-+-+-+-+ 522 | Size1 | 523 +-+-+-+-+-+-+-+-+ 524 | Size2 | 525 +-+-+-+-+-+-+-+-+ 526 | VP8 payload | 527 +-+-+-+-+-+-+-+-+ 529 4.6.2. Non-discardable VP8 interframe in a single RTP packet; no 530 PictureID 532 0 1 2 3 4 5 6 7 533 +-+-+-+-+-+-+-+-+ 534 | RTP header | 535 | M = 1 | 536 +-+-+-+-+-+-+-+-+ 537 |0|0|0|1|0|0 0 0| X = 0; S = 1; PID = 0 538 +-+-+-+-+-+-+-+-+ 539 |Size0|1| VER |1| P = 1 540 +-+-+-+-+-+-+-+-+ 541 | Size1 | 542 +-+-+-+-+-+-+-+-+ 543 | Size2 | 544 +-+-+-+-+-+-+-+-+ 545 | VP8 payload | 546 +-+-+-+-+-+-+-+-+ 548 4.6.3. VP8 partitions in separate RTP packets 550 First RTP packet; complete first partition. 552 0 1 2 3 4 5 6 7 553 +-+-+-+-+-+-+-+-+ 554 | RTP header | 555 | M = 0 | 556 +-+-+-+-+-+-+-+-+ 557 |1|0|0|1|0|0 0 0| X = 1; S = 1; PID = 0 558 +-+-+-+-+-+-+-+-+ 559 |1|0|0|0|0 0 0 0| I = 1 560 +-+-+-+-+-+-+-+-+ 561 |0 0 0 0 1 0 0 1| PictureID = 17 562 +-+-+-+-+-+-+-+-+ 563 |Size0|1| VER |1| P = 1 564 +-+-+-+-+-+-+-+-+ 565 | Size1 | 566 +-+-+-+-+-+-+-+-+ 567 | Size2 | 568 +-+-+-+-+-+-+-+-+ 569 | Bytes 4..L of | 570 | first VP8 | 571 | partition | 572 : : 573 +-+-+-+-+-+-+-+-+ 575 Second RTP packet; complete second partition. 577 0 1 2 3 4 5 6 7 578 +-+-+-+-+-+-+-+-+ 579 | RTP header | 580 | M = 1 | 581 +-+-+-+-+-+-+-+-+ 582 |1|0|0|1|0|0 0 1| X = 1; S = 1; PID = 1 583 +-+-+-+-+-+-+-+-+ 584 |1|0|0|0|0 0 0 0| I = 1 585 +-+-+-+-+-+-+-+-+ 586 |0 0 0 0 1 0 0 1| PictureID = 17 587 +-+-+-+-+-+-+-+-+ 588 | Remaining VP8 | 589 | partitions | 590 : : 591 +-+-+-+-+-+-+-+-+ 593 4.6.4. VP8 frame fragmented across RTP packets 595 First RTP packet; complete first partition. 597 0 1 2 3 4 5 6 7 598 +-+-+-+-+-+-+-+-+ 599 | RTP header | 600 | M = 0 | 601 +-+-+-+-+-+-+-+-+ 602 |1|0|0|1|0|0 0 0| X = 1; S = 1; PID = 0 603 +-+-+-+-+-+-+-+-+ 604 |1|0|0|0|0 0 0 0| I = 1 605 +-+-+-+-+-+-+-+-+ 606 |0 0 0 0 1 0 0 1| PictureID = 17 607 +-+-+-+-+-+-+-+-+ 608 |Size0|1| VER |1| P = 1 609 +-+-+-+-+-+-+-+-+ 610 | Size1 | 611 +-+-+-+-+-+-+-+-+ 612 | Size2 | 613 +-+-+-+-+-+-+-+-+ 614 | Complete | 615 | first | 616 | partition | 617 : : 618 +-+-+-+-+-+-+-+-+ 620 Second RTP packet; first fragment of second partition. 622 0 1 2 3 4 5 6 7 623 +-+-+-+-+-+-+-+-+ 624 | RTP header | 625 | M = 0 | 626 +-+-+-+-+-+-+-+-+ 627 |1|0|0|1|0|0 0 1| X = 1; S = 1; PID = 1 628 +-+-+-+-+-+-+-+-+ 629 |1|0|0|0|0 0 0 0| I = 1 630 +-+-+-+-+-+-+-+-+ 631 |0 0 0 0 1 0 0 1| PictureID = 17 632 +-+-+-+-+-+-+-+-+ 633 | First fragment| 634 | of second | 635 | partition | 636 : : 637 +-+-+-+-+-+-+-+-+ 639 Third RTP packet; second fragment of second partition. 641 0 1 2 3 4 5 6 7 642 +-+-+-+-+-+-+-+-+ 643 | RTP header | 644 | M = 0 | 645 +-+-+-+-+-+-+-+-+ 646 |1|0|0|0|0|0 0 1| X = 1; S = 0; PID = 1 647 +-+-+-+-+-+-+-+-+ 648 |1|0|0|0|0 0 0 0| I = 1 649 +-+-+-+-+-+-+-+-+ 650 |0 0 0 0 1 0 0 1| PictureID = 17 651 +-+-+-+-+-+-+-+-+ 652 | Mid fragment | 653 | of second | 654 | partition | 655 : : 656 +-+-+-+-+-+-+-+-+ 658 Fourth RTP packet; last fragment of second partition. 660 0 1 2 3 4 5 6 7 661 +-+-+-+-+-+-+-+-+ 662 | RTP header | 663 | M = 1 | 664 +-+-+-+-+-+-+-+-+ 665 |1|0|0|0|0|0 0 1| X = 1; S = 0; PID = 1 666 +-+-+-+-+-+-+-+-+ 667 |1|0|0|0|0 0 0 0| I = 1 668 +-+-+-+-+-+-+-+-+ 669 |0 0 0 0 1 0 0 1| PictureID = 17 670 +-+-+-+-+-+-+-+-+ 671 | Last fragment | 672 | of second | 673 | partition | 674 : : 675 +-+-+-+-+-+-+-+-+ 677 4.6.5. VP8 frame with long PictureID 679 PictureID = 4711 = 001001001100111 binary (first 7 bits: 0010010, 680 last 8 bits: 01100111). 682 0 1 2 3 4 5 6 7 683 +-+-+-+-+-+-+-+-+ 684 | RTP header | 685 | M = 1 | 686 +-+-+-+-+-+-+-+-+ 687 |1|0|0|1|0|0 0 0| X = 1; S = 1; PID = 0 688 +-+-+-+-+-+-+-+-+ 689 |1|0|0|0|0 0 0 0| I = 1; 690 +-+-+-+-+-+-+-+-+ 691 |1 0 0 1 0 0 1 0| Long PictureID flag = 1 692 |0 1 1 0 0 1 1 1| PictureID = 4711 693 +-+-+-+-+-+-+-+-+ 694 |Size0|1| VER |1| 695 +-+-+-+-+-+-+-+-+ 696 | Size1 | 697 +-+-+-+-+-+-+-+-+ 698 | Size2 | 699 +-+-+-+-+-+-+-+-+ 700 | Bytes 4..N of | 701 | VP8 payload | 702 : : 703 +-+-+-+-+-+-+-+-+ 705 5. Using VP8 with RPSI and SLI Feedback 707 The VP8 payload descriptor defined in Section 4.2 above contains an 708 optional PictureID parameter. This parameter is included mainly to 709 enable use of reference picture selection index (RPSI) and slice loss 710 indication (SLI), both defined in [RFC4585]. 712 5.1. RPSI 714 The reference picture selection index is a payload-specific feedback 715 message defined within the RTCP-based feedback format. The RPSI 716 message is generated by a receiver and can be used in two ways. 717 Either it can signal a preferred reference picture when a loss has 718 been detected by the decoder -- preferably then a reference that the 719 decoder knows is perfect -- or, it can be used as positive feedback 720 information to acknowledge correct decoding of certain reference 721 pictures. The positive feedback method is useful for VP8 used as 722 unicast. The use of RPSI for VP8 is preferably combined with a 723 special update pattern of the codec's two special reference frames -- 724 the golden frame and the altref frame -- in which they are updated in 725 an alternating leapfrog fashion. When a receiver has received and 726 correctly decoded a golden or altref frame, and that frame had a 727 PictureID in the payload descriptor, the receiver can acknowledge 728 this simply by sending an RPSI message back to the sender. The 729 message body (i.e., the "native RPSI bit string" in [RFC4585]) is 730 simply the PictureID of the received frame. 732 5.2. SLI 734 The slice loss indication is another payload-specific feedback 735 message defined within the RTCP-based feedback format. The SLI 736 message is generated by the receiver when a loss or corruption is 737 detected in a frame. The format of the SLI message is as follows 738 [RFC4585]: 740 0 1 2 3 741 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 742 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 743 | First | Number | PictureID | 744 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 746 Figure 4 748 Here, First is the macroblock address (in scan order) of the first 749 lost block and Number is the number of lost blocks. PictureID is the 750 six least significant bits of the codec-specific picture identifier 751 in which the loss or corruption has occurred. For VP8, this codec- 752 specific identifier is naturally the PictureID of the current frame, 753 as read from the payload descriptor. If the payload descriptor of 754 the current frame does not have a PictureID, the receiver MAY send 755 the last received PictureID+1 in the SLI message. The receiver MAY 756 set the First parameter to 0, and the Number parameter to the total 757 number of macroblocks per frame, even though only parts of the frame 758 is corrupted. When the sender receives an SLI message, it can make 759 use of the knowledge from the latest received RPSI message. Knowing 760 that the last golden or altref frame was successfully received, it 761 can encode the next frame with reference to that established 762 reference. 764 5.3. Example 766 The use of RPSI and SLI is best illustrated in an example. In this 767 example, the encoder may not update the altref frame until the last 768 sent golden frame has been acknowledged with an RPSI message. If an 769 update is not received within some time, a new golden frame update is 770 sent instead. Once the new golden frame is established and 771 acknowledge, the same rule applies when updating the altref frame. 773 +-------+-------------------+-------------------------+-------------+ 774 | Event | Sender | Receiver | Established | 775 | | | | reference | 776 +-------+-------------------+-------------------------+-------------+ 777 | 1000 | Send golden frame | | | 778 | | PictureID = 0 | | | 779 | | | | | 780 | | | Receive and decode | | 781 | | | golden frame | | 782 | | | | | 783 | 1001 | | Send RPSI(0) | | 784 | | | | | 785 | 1002 | Receive RPSI(0) | | golden | 786 | | | | | 787 | ... | (sending regular | | | 788 | | frames) | | | 789 | | | | | 790 | 1100 | Send altref frame | | | 791 | | PictureID = 100 | | | 792 | | | | | 793 | | | Altref corrupted or | golden | 794 | | | lost | | 795 | | | | | 796 | 1101 | | Send SLI(100) | golden | 797 | | | | | 798 | 1102 | Receive SLI(100) | | | 799 | | | | | 800 | 1103 | Send frame with | | | 801 | | reference to | | | 802 | | golden | | | 803 | | | | | 804 | | | Receive and decode | golden | 805 | | | frame (decoder state | | 806 | | | restored) | | 807 | | | | | 808 | ... | (sending regular | | | 809 | | frames) | | | 810 | | | | | 811 | 1200 | Send altref frame | | | 812 | | PictureID = 200 | | | 813 | | | | | 814 | | | Receive and decode | golden | 815 | | | altref frame | | 816 | | | | | 817 | 1201 | | Send RPSI(200) | | 818 | | | | | 819 | 1202 | Receive RPSI(200) | | altref | 820 | | | | | 821 | ... | (sending regular | | | 822 | | frames) | | | 823 | | | | | 824 | 1300 | Send golden frame | | | 825 | | PictureID = 300 | | | 826 | | | | | 827 | | | Receive and decode | altref | 828 | | | golden frame | | 829 | | | | | 830 | 1301 | | Send RPSI(300) | altref | 831 | | | | | 832 | 1302 | RPSI lost | | | 833 | | | | | 834 | 1400 | Send golden frame | | | 835 | | PictureID = 400 | | | 836 | | | | | 837 | | | Receive and decode | altref | 838 | | | golden frame | | 839 | | | | | 840 | 1401 | | Send RPSI(400) | | 841 | | | | | 842 | 1402 | Receive RPSI(400) | | golden | 843 +-------+-------------------+-------------------------+-------------+ 845 Table 1: Exemple signaling between sender and receiver 847 Note that the scheme is robust to loss of the feedback messages. If 848 the RPSI is lost, the sender will try to update the golden (or 849 altref) again after a while, without releasing the established 850 reference. Also, if an SLI is lost, the receiver can keep sending 851 SLI messages at any interval, as long as the picture is corrupted. 853 6. Payload Format Parameters 855 This payload format has two required parameters. 857 6.1. Media Type Definition 859 This registration is done using the template defined in [RFC6838] and 860 following [RFC4855]. 862 Type name: video 864 Subtype name: VP8 866 Required parameters: 867 These parameters MUST be used to signal the capabilities of a 868 receiver implementation. These parameters MUST NOT be used for 869 any other purpose. 871 max-fr: The value of max-fr is an integer indicating the maximum 872 frame rate in units of frames per second that the decoder is 873 capable of decoding. 875 max-fs: The value of max-fs is an integer indicating the maximum 876 frame size in units of macroblocks that the decoder is capable 877 of decoding. 879 The decoder is capable of decoding this frame size as long as 880 the width and height of the frame in macroblocks are less than 881 int(sqrt(max-fs * 8)) - for instance, a max-fs of 1200 (capable 882 of supporting 640x480 resolution) will support widths and 883 heights up to 1552 pixels (97 macroblocks). 885 Optional parameters: none 887 Encoding considerations: 888 This media type is framed in RTP and contains binary data; see 889 Section 4.8 of [RFC6838]. 891 Security considerations: See Section 7 of RFC xxxx. 892 [RFC Editor: Upon publication as an RFC, please replace "XXXX" 893 with the number assigned to this document and remove this note.] 895 Interoperability considerations: None. 897 Published specification: VP8 bitstream format [RFC6386] and RFC 898 XXXX. 899 [RFC Editor: Upon publication as an RFC, please replace "XXXX" 900 with the number assigned to this document and remove this note.] 902 Applications which use this media type: 903 For example: Video over IP, video conferencing. 905 Additional information: None. 907 Person & email address to contact for further information: 908 Patrik Westin, patrik.westin@gmail.com 910 Intended usage: COMMON 912 Restrictions on usage: 913 This media type depends on RTP framing, and hence is only defined 914 for transfer via RTP [RFC3550]. 916 Author: Patrik Westin, patrik.westin@gmail.com 918 Change controller: 919 IETF Payload Working Group delegated from the IESG. 921 6.2. SDP Parameters 923 The receiver MUST ignore any parameter unspecified in this memo. 925 6.2.1. Mapping of MIME Parameters to SDP 927 The MIME media type video/VP8 string is mapped to fields in the 928 Session Description Protocol (SDP) [RFC4566] as follows: 930 o The media name in the "m=" line of SDP MUST be video. 932 o The encoding name in the "a=rtpmap" line of SDP MUST be VP8 (the 933 MIME subtype). 935 o The clock rate in the "a=rtpmap" line MUST be 90000. 937 o The parameters "max-fs", and "max-fr", MUST be included in the 938 "a=fmtp" line of SDP. These parameters are expressed as a MIME 939 media type string, in the form of a semicolon separated list of 940 parameter=value pairs. 942 6.2.1.1. Example 944 An example of media representation in SDP is as follows: 946 m=video 49170 RTP/AVPF 98 947 a=rtpmap:98 VP8/90000 948 a=fmtp:98 max-fr=30; max-fs=3600; 950 6.2.2. Offer/Answer Considerations 952 The VP8 codec offers a decode complexity that is roughly linear with 953 the number of pixels encoded. The parameters "max-fr" and "max-fs" 954 are defined in Section 6.1, where the macroblock size is 16x16 pixels 955 as defined in [RFC6386], the max-fs and max-fr parameters MUST be 956 used to establish these limits. 958 NOTE IN DRAFT: If closer control of width and height is desired, the 959 mechanism described in 960 draft-nandakumar-payload-sdp-max-video-resolution is a possible 961 candidate for signalling, but since that document appears to be far 962 from finalization, this document does not make a reference to that 963 document. This note is only intended for facilitating WG discussion, 964 and should be deleted before publication of this document as an RFC. 966 7. Security Considerations 968 RTP packets using the payload format defined in this specification 969 are subject to the security considerations discussed in the RTP 970 specification [RFC3550], and in any applicable RTP profile. The main 971 security considerations for the RTP packet carrying the RTP payload 972 format defined within this memo are confidentiality, integrity and 973 source authenticity. Confidentiality is achieved by encryption of 974 the RTP payload. Integrity of the RTP packets through suitable 975 cryptographic integrity protection mechanism. Cryptographic system 976 may also allow the authentication of the source of the payload. A 977 suitable security mechanism for this RTP payload format should 978 provide confidentiality, integrity protection and at least source 979 authentication capable of determining if an RTP packet is from a 980 member of the RTP session or not. Note that the appropriate 981 mechanism to provide security to RTP and payloads following this memo 982 may vary. It is dependent on the application, the transport, and the 983 signaling protocol employed. Therefore a single mechanism is not 984 sufficient, although if suitable the usage of SRTP [RFC3711] is 985 recommended. This RTP payload format and its media decoder do not 986 exhibit any significant non-uniformity in the receiver-side 987 computational complexity for packet processing, and thus are unlikely 988 to pose a denial-of-service threat due to the receipt of pathological 989 data. Nor does the RTP payload format contain any active content. 991 8. Congestion Control 993 Congestion control for RTP SHALL be used in accordance with RFC 3550 994 [RFC3550], and with any applicable RTP profile; e.g., RFC 3551 995 [RFC3551]. The congestion control mechanism can, in a real-time 996 encoding scenario, adapt the transmission rate by instructing the 997 encoder to encode at a certain target rate. Media aware network 998 elements MAY use the information in the VP8 payload descriptor in 999 Section 4.2 to identify non-reference frames and discard them in 1000 order to reduce network congestion. Note that discarding of non- 1001 reference frames cannot be done if the stream is encrypted (because 1002 the non-reference marker is encrypted). 1004 9. IANA Considerations 1006 The IANA is requested to register the following values: 1007 - Media type registration as described in Section 6.1. 1009 10. References 1011 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1012 Requirement Levels", BCP 14, RFC 2119, March 1997. 1014 [RFC3550] Schulzrinne, H., Casner, S., Frederick, R., and V. 1015 Jacobson, "RTP: A Transport Protocol for Real-Time 1016 Applications", STD 64, RFC 3550, July 2003. 1018 [RFC3551] Schulzrinne, H. and S. Casner, "RTP Profile for Audio and 1019 Video Conferences with Minimal Control", STD 65, RFC 3551, 1020 July 2003. 1022 [RFC3711] Baugher, M., McGrew, D., Naslund, M., Carrara, E., and K. 1023 Norrman, "The Secure Real-time Transport Protocol (SRTP)", 1024 RFC 3711, March 2004. 1026 [RFC4566] Handley, M., Jacobson, V., and C. Perkins, "SDP: Session 1027 Description Protocol", RFC 4566, July 2006. 1029 [RFC4585] Ott, J., Wenger, S., Sato, N., Burmeister, C., and J. Rey, 1030 "Extended RTP Profile for Real-time Transport Control 1031 Protocol (RTCP)-Based Feedback (RTP/AVPF)", RFC 4585, 1032 July 2006. 1034 [RFC4855] Casner, S., "Media Type Registration of RTP Payload 1035 Formats", RFC 4855, February 2007. 1037 [RFC6386] Bankoski, J., Koleszar, J., Quillio, L., Salonen, J., 1038 Wilkins, P., and Y. Xu, "VP8 Data Format and Decoding 1039 Guide", RFC 6386, November 2011. 1041 [RFC6838] Freed, N., Klensin, J., and T. Hansen, "Media Type 1042 Specifications and Registration Procedures", BCP 13, 1043 RFC 6838, January 2013. 1045 Authors' Addresses 1047 Patrik Westin 1048 Google, Inc. 1049 1600 Amphitheatre Parkway 1050 Mountain View, CA 94043 1051 USA 1053 Email: patrik.westin@gmail.com 1055 Henrik F Lundin 1056 Google, Inc. 1057 Kungsbron 2 1058 Stockholm, 11122 1059 Sweden 1061 Email: hlundin@google.com 1063 Michael Glover 1064 Google, Inc. 1065 5 Cambridge Center 1066 Cambridge, MA 02142 1067 USA 1069 Justin Uberti 1070 Google, Inc. 1071 747 6th Street South 1072 Kirkland, WA 98033 1073 USA 1075 Frank Galligan 1076 Google, Inc. 1077 1600 Amphitheatre Parkway 1078 Mountain View, CA 94043 1079 USA