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