draft-spittka-payload-rtp-opus.xml 40 KB

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