idnits 2.17.1 draft-ietf-payload-rtp-opus-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 : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (April 14, 2015) is 3299 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) == Missing Reference: 'XXXX' is mentioned on line 488, but not defined ** Obsolete normative reference: RFC 2326 (Obsoleted by RFC 7826) ** Obsolete normative reference: RFC 4566 (Obsoleted by RFC 8866) -- Obsolete informational reference (is this intentional?): RFC 5405 (Obsoleted by RFC 8085) Summary: 2 errors (**), 0 flaws (~~), 2 warnings (==), 2 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group J. Spittka 3 Internet-Draft 4 Intended status: Standards Track K. Vos 5 Expires: October 16, 2015 vocTone 6 JM. Valin 7 Mozilla 8 April 14, 2015 10 RTP Payload Format for the Opus Speech and Audio Codec 11 draft-ietf-payload-rtp-opus-11 13 Abstract 15 This document defines the Real-time Transport Protocol (RTP) payload 16 format for packetization of Opus encoded speech and audio data 17 necessary to integrate the codec in the most compatible way. It also 18 provides an applicability statement for the use of Opus over RTP. 19 Further, it describes media type registrations for the RTP payload 20 format. 22 Status of This Memo 24 This Internet-Draft is submitted in full conformance with the 25 provisions of BCP 78 and BCP 79. 27 Internet-Drafts are working documents of the Internet Engineering 28 Task Force (IETF). Note that other groups may also distribute 29 working documents as Internet-Drafts. The list of current Internet- 30 Drafts is at http://datatracker.ietf.org/drafts/current/. 32 Internet-Drafts are draft documents valid for a maximum of six months 33 and may be updated, replaced, or obsoleted by other documents at any 34 time. It is inappropriate to use Internet-Drafts as reference 35 material or to cite them other than as "work in progress." 37 This Internet-Draft will expire on October 16, 2015. 39 Copyright Notice 41 Copyright (c) 2015 IETF Trust and the persons identified as the 42 document authors. All rights reserved. 44 This document is subject to BCP 78 and the IETF Trust's Legal 45 Provisions Relating to IETF Documents 46 (http://trustee.ietf.org/license-info) in effect on the date of 47 publication of this document. Please review these documents 48 carefully, as they describe your rights and restrictions with respect 49 to this document. Code Components extracted from this document must 50 include Simplified BSD License text as described in Section 4.e of 51 the Trust Legal Provisions and are provided without warranty as 52 described in the Simplified BSD License. 54 Table of Contents 56 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 57 2. Conventions, Definitions and Acronyms used in this document . 3 58 3. Opus Codec . . . . . . . . . . . . . . . . . . . . . . . . . 3 59 3.1. Network Bandwidth . . . . . . . . . . . . . . . . . . . . 4 60 3.1.1. Recommended Bitrate . . . . . . . . . . . . . . . . . 4 61 3.1.2. Variable versus Constant Bitrate . . . . . . . . . . 4 62 3.1.3. Discontinuous Transmission (DTX) . . . . . . . . . . 4 63 3.2. Complexity . . . . . . . . . . . . . . . . . . . . . . . 5 64 3.3. Forward Error Correction (FEC) . . . . . . . . . . . . . 5 65 3.4. Stereo Operation . . . . . . . . . . . . . . . . . . . . 6 66 4. Opus RTP Payload Format . . . . . . . . . . . . . . . . . . . 6 67 4.1. RTP Header Usage . . . . . . . . . . . . . . . . . . . . 6 68 4.2. Payload Structure . . . . . . . . . . . . . . . . . . . . 7 69 5. Congestion Control . . . . . . . . . . . . . . . . . . . . . 8 70 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 8 71 6.1. Opus Media Type Registration . . . . . . . . . . . . . . 8 72 7. SDP Considerations . . . . . . . . . . . . . . . . . . . . . 12 73 7.1. SDP Offer/Answer Considerations . . . . . . . . . . . . . 13 74 7.2. Declarative SDP Considerations for Opus . . . . . . . . . 15 75 8. Security Considerations . . . . . . . . . . . . . . . . . . . 15 76 9. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 16 77 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 16 78 10.1. Normative References . . . . . . . . . . . . . . . . . . 16 79 10.2. Informative References . . . . . . . . . . . . . . . . . 17 80 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 17 82 1. Introduction 84 Opus [RFC6716] is a speech and audio codec developed within the IETF 85 Internet Wideband Audio Codec working group. The codec has a very 86 low algorithmic delay and it is highly scalable in terms of audio 87 bandwidth, bitrate, and complexity. Further, it provides different 88 modes to efficiently encode speech signals as well as music signals, 89 thus making it the codec of choice for various applications using the 90 Internet or similar networks. 92 This document defines the Real-time Transport Protocol (RTP) 93 [RFC3550] payload format for packetization of Opus encoded speech and 94 audio data necessary to integrate Opus in the most compatible way. 95 It also provides an applicability statement for the use of Opus over 96 RTP. Further, it describes media type registrations for the RTP 97 payload format. 99 2. Conventions, Definitions and Acronyms used in this document 101 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 102 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 103 document are to be interpreted as described in [RFC2119]. 105 audio bandwidth: The range of audio frequecies being coded 106 CBR: Constant bitrate 107 CPU: Central Processing Unit 108 DTX: Discontinuous transmission 109 FEC: Forward error correction 110 IP: Internet Protocol 111 samples: Speech or audio samples (per channel) 112 SDP: Session Description Protocol 113 VBR: Variable bitrate 115 Throughout this document, we refer to the following definitions: 117 +--------------+----------------+-----------------+-----------------+ 118 | Abbreviation | Name | Audio Bandwidth | Sampling Rate | 119 | | | (Hz) | (Hz) | 120 +--------------+----------------+-----------------+-----------------+ 121 | NB | Narrowband | 0 - 4000 | 8000 | 122 | | | | | 123 | MB | Mediumband | 0 - 6000 | 12000 | 124 | | | | | 125 | WB | Wideband | 0 - 8000 | 16000 | 126 | | | | | 127 | SWB | Super-wideband | 0 - 12000 | 24000 | 128 | | | | | 129 | FB | Fullband | 0 - 20000 | 48000 | 130 +--------------+----------------+-----------------+-----------------+ 132 Audio bandwidth naming 134 Table 1 136 3. Opus Codec 138 Opus encodes speech signals as well as general audio signals. Two 139 different modes can be chosen, a voice mode or an audio mode, to 140 allow the most efficient coding depending on the type of the input 141 signal, the sampling frequency of the input signal, and the intended 142 application. 144 The voice mode allows efficient encoding of voice signals at lower 145 bit rates while the audio mode is optimized for general audio signals 146 at medium and higher bitrates. 148 Opus is highly scalable in terms of audio bandwidth, bitrate, and 149 complexity. Further, Opus allows transmitting stereo signals with 150 in-band signaling in the bit-stream. 152 3.1. Network Bandwidth 154 Opus supports bitrates from 6 kb/s to 510 kb/s. The bitrate can be 155 changed dynamically within that range. All other parameters being 156 equal, higher bitrates result in higher audio quality. 158 3.1.1. Recommended Bitrate 160 For a frame size of 20 ms, these are the bitrate "sweet spots" for 161 Opus in various configurations: 163 o 8-12 kb/s for NB speech, 164 o 16-20 kb/s for WB speech, 165 o 28-40 kb/s for FB speech, 166 o 48-64 kb/s for FB mono music, and 167 o 64-128 kb/s for FB stereo music. 169 3.1.2. Variable versus Constant Bitrate 171 For the same average bitrate, variable bitrate (VBR) can achieve 172 higher audio quality than constant bitrate (CBR). For the majority 173 of voice transmission applications, VBR is the best choice. One 174 reason for choosing CBR is the potential information leak that 175 _might_ occur when encrypting the compressed stream. See [RFC6562] 176 for guidelines on when VBR is appropriate for encrypted audio 177 communications. In the case where an existing VBR stream needs to be 178 converted to CBR for security reasons, then the Opus padding 179 mechanism described in [RFC6716] is the RECOMMENDED way to achieve 180 padding because the RTP padding bit is unencrypted. 182 The bitrate can be adjusted at any point in time. To avoid 183 congestion, the average bitrate SHOULD NOT exceed the available 184 network bandwidth. If no target bitrate is specified, the bitrates 185 specified in Section 3.1.1 are RECOMMENDED. 187 3.1.3. Discontinuous Transmission (DTX) 189 Opus can, as described in Section 3.1.2, be operated with a variable 190 bitrate. In that case, the encoder will automatically reduce the 191 bitrate for certain input signals, like periods of silence. When 192 using continuous transmission, it will reduce the bitrate when the 193 characteristics of the input signal permit, but will never interrupt 194 the transmission to the receiver. Therefore, the received signal 195 will maintain the same high level of audio quality over the full 196 duration of a transmission while minimizing the average bit rate over 197 time. 199 In cases where the bitrate of Opus needs to be reduced even further 200 or in cases where only constant bitrate is available, the Opus 201 encoder can use discontinuous transmission (DTX), where parts of the 202 encoded signal that correspond to periods of silence in the input 203 speech or audio signal are not transmitted to the receiver. A 204 receiver can distinguish between DTX and packet loss by looking for 205 gaps in the sequence number, as described by Section 4.1 206 of [RFC3551]. 208 On the receiving side, the non-transmitted parts will be handled by a 209 frame loss concealment unit in the Opus decoder which generates a 210 comfort noise signal to replace the non transmitted parts of the 211 speech or audio signal. Use of [RFC3389] Comfort Noise (CN) with 212 Opus is discouraged. The transmitter MUST drop whole frames only, 213 based on the size of the last transmitted frame, to ensure successive 214 RTP timestamps differ by a multiple of 120 and to allow the receiver 215 to use whole frames for concealment. 217 DTX can be used with both variable and constant bitrate. It will 218 have a slightly lower speech or audio quality than continuous 219 transmission. Therefore, using continuous transmission is 220 RECOMMENDED unless constraints on available network bandwidth are 221 severe. 223 3.2. Complexity 225 Complexity of the encoder can be scaled to optimize for CPU resources 226 in real-time, mostly as a trade-off between audio quality and 227 bitrate. Also, different modes of Opus have different complexity. 229 3.3. Forward Error Correction (FEC) 231 The voice mode of Opus allows for embedding "in-band" forward error 232 correction (FEC) data into the Opus bit stream. This FEC scheme adds 233 redundant information about the previous packet (N-1) to the current 234 output packet N. For each frame, the encoder decides whether to use 235 FEC based on (1) an externally-provided estimate of the channel's 236 packet loss rate; (2) an externally-provided estimate of the 237 channel's capacity; (3) the sensitivity of the audio or speech signal 238 to packet loss; (4) whether the receiving decoder has indicated it 239 can take advantage of "in-band" FEC information. The decision to 240 send "in-band" FEC information is entirely controlled by the encoder 241 and therefore no special precautions for the payload have to be 242 taken. 244 On the receiving side, the decoder can take advantage of this 245 additional information when it loses a packet and the next packet is 246 available. In order to use the FEC data, the jitter buffer needs to 247 provide access to payloads with the FEC data. Instead of performing 248 loss concealment for a missing packet, the receiver can then 249 configure its decoder to decode the FEC data from the next packet. 251 Any compliant Opus decoder is capable of ignoring FEC information 252 when it is not needed, so encoding with FEC cannot cause 253 interoperability problems. However, if FEC cannot be used on the 254 receiving side, then FEC SHOULD NOT be used, as it leads to an 255 inefficient usage of network resources. Decoder support for FEC 256 SHOULD be indicated at the time a session is set up. 258 3.4. Stereo Operation 260 Opus allows for transmission of stereo audio signals. This operation 261 is signaled in-band in the Opus bit-stream and no special arrangement 262 is needed in the payload format. An Opus decoder is capable of 263 handling a stereo encoding, but an application might only be capable 264 of consuming a single audio channel. 266 If a decoder cannot take advantage of the benefits of a stereo signal 267 this SHOULD be indicated at the time a session is set up. In that 268 case the sending side SHOULD NOT send stereo signals as it leads to 269 an inefficient usage of network resources. 271 4. Opus RTP Payload Format 273 The payload format for Opus consists of the RTP header and Opus 274 payload data. 276 4.1. RTP Header Usage 278 The format of the RTP header is specified in [RFC3550]. The use of 279 the fields of the RTP header by the Opus payload format is consistent 280 with that specification. 282 The payload length of Opus is an integer number of octets and 283 therefore no padding is necessary. The payload MAY be padded by an 284 integer number of octets according to [RFC3550], although the Opus 285 internal padding is preferred. 287 The timestamp, sequence number, and marker bit (M) of the RTP header 288 are used in accordance with Section 4.1 of [RFC3551]. 290 The RTP payload type for Opus is to be assigned dynamically. 292 The receiving side MUST be prepared to receive duplicate RTP packets. 293 The receiver MUST provide at most one of those payloads to the Opus 294 decoder for decoding, and MUST discard the others. 296 Opus supports 5 different audio bandwidths, which can be adjusted 297 during a stream. The RTP timestamp is incremented with a 48000 Hz 298 clock rate for all modes of Opus and all sampling rates. The unit 299 for the timestamp is samples per single (mono) channel. The RTP 300 timestamp corresponds to the sample time of the first encoded sample 301 in the encoded frame. For data encoded with sampling rates other 302 than 48000 Hz, the sampling rate has to be adjusted to 48000 Hz. 304 4.2. Payload Structure 306 The Opus encoder can output encoded frames representing 2.5, 5, 10, 307 20, 40, or 60 ms of speech or audio data. Further, an arbitrary 308 number of frames can be combined into a packet, up to a maximum 309 packet duration representing 120 ms of speech or audio data. The 310 grouping of one or more Opus frames into a single Opus packet is 311 defined in Section 3 of [RFC6716]. An RTP payload MUST contain 312 exactly one Opus packet as defined by that document. 314 Figure 1 shows the structure combined with the RTP header. 316 +----------+--------------+ 317 |RTP Header| Opus Payload | 318 +----------+--------------+ 320 Figure 1: Packet structure with RTP header 322 Table 2 shows supported frame sizes in milliseconds of encoded speech 323 or audio data for the speech and audio modes (Mode) and sampling 324 rates (fs) of Opus and shows how the timestamp is incremented for 325 packetization (ts incr). If the Opus encoder outputs multiple 326 encoded frames into a single packet, the timestamp increment is the 327 sum of the increments for the individual frames. 329 +---------+-----------------+-----+-----+-----+-----+------+------+ 330 | Mode | fs | 2.5 | 5 | 10 | 20 | 40 | 60 | 331 +---------+-----------------+-----+-----+-----+-----+------+------+ 332 | ts incr | all | 120 | 240 | 480 | 960 | 1920 | 2880 | 333 | | | | | | | | | 334 | voice | NB/MB/WB/SWB/FB | x | x | o | o | o | o | 335 | | | | | | | | | 336 | audio | NB/WB/SWB/FB | o | o | o | o | x | x | 337 +---------+-----------------+-----+-----+-----+-----+------+------+ 339 Table 2: Supported Opus frame sizes and timestamp increments marked 340 with an o. Unsupported marked with an x. 342 5. Congestion Control 344 The target bitrate of Opus can be adjusted at any point in time, thus 345 allowing efficient congestion control. Furthermore, the amount of 346 encoded speech or audio data encoded in a single packet can be used 347 for congestion control, since the transmission rate is inversely 348 proportional to the packet duration. A lower packet transmission 349 rate reduces the amount of header overhead, but at the same time 350 increases latency and loss sensitivity, so it ought to be used with 351 care. 353 Since UDP does not provide congestion control, applications that use 354 RTP over UDP SHOULD implement their own congestion control above the 355 UDP layer [RFC5405]. Work in the rmcat working group [rmcat] 356 describes the interactions and conceptual interfaces necessary 357 between the application components that relate to congestion control, 358 including the RTP layer, the higher-level media codec control layer, 359 and the lower-level transport interface, as well as components 360 dedicated to congestion control functions. 362 6. IANA Considerations 364 One media subtype (audio/opus) has been defined and registered as 365 described in the following section. 367 6.1. Opus Media Type Registration 369 Media type registration is done according to [RFC6838] and [RFC4855]. 371 Type name: audio 373 Subtype name: opus 374 Required parameters: 376 rate: the RTP timestamp is incremented with a 48000 Hz clock rate 377 for all modes of Opus and all sampling rates. For data encoded 378 with sampling rates other than 48000 Hz, the sampling rate has to 379 be adjusted to 48000 Hz. 381 Optional parameters: 383 maxplaybackrate: a hint about the maximum output sampling rate that 384 the receiver is capable of rendering in Hz. The decoder MUST be 385 capable of decoding any audio bandwidth but due to hardware 386 limitations only signals up to the specified sampling rate can be 387 played back. Sending signals with higher audio bandwidth results 388 in higher than necessary network usage and encoding complexity, so 389 an encoder SHOULD NOT encode frequencies above the audio bandwidth 390 specified by maxplaybackrate. This parameter can take any value 391 between 8000 and 48000, although commonly the value will match one 392 of the Opus bandwidths (Table 1). By default, the receiver is 393 assumed to have no limitations, i.e. 48000. 395 sprop-maxcapturerate: a hint about the maximum input sampling rate 396 that the sender is likely to produce. This is not a guarantee 397 that the sender will never send any higher bandwidth (e.g. it 398 could send a pre-recorded prompt that uses a higher bandwidth), 399 but it indicates to the receiver that frequencies above this 400 maximum can safely be discarded. This parameter is useful to 401 avoid wasting receiver resources by operating the audio processing 402 pipeline (e.g. echo cancellation) at a higher rate than necessary. 403 This parameter can take any value between 8000 and 48000, although 404 commonly the value will match one of the Opus bandwidths 405 (Table 1). By default, the sender is assumed to have no 406 limitations, i.e. 48000. 408 maxptime: the maximum duration of media represented by a packet 409 (according to Section 6 of [RFC4566]) that a decoder wants to 410 receive, in milliseconds rounded up to the next full integer 411 value. Possible values are 3, 5, 10, 20, 40, 60, or an arbitrary 412 multiple of an Opus frame size rounded up to the next full integer 413 value, up to a maximum value of 120, as defined in Section 4. If 414 no value is specified, the default is 120. 416 ptime: the preferred duration of media represented by a packet 417 (according to Section 6 of [RFC4566]) that a decoder wants to 418 receive, in milliseconds rounded up to the next full integer 419 value. Possible values are 3, 5, 10, 20, 40, 60, or an arbitrary 420 multiple of an Opus frame size rounded up to the next full integer 421 value, up to a maximum value of 120, as defined in Section 4. If 422 no value is specified, the default is 20. 424 maxaveragebitrate: specifies the maximum average receive bitrate of 425 a session in bits per second (b/s). The actual value of the 426 bitrate can vary, as it is dependent on the characteristics of the 427 media in a packet. Note that the maximum average bitrate MAY be 428 modified dynamically during a session. Any positive integer is 429 allowed, but values outside the range 6000 to 510000 SHOULD be 430 ignored. If no value is specified, the maximum value specified in 431 Section 3.1.1 for the corresponding mode of Opus and corresponding 432 maxplaybackrate is the default. 434 stereo: specifies whether the decoder prefers receiving stereo or 435 mono signals. Possible values are 1 and 0 where 1 specifies that 436 stereo signals are preferred, and 0 specifies that only mono 437 signals are preferred. Independent of the stereo parameter every 438 receiver MUST be able to receive and decode stereo signals but 439 sending stereo signals to a receiver that signaled a preference 440 for mono signals may result in higher than necessary network 441 utilization and encoding complexity. If no value is specified, 442 the default is 0 (mono). 444 sprop-stereo: specifies whether the sender is likely to produce 445 stereo audio. Possible values are 1 and 0, where 1 specifies that 446 stereo signals are likely to be sent, and 0 specifies that the 447 sender will likely only send mono. This is not a guarantee that 448 the sender will never send stereo audio (e.g. it could send a pre- 449 recorded prompt that uses stereo), but it indicates to the 450 receiver that the received signal can be safely downmixed to mono. 451 This parameter is useful to avoid wasting receiver resources by 452 operating the audio processing pipeline (e.g. echo cancellation) 453 in stereo when not necessary. If no value is specified, the 454 default is 0 (mono). 456 cbr: specifies if the decoder prefers the use of a constant bitrate 457 versus variable bitrate. Possible values are 1 and 0, where 1 458 specifies constant bitrate and 0 specifies variable bitrate. If 459 no value is specified, the default is 0 (vbr). When cbr is 1, the 460 maximum average bitrate can still change, e.g. to adapt to 461 changing network conditions. 463 useinbandfec: specifies that the decoder has the capability to take 464 advantage of the Opus in-band FEC. Possible values are 1 and 0. 466 Providing 0 when FEC cannot be used on the receiving side is 467 RECOMMENDED. If no value is specified, useinbandfec is assumed to 468 be 0. This parameter is only a preference and the receiver MUST 469 be able to process packets that include FEC information, even if 470 it means the FEC part is discarded. 472 usedtx: specifies if the decoder prefers the use of DTX. Possible 473 values are 1 and 0. If no value is specified, the default is 0. 475 Encoding considerations: 477 The Opus media type is framed and consists of binary data 478 according to Section 4.8 in [RFC6838]. 480 Security considerations: 482 See Section 8 of this document. 484 Interoperability considerations: none 486 Published specification: RFC [XXXX] 488 Note to the RFC Editor: Replace [XXXX] with the number of the 489 published RFC. 491 Applications that use this media type: 493 Any application that requires the transport of speech or audio 494 data can use this media type. Some examples are, but not limited 495 to, audio and video conferencing, Voice over IP, media streaming. 497 Fragment identifier considerations: N/A 499 Person & email address to contact for further information: 501 SILK Support silksupport@skype.net 502 Jean-Marc Valin jmvalin@jmvalin.ca 504 Intended usage: COMMON 506 Restrictions on usage: 508 For transfer over RTP, the RTP payload format (Section 4 of this 509 document) SHALL be used. 511 Author: 513 Julian Spittka jspittka@gmail.com 515 Koen Vos koenvos74@gmail.com 517 Jean-Marc Valin jmvalin@jmvalin.ca 519 Change controller: IETF Payload Working Group delegated from the IESG 521 7. SDP Considerations 523 The information described in the media type specification has a 524 specific mapping to fields in the Session Description Protocol (SDP) 525 [RFC4566], which is commonly used to describe RTP sessions. When SDP 526 is used to specify sessions employing Opus, the mapping is as 527 follows: 529 o The media type ("audio") goes in SDP "m=" as the media name. 530 o The media subtype ("opus") goes in SDP "a=rtpmap" as the encoding 531 name. The RTP clock rate in "a=rtpmap" MUST be 48000 and the 532 number of channels MUST be 2. 533 o The OPTIONAL media type parameters "ptime" and "maxptime" are 534 mapped to "a=ptime" and "a=maxptime" attributes, respectively, in 535 the SDP. 536 o The OPTIONAL media type parameters "maxaveragebitrate", 537 "maxplaybackrate", "stereo", "cbr", "useinbandfec", and "usedtx", 538 when present, MUST be included in the "a=fmtp" attribute in the 539 SDP, expressed as a media type string in the form of a semicolon- 540 separated list of parameter=value pairs (e.g., 541 maxplaybackrate=48000). They MUST NOT be specified in an SSRC- 542 specific "fmtp" source-level attribute (as defined in Section 6.3 543 of [RFC5576]). 544 o The OPTIONAL media type parameters "sprop-maxcapturerate", and 545 "sprop-stereo" MAY be mapped to the "a=fmtp" SDP attribute by 546 copying them directly from the media type parameter string as part 547 of the semicolon-separated list of parameter=value pairs (e.g., 548 sprop-stereo=1). These same OPTIONAL media type parameters MAY 549 also be specified using an SSRC-specific "fmtp" source-level 550 attribute as described in Section 6.3 of [RFC5576]. They MAY be 551 specified in both places, in which case the parameter in the 552 source-level attribute overrides the one found on the "a=fmtp" 553 line. The value of any parameter which is not specified in a 554 source-level source attribute MUST be taken from the "a=fmtp" 555 line, if it is present there. 557 Below are some examples of SDP session descriptions for Opus: 559 Example 1: Standard mono session with 48000 Hz clock rate 561 m=audio 54312 RTP/AVP 101 562 a=rtpmap:101 opus/48000/2 564 Example 2: 16000 Hz clock rate, maximum packet size of 40 ms, 565 recommended packet size of 40 ms, maximum average bitrate of 20000 566 bps, prefers to receive stereo but only plans to send mono, FEC is 567 desired, DTX is not desired 569 m=audio 54312 RTP/AVP 101 570 a=rtpmap:101 opus/48000/2 571 a=fmtp:101 maxplaybackrate=16000; sprop-maxcapturerate=16000; 572 maxaveragebitrate=20000; stereo=1; useinbandfec=1; usedtx=0 573 a=ptime:40 574 a=maxptime:40 576 Example 3: Two-way full-band stereo preferred 578 m=audio 54312 RTP/AVP 101 579 a=rtpmap:101 opus/48000/2 580 a=fmtp:101 stereo=1; sprop-stereo=1 582 7.1. SDP Offer/Answer Considerations 584 When using the offer-answer procedure described in [RFC3264] to 585 negotiate the use of Opus, the following considerations apply: 587 o Opus supports several clock rates. For signaling purposes only 588 the highest, i.e. 48000, is used. The actual clock rate of the 589 corresponding media is signaled inside the payload and is not 590 restricted by this payload format description. The decoder MUST 591 be capable of decoding every received clock rate. An example is 592 shown below: 594 m=audio 54312 RTP/AVP 100 595 a=rtpmap:100 opus/48000/2 597 o The "ptime" and "maxptime" parameters are unidirectional receive- 598 only parameters and typically will not compromise 599 interoperability; however, some values might cause application 600 performance to suffer. [RFC3264] defines the SDP offer-answer 601 handling of the "ptime" parameter. The "maxptime" parameter MUST 602 be handled in the same way. 603 o The "maxplaybackrate" parameter is a unidirectional receive-only 604 parameter that reflects limitations of the local receiver. When 605 sending to a single destination, a sender MUST NOT use an audio 606 bandwidth higher than necessary to make full use of audio sampled 607 at a sampling rate of "maxplaybackrate". Gateways or senders that 608 are sending the same encoded audio to multiple destinations SHOULD 609 NOT use an audio bandwidth higher than necessary to represent 610 audio sampled at "maxplaybackrate", as this would lead to 611 inefficient use of network resources. The "maxplaybackrate" 612 parameter does not affect interoperability. Also, this parameter 613 SHOULD NOT be used to adjust the audio bandwidth as a function of 614 the bitrate, as this is the responsibility of the Opus encoder 615 implementation. 616 o The "maxaveragebitrate" parameter is a unidirectional receive-only 617 parameter that reflects limitations of the local receiver. The 618 sender of the other side MUST NOT send with an average bitrate 619 higher than "maxaveragebitrate" as it might overload the network 620 and/or receiver. The "maxaveragebitrate" parameter typically will 621 not compromise interoperability; however, some values might cause 622 application performance to suffer, and ought to be set with care. 623 o The "sprop-maxcapturerate" and "sprop-stereo" parameters are 624 unidirectional sender-only parameters that reflect limitations of 625 the sender side. They allow the receiver to set up a reduced- 626 complexity audio processing pipeline if the sender is not planning 627 to use the full range of Opus's capabilities. Neither "sprop- 628 maxcapturerate" nor "sprop-stereo" affect interoperability and the 629 receiver MUST be capable of receiving any signal. 630 o The "stereo" parameter is a unidirectional receive-only parameter. 631 When sending to a single destination, a sender MUST NOT use stereo 632 when "stereo" is 0. Gateways or senders that are sending the same 633 encoded audio to multiple destinations SHOULD NOT use stereo when 634 "stereo" is 0, as this would lead to inefficient use of network 635 resources. The "stereo" parameter does not affect 636 interoperability. 637 o The "cbr" parameter is a unidirectional receive-only parameter. 638 o The "useinbandfec" parameter is a unidirectional receive-only 639 parameter. 640 o The "usedtx" parameter is a unidirectional receive-only parameter. 642 o Any unknown parameter in an offer MUST be ignored by the receiver 643 and MUST be removed from the answer. 645 The Opus parameters in an SDP Offer/Answer exchange are completely 646 orthogonal, and there is no relationship between the SDP Offer and 647 the Answer. 649 7.2. Declarative SDP Considerations for Opus 651 For declarative use of SDP such as in Session Announcement Protocol 652 (SAP), [RFC2974], and RTSP, [RFC2326], for Opus, the following needs 653 to be considered: 655 o The values for "maxptime", "ptime", "maxplaybackrate", and 656 "maxaveragebitrate" ought to be selected carefully to ensure that 657 a reasonable performance can be achieved for the participants of a 658 session. 659 o The values for "maxptime", "ptime", and of the payload format 660 configuration are recommendations by the decoding side to ensure 661 the best performance for the decoder. 662 o All other parameters of the payload format configuration are 663 declarative and a participant MUST use the configurations that are 664 provided for the session. More than one configuration can be 665 provided if necessary by declaring multiple RTP payload types; 666 however, the number of types ought to be kept small. 668 8. Security Considerations 670 Use of variable bitrate (VBR) is subject to the security 671 considerations in [RFC6562]. 673 RTP packets using the payload format defined in this specification 674 are subject to the security considerations discussed in the RTP 675 specification [RFC3550], and in any applicable RTP profile such as 676 RTP/AVP [RFC3551], RTP/AVPF [RFC4585], RTP/SAVP [RFC3711] or RTP/ 677 SAVPF [RFC5124]. However, as "Securing the RTP Protocol Framework: 678 Why RTP Does Not Mandate a Single Media Security Solution" [RFC7202] 679 discusses, it is not an RTP payload format's responsibility to 680 discuss or mandate what solutions are used to meet the basic security 681 goals like confidentiality, integrity and source authenticity for RTP 682 in general. This responsibility lays on anyone using RTP in an 683 application. They can find guidance on available security mechanisms 684 and important considerations in Options for Securing RTP Sessions [I- 685 D.ietf-avtcore-rtp-security-options]. Applications SHOULD use one or 686 more appropriate strong security mechanisms. 688 This payload format and the Opus encoding do not exhibit any 689 significant non-uniformity in the receiver-end computational load and 690 thus are unlikely to pose a denial-of-service threat due to the 691 receipt of pathological datagrams. 693 9. Acknowledgements 695 Many people have made useful comments and suggestions contributing to 696 this document. In particular, we would like to thank Tina le Grand, 697 Cullen Jennings, Jonathan Lennox, Gregory Maxwell, Colin Perkins, Jan 698 Skoglund, Timothy B. Terriberry, Martin Thompson, Justin Uberti, 699 Magnus Westerlund, and Mo Zanaty. 701 10. References 703 10.1. Normative References 705 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 706 Requirement Levels", BCP 14, RFC 2119, March 1997. 708 [RFC2326] Schulzrinne, H., Rao, A., and R. Lanphier, "Real Time 709 Streaming Protocol (RTSP)", RFC 2326, April 1998. 711 [RFC3264] Rosenberg, J. and H. Schulzrinne, "An Offer/Answer Model 712 with Session Description Protocol (SDP)", RFC 3264, June 713 2002. 715 [RFC3389] Zopf, R., "Real-time Transport Protocol (RTP) Payload for 716 Comfort Noise (CN)", RFC 3389, September 2002. 718 [RFC3550] Schulzrinne, H., Casner, S., Frederick, R., and V. 719 Jacobson, "RTP: A Transport Protocol for Real-Time 720 Applications", STD 64, RFC 3550, July 2003. 722 [RFC3551] Schulzrinne, H. and S. Casner, "RTP Profile for Audio and 723 Video Conferences with Minimal Control", STD 65, RFC 3551, 724 July 2003. 726 [RFC3711] Baugher, M., McGrew, D., Naslund, M., Carrara, E., and K. 727 Norrman, "The Secure Real-time Transport Protocol (SRTP)", 728 RFC 3711, March 2004. 730 [RFC4566] Handley, M., Jacobson, V., and C. Perkins, "SDP: Session 731 Description Protocol", RFC 4566, July 2006. 733 [RFC4855] Casner, S., "Media Type Registration of RTP Payload 734 Formats", RFC 4855, February 2007. 736 [RFC5576] Lennox, J., Ott, J., and T. Schierl, "Source-Specific 737 Media Attributes in the Session Description Protocol 738 (SDP)", RFC 5576, June 2009. 740 [RFC6562] Perkins, C. and JM. Valin, "Guidelines for the Use of 741 Variable Bit Rate Audio with Secure RTP", RFC 6562, March 742 2012. 744 [RFC6716] Valin, JM., Vos, K., and T. Terriberry, "Definition of the 745 Opus Audio Codec", RFC 6716, September 2012. 747 [RFC6838] Freed, N., Klensin, J., and T. Hansen, "Media Type 748 Specifications and Registration Procedures", BCP 13, RFC 749 6838, January 2013. 751 10.2. Informative References 753 [RFC2974] Handley, M., Perkins, C., and E. Whelan, "Session 754 Announcement Protocol", RFC 2974, October 2000. 756 [RFC4585] Ott, J., Wenger, S., Sato, N., Burmeister, C., and J. Rey, 757 "Extended RTP Profile for Real-time Transport Control 758 Protocol (RTCP)-Based Feedback (RTP/AVPF)", RFC 4585, July 759 2006. 761 [RFC5124] Ott, J. and E. Carrara, "Extended Secure RTP Profile for 762 Real-time Transport Control Protocol (RTCP)-Based Feedback 763 (RTP/SAVPF)", RFC 5124, February 2008. 765 [RFC5405] Eggert, L. and G. Fairhurst, "Unicast UDP Usage Guidelines 766 for Application Designers", BCP 145, RFC 5405, November 767 2008. 769 [RFC7202] Perkins, C. and M. Westerlund, "Securing the RTP 770 Framework: Why RTP Does Not Mandate a Single Media 771 Security Solution", RFC 7202, April 2014. 773 [rmcat] "rmcat documents", . 776 Authors' Addresses 778 Julian Spittka 780 Email: jspittka@gmail.com 781 Koen Vos 782 vocTone 784 Email: koenvos74@gmail.com 786 Jean-Marc Valin 787 Mozilla 788 331 E. Evelyn Avenue 789 Mountain View, CA 94041 790 USA 792 Email: jmvalin@jmvalin.ca