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

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