draft-ietf-payload-rtp-opus.xml 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
  3. <!ENTITY rfc2119 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml'>
  4. <!ENTITY rfc3389 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.3389.xml'>
  5. <!ENTITY rfc3550 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.3550.xml'>
  6. <!ENTITY rfc3711 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.3711.xml'>
  7. <!ENTITY rfc3551 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.3551.xml'>
  8. <!ENTITY rfc6838 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.6838.xml'>
  9. <!ENTITY rfc4855 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.4855.xml'>
  10. <!ENTITY rfc4566 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.4566.xml'>
  11. <!ENTITY rfc4585 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.4585.xml'>
  12. <!ENTITY rfc3264 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.3264.xml'>
  13. <!ENTITY rfc2974 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2974.xml'>
  14. <!ENTITY rfc2326 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2326.xml'>
  15. <!ENTITY rfc3555 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.3555.xml'>
  16. <!ENTITY rfc5124 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.5124.xml'>
  17. <!ENTITY rfc5405 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.5405.xml'>
  18. <!ENTITY rfc5576 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.5576.xml'>
  19. <!ENTITY rfc6562 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.6562.xml'>
  20. <!ENTITY rfc6716 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.6716.xml'>
  21. <!ENTITY rfc7202 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.7202.xml'>
  22. <!ENTITY nbsp "&#160;">
  23. ]>
  24. <rfc category="std" ipr="trust200902" docName="draft-ietf-payload-rtp-opus-11">
  25. <?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
  26. <?rfc strict="yes" ?>
  27. <?rfc toc="yes" ?>
  28. <?rfc tocdepth="3" ?>
  29. <?rfc tocappendix='no' ?>
  30. <?rfc tocindent='yes' ?>
  31. <?rfc symrefs="yes" ?>
  32. <?rfc sortrefs="yes" ?>
  33. <?rfc compact="no" ?>
  34. <?rfc subcompact="yes" ?>
  35. <?rfc iprnotified="yes" ?>
  36. <front>
  37. <title abbrev="RTP Payload Format for Opus">
  38. RTP Payload Format for the Opus Speech and Audio Codec
  39. </title>
  40. <author fullname="Julian Spittka" initials="J." surname="Spittka">
  41. <address>
  42. <email>jspittka@gmail.com</email>
  43. </address>
  44. </author>
  45. <author initials='K.' surname='Vos' fullname='Koen Vos'>
  46. <organization>vocTone</organization>
  47. <address>
  48. <postal>
  49. <street></street>
  50. <code></code>
  51. <city></city>
  52. <region></region>
  53. <country></country>
  54. </postal>
  55. <email>koenvos74@gmail.com</email>
  56. </address>
  57. </author>
  58. <author initials="JM" surname="Valin" fullname="Jean-Marc Valin">
  59. <organization>Mozilla</organization>
  60. <address>
  61. <postal>
  62. <street>331 E. Evelyn Avenue</street>
  63. <city>Mountain View</city>
  64. <region>CA</region>
  65. <code>94041</code>
  66. <country>USA</country>
  67. </postal>
  68. <email>jmvalin@jmvalin.ca</email>
  69. </address>
  70. </author>
  71. <date day='14' month='April' year='2015' />
  72. <abstract>
  73. <t>
  74. This document defines the Real-time Transport Protocol (RTP) payload
  75. format for packetization of Opus encoded
  76. speech and audio data necessary to integrate the codec in the
  77. most compatible way. It also provides an applicability statement
  78. for the use of Opus over RTP. Further, it describes media type registrations
  79. for the RTP payload format.
  80. </t>
  81. </abstract>
  82. </front>
  83. <middle>
  84. <section title='Introduction'>
  85. <t>
  86. Opus <xref target="RFC6716"/> is a speech and audio codec developed within the
  87. IETF Internet Wideband Audio Codec working group. The codec
  88. has a very low algorithmic delay and it
  89. is highly scalable in terms of audio bandwidth, bitrate, and
  90. complexity. Further, it provides different modes to efficiently encode speech signals
  91. as well as music signals, thus making it the codec of choice for
  92. various applications using the Internet or similar networks.
  93. </t>
  94. <t>
  95. This document defines the Real-time Transport Protocol (RTP)
  96. <xref target="RFC3550"/> payload format for packetization
  97. of Opus encoded speech and audio data necessary to
  98. integrate Opus in the
  99. most compatible way. It also provides an applicability statement
  100. for the use of Opus over RTP.
  101. Further, it describes media type registrations for
  102. the RTP payload format.
  103. </t>
  104. </section>
  105. <section title='Conventions, Definitions and Acronyms used in this document'>
  106. <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
  107. "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
  108. document are to be interpreted as described in <xref target="RFC2119"/>.</t>
  109. <t>
  110. <list style='hanging'>
  111. <t hangText="audio bandwidth:"> The range of audio frequecies being coded</t>
  112. <t hangText="CBR:"> Constant bitrate</t>
  113. <t hangText="CPU:"> Central Processing Unit</t>
  114. <t hangText="DTX:"> Discontinuous transmission</t>
  115. <t hangText="FEC:"> Forward error correction</t>
  116. <t hangText="IP:"> Internet Protocol</t>
  117. <t hangText="samples:"> Speech or audio samples (per channel)</t>
  118. <t hangText="SDP:"> Session Description Protocol</t>
  119. <t hangText="VBR:"> Variable bitrate</t>
  120. </list>
  121. </t>
  122. <t>
  123. Throughout this document, we refer to the following definitions:
  124. </t>
  125. <texttable anchor='bandwidth_definitions'>
  126. <ttcol align='center'>Abbreviation</ttcol>
  127. <ttcol align='center'>Name</ttcol>
  128. <ttcol align='center'>Audio Bandwidth (Hz)</ttcol>
  129. <ttcol align='center'>Sampling Rate (Hz)</ttcol>
  130. <c>NB</c>
  131. <c>Narrowband</c>
  132. <c>0 - 4000</c>
  133. <c>8000</c>
  134. <c>MB</c>
  135. <c>Mediumband</c>
  136. <c>0 - 6000</c>
  137. <c>12000</c>
  138. <c>WB</c>
  139. <c>Wideband</c>
  140. <c>0 - 8000</c>
  141. <c>16000</c>
  142. <c>SWB</c>
  143. <c>Super-wideband</c>
  144. <c>0 - 12000</c>
  145. <c>24000</c>
  146. <c>FB</c>
  147. <c>Fullband</c>
  148. <c>0 - 20000</c>
  149. <c>48000</c>
  150. <postamble>
  151. Audio bandwidth naming
  152. </postamble>
  153. </texttable>
  154. </section>
  155. <section title='Opus Codec'>
  156. <t>
  157. Opus encodes speech
  158. signals as well as general audio signals. Two different modes can be
  159. chosen, a voice mode or an audio mode, to allow the most efficient coding
  160. depending on the type of the input signal, the sampling frequency of the
  161. input signal, and the intended application.
  162. </t>
  163. <t>
  164. The voice mode allows efficient encoding of voice signals at lower bit
  165. rates while the audio mode is optimized for general audio signals at medium and
  166. higher bitrates.
  167. </t>
  168. <t>
  169. Opus is highly scalable in terms of audio
  170. bandwidth, bitrate, and complexity. Further, Opus allows
  171. transmitting stereo signals with in-band signaling in the bit-stream.
  172. </t>
  173. <section title='Network Bandwidth'>
  174. <t>
  175. Opus supports bitrates from 6&nbsp;kb/s to 510&nbsp;kb/s.
  176. The bitrate can be changed dynamically within that range.
  177. All
  178. other parameters being
  179. equal, higher bitrates result in higher audio quality.
  180. </t>
  181. <section title='Recommended Bitrate' anchor='bitrate_by_bandwidth'>
  182. <t>
  183. For a frame size of
  184. 20&nbsp;ms, these
  185. are the bitrate "sweet spots" for Opus in various configurations:
  186. <list style="symbols">
  187. <t>8-12 kb/s for NB speech,</t>
  188. <t>16-20 kb/s for WB speech,</t>
  189. <t>28-40 kb/s for FB speech,</t>
  190. <t>48-64 kb/s for FB mono music, and</t>
  191. <t>64-128 kb/s for FB stereo music.</t>
  192. </list>
  193. </t>
  194. </section>
  195. <section title='Variable versus Constant Bitrate' anchor='variable-vs-constant-bitrate'>
  196. <t>
  197. For the same average bitrate, variable bitrate (VBR) can achieve higher audio quality
  198. than constant bitrate (CBR). For the majority of voice transmission applications, VBR
  199. is the best choice. One reason for choosing CBR is the potential
  200. information leak that <spanx style='emph'>might</spanx> occur when encrypting the
  201. compressed stream. See <xref target="RFC6562"/> for guidelines on when VBR is
  202. appropriate for encrypted audio communications. In the case where an existing
  203. VBR stream needs to be converted to CBR for security reasons, then the Opus padding
  204. mechanism described in <xref target="RFC6716"/> is the RECOMMENDED way to achieve padding
  205. because the RTP padding bit is unencrypted.</t>
  206. <t>
  207. The bitrate can be adjusted at any point in time. To avoid congestion,
  208. the average bitrate SHOULD NOT exceed the available
  209. network bandwidth. If no target bitrate is specified, the bitrates specified in
  210. <xref target='bitrate_by_bandwidth'/> are RECOMMENDED.
  211. </t>
  212. </section>
  213. <section title='Discontinuous Transmission (DTX)'>
  214. <t>
  215. Opus can, as described in <xref target='variable-vs-constant-bitrate'/>,
  216. be operated with a variable bitrate. In that case, the encoder will
  217. automatically reduce the bitrate for certain input signals, like periods
  218. of silence. When using continuous transmission, it will reduce the
  219. bitrate when the characteristics of the input signal permit, but
  220. will never interrupt the transmission to the receiver. Therefore, the
  221. received signal will maintain the same high level of audio quality over the
  222. full duration of a transmission while minimizing the average bit
  223. rate over time.
  224. </t>
  225. <t>
  226. In cases where the bitrate of Opus needs to be reduced even
  227. further or in cases where only constant bitrate is available,
  228. the Opus encoder can use discontinuous
  229. transmission (DTX), where parts of the encoded signal that
  230. correspond to periods of silence in the input speech or audio signal
  231. are not transmitted to the receiver. A receiver can distinguish
  232. between DTX and packet loss by looking for gaps in the sequence
  233. number, as described by Section 4.1
  234. of&nbsp;<xref target="RFC3551"/>.
  235. </t>
  236. <t>
  237. On the receiving side, the non-transmitted parts will be handled by a
  238. frame loss concealment unit in the Opus decoder which generates a
  239. comfort noise signal to replace the non transmitted parts of the
  240. speech or audio signal. Use of <xref target="RFC3389"/> Comfort
  241. Noise (CN) with Opus is discouraged.
  242. The transmitter MUST drop whole frames only,
  243. based on the size of the last transmitted frame,
  244. to ensure successive RTP timestamps differ by a multiple of 120 and
  245. to allow the receiver to use whole frames for concealment.
  246. </t>
  247. <t>
  248. DTX can be used with both variable and constant bitrate.
  249. It will have a slightly lower speech or audio
  250. quality than continuous transmission. Therefore, using continuous
  251. transmission is RECOMMENDED unless constraints on available network bandwidth
  252. are severe.
  253. </t>
  254. </section>
  255. </section>
  256. <section title='Complexity'>
  257. <t>
  258. Complexity of the encoder can be scaled to optimize for CPU resources in real-time, mostly as
  259. a trade-off between audio quality and bitrate. Also, different modes of Opus have different complexity.
  260. </t>
  261. </section>
  262. <section title="Forward Error Correction (FEC)">
  263. <t>
  264. The voice mode of Opus allows for embedding "in-band" forward error correction (FEC)
  265. data into the Opus bit stream. This FEC scheme adds
  266. redundant information about the previous packet (N-1) to the current
  267. output packet N. For
  268. each frame, the encoder decides whether to use FEC based on (1) an
  269. externally-provided estimate of the channel's packet loss rate; (2) an
  270. externally-provided estimate of the channel's capacity; (3) the
  271. sensitivity of the audio or speech signal to packet loss; (4) whether
  272. the receiving decoder has indicated it can take advantage of "in-band"
  273. FEC information. The decision to send "in-band" FEC information is
  274. entirely controlled by the encoder and therefore no special precautions
  275. for the payload have to be taken.
  276. </t>
  277. <t>
  278. On the receiving side, the decoder can take advantage of this
  279. additional information when it loses a packet and the next packet
  280. is available. In order to use the FEC data, the jitter buffer needs
  281. to provide access to payloads with the FEC data.
  282. Instead of performing loss concealment for a missing packet, the
  283. receiver can then configure its decoder to decode the FEC data from the next packet.
  284. </t>
  285. <t>
  286. Any compliant Opus decoder is capable of ignoring
  287. FEC information when it is not needed, so encoding with FEC cannot cause
  288. interoperability problems.
  289. However, if FEC cannot be used on the receiving side, then FEC
  290. SHOULD NOT be used, as it leads to an inefficient usage of network
  291. resources. Decoder support for FEC SHOULD be indicated at the time a
  292. session is set up.
  293. </t>
  294. </section>
  295. <section title='Stereo Operation'>
  296. <t>
  297. Opus allows for transmission of stereo audio signals. This operation
  298. is signaled in-band in the Opus bit-stream and no special arrangement
  299. is needed in the payload format. An
  300. Opus decoder is capable of handling a stereo encoding, but an
  301. application might only be capable of consuming a single audio
  302. channel.
  303. </t>
  304. <t>
  305. If a decoder cannot take advantage of the benefits of a stereo signal
  306. this SHOULD be indicated at the time a session is set up. In that case
  307. the sending side SHOULD NOT send stereo signals as it leads to an
  308. inefficient usage of network resources.
  309. </t>
  310. </section>
  311. </section>
  312. <section title='Opus RTP Payload Format' anchor='opus-rtp-payload-format'>
  313. <t>The payload format for Opus consists of the RTP header and Opus payload
  314. data.</t>
  315. <section title='RTP Header Usage'>
  316. <t>The format of the RTP header is specified in <xref target="RFC3550"/>.
  317. The use of the fields of the RTP header by the Opus payload format is
  318. consistent with that specification.</t>
  319. <t>The payload length of Opus is an integer number of octets and
  320. therefore no padding is necessary. The payload MAY be padded by an
  321. integer number of octets according to <xref target="RFC3550"/>,
  322. although the Opus internal padding is preferred.</t>
  323. <t>The timestamp, sequence number, and marker bit (M) of the RTP header
  324. are used in accordance with Section 4.1
  325. of&nbsp;<xref target="RFC3551"/>.</t>
  326. <t>The RTP payload type for Opus is to be assigned dynamically.</t>
  327. <t>The receiving side MUST be prepared to receive duplicate RTP
  328. packets. The receiver MUST provide at most one of those payloads to the
  329. Opus decoder for decoding, and MUST discard the others.</t>
  330. <t>Opus supports 5 different audio bandwidths, which can be adjusted during
  331. a stream.
  332. The RTP timestamp is incremented with a 48000 Hz clock rate
  333. for all modes of Opus and all sampling rates.
  334. The unit
  335. for the timestamp is samples per single (mono) channel. The RTP timestamp corresponds to the
  336. sample time of the first encoded sample in the encoded frame.
  337. For data encoded with sampling rates other than 48000 Hz,
  338. the sampling rate has to be adjusted to 48000 Hz.</t>
  339. </section>
  340. <section title='Payload Structure'>
  341. <t>
  342. The Opus encoder can output encoded frames representing 2.5, 5, 10, 20,
  343. 40, or 60&nbsp;ms of speech or audio data. Further, an arbitrary number of frames can be
  344. combined into a packet, up to a maximum packet duration representing
  345. 120&nbsp;ms of speech or audio data. The grouping of one or more Opus
  346. frames into a single Opus packet is defined in Section&nbsp;3 of
  347. <xref target="RFC6716"/>. An RTP payload MUST contain exactly one
  348. Opus packet as defined by that document.
  349. </t>
  350. <t><xref target='payload-structure'/> shows the structure combined with the RTP header.</t>
  351. <figure anchor="payload-structure"
  352. title="Packet structure with RTP header">
  353. <artwork align="center">
  354. <![CDATA[
  355. +----------+--------------+
  356. |RTP Header| Opus Payload |
  357. +----------+--------------+
  358. ]]>
  359. </artwork>
  360. </figure>
  361. <t>
  362. <xref target='opus-packetization'/> shows supported frame sizes in
  363. milliseconds of encoded speech or audio data for the speech and audio modes
  364. (Mode) and sampling rates (fs) of Opus and shows how the timestamp is
  365. incremented for packetization (ts incr). If the Opus encoder
  366. outputs multiple encoded frames into a single packet, the timestamp
  367. increment is the sum of the increments for the individual frames.
  368. </t>
  369. <texttable anchor='opus-packetization' title="Supported Opus frame
  370. sizes and timestamp increments marked with an o. Unsupported marked with an x.">
  371. <ttcol align='center'>Mode</ttcol>
  372. <ttcol align='center'>fs</ttcol>
  373. <ttcol align='center'>2.5</ttcol>
  374. <ttcol align='center'>5</ttcol>
  375. <ttcol align='center'>10</ttcol>
  376. <ttcol align='center'>20</ttcol>
  377. <ttcol align='center'>40</ttcol>
  378. <ttcol align='center'>60</ttcol>
  379. <c>ts incr</c>
  380. <c>all</c>
  381. <c>120</c>
  382. <c>240</c>
  383. <c>480</c>
  384. <c>960</c>
  385. <c>1920</c>
  386. <c>2880</c>
  387. <c>voice</c>
  388. <c>NB/MB/WB/SWB/FB</c>
  389. <c>x</c>
  390. <c>x</c>
  391. <c>o</c>
  392. <c>o</c>
  393. <c>o</c>
  394. <c>o</c>
  395. <c>audio</c>
  396. <c>NB/WB/SWB/FB</c>
  397. <c>o</c>
  398. <c>o</c>
  399. <c>o</c>
  400. <c>o</c>
  401. <c>x</c>
  402. <c>x</c>
  403. </texttable>
  404. </section>
  405. </section>
  406. <section title='Congestion Control'>
  407. <t>The target bitrate of Opus can be adjusted at any point in time, thus
  408. allowing efficient congestion control. Furthermore, the amount
  409. of encoded speech or audio data encoded in a
  410. single packet can be used for congestion control, since the transmission
  411. rate is inversely proportional to the packet duration. A lower packet
  412. transmission rate reduces the amount of header overhead, but at the same
  413. time increases latency and loss sensitivity, so it ought to be used with
  414. care.</t>
  415. <t>Since UDP does not provide congestion control, applications that use
  416. RTP over UDP SHOULD implement their own congestion control above the
  417. UDP layer <xref target="RFC5405"/>. Work in the rmcat working group
  418. <xref target="rmcat"/> describes the
  419. interactions and conceptual interfaces necessary between the application
  420. components that relate to congestion control, including the RTP layer,
  421. the higher-level media codec control layer, and the lower-level
  422. transport interface, as well as components dedicated to congestion
  423. control functions.</t>
  424. </section>
  425. <section title='IANA Considerations'>
  426. <t>One media subtype (audio/opus) has been defined and registered as
  427. described in the following section.</t>
  428. <section title='Opus Media Type Registration'>
  429. <t>Media type registration is done according to <xref
  430. target="RFC6838"/> and <xref target="RFC4855"/>.<vspace
  431. blankLines='1'/></t>
  432. <t>Type name: audio<vspace blankLines='1'/></t>
  433. <t>Subtype name: opus<vspace blankLines='1'/></t>
  434. <t>Required parameters:</t>
  435. <t><list style="hanging">
  436. <t hangText="rate:"> the RTP timestamp is incremented with a
  437. 48000 Hz clock rate for all modes of Opus and all sampling
  438. rates. For data encoded with sampling rates other than 48000 Hz,
  439. the sampling rate has to be adjusted to 48000 Hz.
  440. </t>
  441. </list></t>
  442. <t>Optional parameters:</t>
  443. <t><list style="hanging">
  444. <t hangText="maxplaybackrate:">
  445. a hint about the maximum output sampling rate that the receiver is
  446. capable of rendering in Hz.
  447. The decoder MUST be capable of decoding
  448. any audio bandwidth but due to hardware limitations only signals
  449. up to the specified sampling rate can be played back. Sending signals
  450. with higher audio bandwidth results in higher than necessary network
  451. usage and encoding complexity, so an encoder SHOULD NOT encode
  452. frequencies above the audio bandwidth specified by maxplaybackrate.
  453. This parameter can take any value between 8000 and 48000, although
  454. commonly the value will match one of the Opus bandwidths
  455. (<xref target="bandwidth_definitions"/>).
  456. By default, the receiver is assumed to have no limitations, i.e. 48000.
  457. <vspace blankLines='1'/>
  458. </t>
  459. <t hangText="sprop-maxcapturerate:">
  460. a hint about the maximum input sampling rate that the sender is likely to produce.
  461. This is not a guarantee that the sender will never send any higher bandwidth
  462. (e.g. it could send a pre-recorded prompt that uses a higher bandwidth), but it
  463. indicates to the receiver that frequencies above this maximum can safely be discarded.
  464. This parameter is useful to avoid wasting receiver resources by operating the audio
  465. processing pipeline (e.g. echo cancellation) at a higher rate than necessary.
  466. This parameter can take any value between 8000 and 48000, although
  467. commonly the value will match one of the Opus bandwidths
  468. (<xref target="bandwidth_definitions"/>).
  469. By default, the sender is assumed to have no limitations, i.e. 48000.
  470. <vspace blankLines='1'/>
  471. </t>
  472. <t hangText="maxptime:"> the maximum duration of media represented
  473. by a packet (according to Section&nbsp;6 of
  474. <xref target="RFC4566"/>) that a decoder wants to receive, in
  475. milliseconds rounded up to the next full integer value.
  476. Possible values are 3, 5, 10, 20, 40, 60, or an arbitrary
  477. multiple of an Opus frame size rounded up to the next full integer
  478. value, up to a maximum value of 120, as
  479. defined in <xref target='opus-rtp-payload-format'/>. If no value is
  480. specified, the default is 120.
  481. <vspace blankLines='1'/></t>
  482. <t hangText="ptime:"> the preferred duration of media represented
  483. by a packet (according to Section&nbsp;6 of
  484. <xref target="RFC4566"/>) that a decoder wants to receive, in
  485. milliseconds rounded up to the next full integer value.
  486. Possible values are 3, 5, 10, 20, 40, 60, or an arbitrary
  487. multiple of an Opus frame size rounded up to the next full integer
  488. value, up to a maximum value of 120, as defined in <xref
  489. target='opus-rtp-payload-format'/>. If no value is
  490. specified, the default is 20.
  491. <vspace blankLines='1'/></t>
  492. <t hangText="maxaveragebitrate:"> specifies the maximum average
  493. receive bitrate of a session in bits per second (b/s). The actual
  494. value of the bitrate can vary, as it is dependent on the
  495. characteristics of the media in a packet. Note that the maximum
  496. average bitrate MAY be modified dynamically during a session. Any
  497. positive integer is allowed, but values outside the range
  498. 6000 to 510000 SHOULD be ignored. If no value is specified, the
  499. maximum value specified in <xref target='bitrate_by_bandwidth'/>
  500. for the corresponding mode of Opus and corresponding maxplaybackrate
  501. is the default.<vspace blankLines='1'/></t>
  502. <t hangText="stereo:">
  503. specifies whether the decoder prefers receiving stereo or mono signals.
  504. Possible values are 1 and 0 where 1 specifies that stereo signals are preferred,
  505. and 0 specifies that only mono signals are preferred.
  506. Independent of the stereo parameter every receiver MUST be able to receive and
  507. decode stereo signals but sending stereo signals to a receiver that signaled a
  508. preference for mono signals may result in higher than necessary network
  509. utilization and encoding complexity. If no value is specified,
  510. the default is 0 (mono).<vspace blankLines='1'/>
  511. </t>
  512. <t hangText="sprop-stereo:">
  513. specifies whether the sender is likely to produce stereo audio.
  514. Possible values are 1 and 0, where 1 specifies that stereo signals are likely to
  515. be sent, and 0 specifies that the sender will likely only send mono.
  516. This is not a guarantee that the sender will never send stereo audio
  517. (e.g. it could send a pre-recorded prompt that uses stereo), but it
  518. indicates to the receiver that the received signal can be safely downmixed to mono.
  519. This parameter is useful to avoid wasting receiver resources by operating the audio
  520. processing pipeline (e.g. echo cancellation) in stereo when not necessary.
  521. If no value is specified, the default is 0
  522. (mono).<vspace blankLines='1'/>
  523. </t>
  524. <t hangText="cbr:">
  525. specifies if the decoder prefers the use of a constant bitrate versus
  526. variable bitrate. Possible values are 1 and 0, where 1 specifies constant
  527. bitrate and 0 specifies variable bitrate. If no value is specified,
  528. the default is 0 (vbr). When cbr is 1, the maximum average bitrate can still
  529. change, e.g. to adapt to changing network conditions.<vspace blankLines='1'/>
  530. </t>
  531. <t hangText="useinbandfec:"> specifies that the decoder has the capability to
  532. take advantage of the Opus in-band FEC. Possible values are 1 and 0.
  533. Providing 0 when FEC cannot be used on the receiving side is
  534. RECOMMENDED. If no
  535. value is specified, useinbandfec is assumed to be 0.
  536. This parameter is only a preference and the receiver MUST be able to process
  537. packets that include FEC information, even if it means the FEC part is discarded.
  538. <vspace blankLines='1'/></t>
  539. <t hangText="usedtx:"> specifies if the decoder prefers the use of
  540. DTX. Possible values are 1 and 0. If no value is specified, the
  541. default is 0.<vspace blankLines='1'/></t>
  542. </list></t>
  543. <t>Encoding considerations:<vspace blankLines='1'/></t>
  544. <t><list style="hanging">
  545. <t>The Opus media type is framed and consists of binary data according
  546. to Section&nbsp;4.8 in <xref target="RFC6838"/>.</t>
  547. </list></t>
  548. <t>Security considerations: </t>
  549. <t><list style="hanging">
  550. <t>See <xref target='security-considerations'/> of this document.</t>
  551. </list></t>
  552. <t>Interoperability considerations: none<vspace blankLines='1'/></t>
  553. <t>Published specification: RFC [XXXX]</t>
  554. <t>Note to the RFC Editor: Replace [XXXX] with the number of the published
  555. RFC.<vspace blankLines='1'/></t>
  556. <t>Applications that use this media type: </t>
  557. <t><list style="hanging">
  558. <t>Any application that requires the transport of
  559. speech or audio data can use this media type. Some examples are,
  560. but not limited to, audio and video conferencing, Voice over IP,
  561. media streaming.</t>
  562. </list></t>
  563. <t>Fragment identifier considerations: N/A<vspace blankLines='1'/></t>
  564. <t>Person &amp; email address to contact for further information:</t>
  565. <t><list style="hanging">
  566. <t>SILK Support silksupport@skype.net</t>
  567. <t>Jean-Marc Valin jmvalin@jmvalin.ca</t>
  568. </list></t>
  569. <t>Intended usage: COMMON<vspace blankLines='1'/></t>
  570. <t>Restrictions on usage:<vspace blankLines='1'/></t>
  571. <t><list style="hanging">
  572. <t>For transfer over RTP, the RTP payload format (<xref
  573. target='opus-rtp-payload-format'/> of this document) SHALL be
  574. used.</t>
  575. </list></t>
  576. <t>Author:</t>
  577. <t><list style="hanging">
  578. <t>Julian Spittka jspittka@gmail.com<vspace blankLines='1'/></t>
  579. <t>Koen Vos koenvos74@gmail.com<vspace blankLines='1'/></t>
  580. <t>Jean-Marc Valin jmvalin@jmvalin.ca<vspace blankLines='1'/></t>
  581. </list></t>
  582. <t> Change controller: IETF Payload Working Group delegated from the IESG</t>
  583. </section>
  584. </section>
  585. <section title='SDP Considerations'>
  586. <t>The information described in the media type specification has a
  587. specific mapping to fields in the Session Description Protocol (SDP)
  588. <xref target="RFC4566"/>, which is commonly used to describe RTP
  589. sessions. When SDP is used to specify sessions employing Opus,
  590. the mapping is as follows:</t>
  591. <t>
  592. <list style="symbols">
  593. <t>The media type ("audio") goes in SDP "m=" as the media name.</t>
  594. <t>The media subtype ("opus") goes in SDP "a=rtpmap" as the encoding
  595. name. The RTP clock rate in "a=rtpmap" MUST be 48000 and the number of
  596. channels MUST be 2.</t>
  597. <t>The OPTIONAL media type parameters "ptime" and "maxptime" are
  598. mapped to "a=ptime" and "a=maxptime" attributes, respectively, in the
  599. SDP.</t>
  600. <t>The OPTIONAL media type parameters "maxaveragebitrate",
  601. "maxplaybackrate", "stereo", "cbr", "useinbandfec", and
  602. "usedtx", when present, MUST be included in the "a=fmtp" attribute
  603. in the SDP, expressed as a media type string in the form of a
  604. semicolon-separated list of parameter=value pairs (e.g.,
  605. maxplaybackrate=48000). They MUST NOT be specified in an
  606. SSRC-specific "fmtp" source-level attribute (as defined in
  607. Section&nbsp;6.3 of&nbsp;<xref target="RFC5576"/>).</t>
  608. <t>The OPTIONAL media type parameters "sprop-maxcapturerate",
  609. and "sprop-stereo" MAY be mapped to the "a=fmtp" SDP attribute by
  610. copying them directly from the media type parameter string as part
  611. of the semicolon-separated list of parameter=value pairs (e.g.,
  612. sprop-stereo=1). These same OPTIONAL media type parameters MAY also
  613. be specified using an SSRC-specific "fmtp" source-level attribute
  614. as described in Section&nbsp;6.3 of&nbsp;<xref target="RFC5576"/>.
  615. They MAY be specified in both places, in which case the parameter
  616. in the source-level attribute overrides the one found on the
  617. "a=fmtp" line. The value of any parameter which is not specified in
  618. a source-level source attribute MUST be taken from the "a=fmtp"
  619. line, if it is present there.</t>
  620. </list>
  621. </t>
  622. <t>Below are some examples of SDP session descriptions for Opus:</t>
  623. <t>Example 1: Standard mono session with 48000 Hz clock rate</t>
  624. <figure>
  625. <artwork>
  626. <![CDATA[
  627. m=audio 54312 RTP/AVP 101
  628. a=rtpmap:101 opus/48000/2
  629. ]]>
  630. </artwork>
  631. </figure>
  632. <t>Example 2: 16000 Hz clock rate, maximum packet size of 40 ms,
  633. recommended packet size of 40 ms, maximum average bitrate of 20000 bps,
  634. prefers to receive stereo but only plans to send mono, FEC is desired,
  635. DTX is not desired</t>
  636. <figure>
  637. <artwork>
  638. <![CDATA[
  639. m=audio 54312 RTP/AVP 101
  640. a=rtpmap:101 opus/48000/2
  641. a=fmtp:101 maxplaybackrate=16000; sprop-maxcapturerate=16000;
  642. maxaveragebitrate=20000; stereo=1; useinbandfec=1; usedtx=0
  643. a=ptime:40
  644. a=maxptime:40
  645. ]]>
  646. </artwork>
  647. </figure>
  648. <t>Example 3: Two-way full-band stereo preferred</t>
  649. <figure>
  650. <artwork>
  651. <![CDATA[
  652. m=audio 54312 RTP/AVP 101
  653. a=rtpmap:101 opus/48000/2
  654. a=fmtp:101 stereo=1; sprop-stereo=1
  655. ]]>
  656. </artwork>
  657. </figure>
  658. <section title='SDP Offer/Answer Considerations'>
  659. <t>When using the offer-answer procedure described in <xref
  660. target="RFC3264"/> to negotiate the use of Opus, the following
  661. considerations apply:</t>
  662. <t><list style="symbols">
  663. <t>Opus supports several clock rates. For signaling purposes only
  664. the highest, i.e. 48000, is used. The actual clock rate of the
  665. corresponding media is signaled inside the payload and is not
  666. restricted by this payload format description. The decoder MUST be
  667. capable of decoding every received clock rate. An example
  668. is shown below:
  669. <figure>
  670. <artwork>
  671. <![CDATA[
  672. m=audio 54312 RTP/AVP 100
  673. a=rtpmap:100 opus/48000/2
  674. ]]>
  675. </artwork>
  676. </figure>
  677. </t>
  678. <t>The "ptime" and "maxptime" parameters are unidirectional
  679. receive-only parameters and typically will not compromise
  680. interoperability; however, some values might cause application
  681. performance to suffer. <xref
  682. target="RFC3264"/> defines the SDP offer-answer handling of the
  683. "ptime" parameter. The "maxptime" parameter MUST be handled in the
  684. same way.</t>
  685. <t>
  686. The "maxplaybackrate" parameter is a unidirectional receive-only
  687. parameter that reflects limitations of the local receiver. When
  688. sending to a single destination, a sender MUST NOT use an audio
  689. bandwidth higher than necessary to make full use of audio sampled at
  690. a sampling rate of "maxplaybackrate". Gateways or senders that
  691. are sending the same encoded audio to multiple destinations
  692. SHOULD NOT use an audio bandwidth higher than necessary to
  693. represent audio sampled at "maxplaybackrate", as this would lead
  694. to inefficient use of network resources.
  695. The "maxplaybackrate" parameter does not
  696. affect interoperability. Also, this parameter SHOULD NOT be used
  697. to adjust the audio bandwidth as a function of the bitrate, as this
  698. is the responsibility of the Opus encoder implementation.
  699. </t>
  700. <t>The "maxaveragebitrate" parameter is a unidirectional receive-only
  701. parameter that reflects limitations of the local receiver. The sender
  702. of the other side MUST NOT send with an average bitrate higher than
  703. "maxaveragebitrate" as it might overload the network and/or
  704. receiver. The "maxaveragebitrate" parameter typically will not
  705. compromise interoperability; however, some values might cause
  706. application performance to suffer, and ought to be set with
  707. care.</t>
  708. <t>The "sprop-maxcapturerate" and "sprop-stereo" parameters are
  709. unidirectional sender-only parameters that reflect limitations of
  710. the sender side.
  711. They allow the receiver to set up a reduced-complexity audio
  712. processing pipeline if the sender is not planning to use the full
  713. range of Opus's capabilities.
  714. Neither "sprop-maxcapturerate" nor "sprop-stereo" affect
  715. interoperability and the receiver MUST be capable of receiving any signal.
  716. </t>
  717. <t>
  718. The "stereo" parameter is a unidirectional receive-only
  719. parameter. When sending to a single destination, a sender MUST
  720. NOT use stereo when "stereo" is 0. Gateways or senders that are
  721. sending the same encoded audio to multiple destinations SHOULD
  722. NOT use stereo when "stereo" is 0, as this would lead to
  723. inefficient use of network resources. The "stereo" parameter does
  724. not affect interoperability.
  725. </t>
  726. <t>
  727. The "cbr" parameter is a unidirectional receive-only
  728. parameter.
  729. </t>
  730. <t>The "useinbandfec" parameter is a unidirectional receive-only
  731. parameter.</t>
  732. <t>The "usedtx" parameter is a unidirectional receive-only
  733. parameter.</t>
  734. <t>Any unknown parameter in an offer MUST be ignored by the receiver
  735. and MUST be removed from the answer.</t>
  736. </list></t>
  737. <t>
  738. The Opus parameters in an SDP Offer/Answer exchange are completely
  739. orthogonal, and there is no relationship between the SDP Offer and
  740. the Answer.
  741. </t>
  742. </section>
  743. <section title='Declarative SDP Considerations for Opus'>
  744. <t>For declarative use of SDP such as in Session Announcement Protocol
  745. (SAP), <xref target="RFC2974"/>, and RTSP, <xref target="RFC2326"/>, for
  746. Opus, the following needs to be considered:</t>
  747. <t><list style="symbols">
  748. <t>The values for "maxptime", "ptime", "maxplaybackrate", and
  749. "maxaveragebitrate" ought to be selected carefully to ensure that a
  750. reasonable performance can be achieved for the participants of a session.</t>
  751. <t>
  752. The values for "maxptime", "ptime", and of the payload
  753. format configuration are recommendations by the decoding side to ensure
  754. the best performance for the decoder.
  755. </t>
  756. <t>All other parameters of the payload format configuration are declarative
  757. and a participant MUST use the configurations that are provided for
  758. the session. More than one configuration can be provided if necessary
  759. by declaring multiple RTP payload types; however, the number of types
  760. ought to be kept small.</t>
  761. </list></t>
  762. </section>
  763. </section>
  764. <section title='Security Considerations' anchor='security-considerations'>
  765. <t>Use of variable bitrate (VBR) is subject to the security considerations in
  766. <xref target="RFC6562"/>.</t>
  767. <t>RTP packets using the payload format defined in this specification
  768. are subject to the security considerations discussed in the RTP
  769. specification <xref target="RFC3550"/>, and in any applicable RTP profile such as
  770. RTP/AVP <xref target="RFC3551"/>, RTP/AVPF <xref target="RFC4585"/>,
  771. RTP/SAVP <xref target="RFC3711"/> or RTP/SAVPF <xref target="RFC5124"/>.
  772. However, as "Securing the RTP Protocol Framework:
  773. Why RTP Does Not Mandate a Single Media Security Solution"
  774. <xref target="RFC7202"/> discusses, it is not an RTP payload
  775. format's responsibility to discuss or mandate what solutions are used
  776. to meet the basic security goals like confidentiality, integrity and
  777. source authenticity for RTP in general. This responsibility lays on
  778. anyone using RTP in an application. They can find guidance on
  779. available security mechanisms and important considerations in Options
  780. for Securing RTP Sessions [I-D.ietf-avtcore-rtp-security-options].
  781. Applications SHOULD use one or more appropriate strong security
  782. mechanisms.</t>
  783. <t>This payload format and the Opus encoding do not exhibit any
  784. significant non-uniformity in the receiver-end computational load and thus
  785. are unlikely to pose a denial-of-service threat due to the receipt of
  786. pathological datagrams.</t>
  787. </section>
  788. <section title='Acknowledgements'>
  789. <t>Many people have made useful comments and suggestions contributing to this document.
  790. In particular, we would like to thank
  791. Tina le Grand, Cullen Jennings, Jonathan Lennox, Gregory Maxwell, Colin Perkins, Jan Skoglund,
  792. Timothy B. Terriberry, Martin Thompson, Justin Uberti, Magnus Westerlund, and Mo Zanaty.</t>
  793. </section>
  794. </middle>
  795. <back>
  796. <references title="Normative References">
  797. &rfc2119;
  798. &rfc3389;
  799. &rfc3550;
  800. &rfc3711;
  801. &rfc3551;
  802. &rfc6838;
  803. &rfc4855;
  804. &rfc4566;
  805. &rfc3264;
  806. &rfc2326;
  807. &rfc5576;
  808. &rfc6562;
  809. &rfc6716;
  810. </references>
  811. <references title="Informative References">
  812. &rfc2974;
  813. &rfc4585;
  814. &rfc5124;
  815. &rfc5405;
  816. &rfc7202;
  817. <reference anchor='rmcat' target='https://datatracker.ietf.org/wg/rmcat/documents/'>
  818. <front>
  819. <title>rmcat documents</title>
  820. <author/>
  821. <date/>
  822. <abstract>
  823. <t></t>
  824. </abstract></front>
  825. </reference>
  826. </references>
  827. </back>
  828. </rfc>