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