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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912
  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 efficient encoding of 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, bitrate, and complexity. Further, Opus allows
  168. transmitting 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, although it MAY
  289. decode those signals as mono.
  290. </t>
  291. <t>
  292. If a decoder can not take advantage of the benefits of a stereo signal
  293. this SHOULD be indicated at the time a session is set up. In that case
  294. the sending side SHOULD NOT send stereo signals as it leads to an
  295. inefficient usage of the network.
  296. </t>
  297. </section>
  298. </section>
  299. <section title='Opus RTP Payload Format' anchor='opus-rtp-payload-format'>
  300. <t>The payload format for Opus consists of the RTP header and Opus payload
  301. data.</t>
  302. <section title='RTP Header Usage'>
  303. <t>The format of the RTP header is specified in <xref target="RFC3550"/>. The Opus
  304. payload format uses the fields of the RTP header consistent with this
  305. specification.</t>
  306. <t>The payload length of Opus is a multiple number of octets and
  307. therefore no padding is required. The payload MAY be padded by an
  308. integer number of octets according to <xref target="RFC3550"/>.</t>
  309. <t>The marker bit (M) of the RTP header is used in accordance with
  310. Section 4.1 of <xref target="RFC3551"/>.</t>
  311. <t>The RTP payload type for Opus has not been assigned statically and is
  312. expected to be assigned dynamically.</t>
  313. <t>The receiving side MUST be prepared to receive duplicates of RTP
  314. packets. Only one of those payloads MUST be provided to the Opus decoder
  315. for decoding and others MUST be discarded.</t>
  316. <t>Opus supports 5 different audio bandwidths which may be adjusted during
  317. the duration of a call. The RTP timestamp clock frequency is defined as
  318. the highest supported sampling frequency of Opus, i.e. 48000 Hz, for all
  319. modes and sampling rates of Opus. The unit
  320. for the timestamp is samples per single (mono) channel. The RTP timestamp corresponds to the
  321. sample time of the first encoded sample in the encoded frame. For sampling
  322. rates lower than 48000 Hz the number of samples has to be multiplied with
  323. a multiplier according to <xref target="fs-upsample-factors"/> to determine
  324. the RTP timestamp.</t>
  325. <texttable anchor='fs-upsample-factors'>
  326. <ttcol align='center'>fs (Hz)</ttcol>
  327. <ttcol align='center'>Multiplier</ttcol>
  328. <c>8000</c>
  329. <c>6</c>
  330. <c>12000</c>
  331. <c>4</c>
  332. <c>16000</c>
  333. <c>3</c>
  334. <c>24000</c>
  335. <c>2</c>
  336. <c>48000</c>
  337. <c>1</c>
  338. <postamble>
  339. fs specifies the audio sampling frequency in Hertz (Hz); Multiplier is the
  340. value that the number of samples have to be multiplied with to calculate
  341. the RTP timestamp.
  342. </postamble>
  343. </texttable>
  344. </section>
  345. <section title='Payload Structure'>
  346. <t>
  347. The Opus encoder can be set to output encoded frames representing 2.5, 5, 10, 20,
  348. 40, or 60 ms of speech or audio data. Further, an arbitrary number of frames can be
  349. combined into a packet. The maximum packet length is limited to the amount of encoded
  350. data representing 120 ms of speech or audio data. The packetization of encoded data
  351. is purely done by the Opus encoder and therefore only one packet output from the Opus
  352. encoder MUST be used as a payload.
  353. </t>
  354. <t><xref target='payload-structure'/> shows the structure combined with the RTP header.</t>
  355. <figure anchor="payload-structure"
  356. title="Payload Structure with RTP header">
  357. <artwork>
  358. <![CDATA[
  359. +----------+--------------+
  360. |RTP Header| Opus Payload |
  361. +----------+--------------+
  362. ]]>
  363. </artwork>
  364. </figure>
  365. <t>
  366. <xref target='opus-packetization'/> shows supported frame sizes for different modes
  367. and sampling rates of Opus and how the timestamp needs to be incremented for
  368. packetization.
  369. </t>
  370. <texttable anchor='opus-packetization'>
  371. <ttcol align='center'>Mode</ttcol>
  372. <ttcol align='center'>fs</ttcol>
  373. <ttcol align='center'>2.5</ttcol>
  374. <ttcol align='center'>5</ttcol>
  375. <ttcol align='center'>10</ttcol>
  376. <ttcol align='center'>20</ttcol>
  377. <ttcol align='center'>40</ttcol>
  378. <ttcol align='center'>60</ttcol>
  379. <c>ts incr</c>
  380. <c>all</c>
  381. <c>120</c>
  382. <c>240</c>
  383. <c>480</c>
  384. <c>960</c>
  385. <c>1920</c>
  386. <c>2880</c>
  387. <c>voice</c>
  388. <c>nb/mb/wb/swb/fb</c>
  389. <c></c>
  390. <c></c>
  391. <c>x</c>
  392. <c>x</c>
  393. <c>x</c>
  394. <c>x</c>
  395. <c>audio</c>
  396. <c>nb/wb/swb/fb</c>
  397. <c>x</c>
  398. <c>x</c>
  399. <c>x</c>
  400. <c>x</c>
  401. <c></c>
  402. <c></c>
  403. <postamble>
  404. Mode specifies the Opus mode of operation; fs specifies the audio sampling
  405. frequency in Hertz (Hz); 2.5, 5, 10, 20, 40, and 60 represent the duration of
  406. encoded speech or audio data in a packet; ts incr specifies the
  407. value the timestamp needs to be incremented for the representing packet size.
  408. For multiple frames in a packet these values have to be multiplied with the
  409. respective number of frames.
  410. </postamble>
  411. </texttable>
  412. </section>
  413. </section>
  414. <section title='Congestion Control'>
  415. <t>The adaptive nature of the Opus codec allows for an efficient
  416. congestion control.</t>
  417. <t>The target bitrate of Opus can be adjusted at any point in time and
  418. thus allowing for an efficient congestion control. Furthermore, the amount
  419. of encoded speech or audio data encoded in a
  420. single packet can be used for congestion control since the transmission
  421. rate is inversely proportional to these frame sizes. A lower packet
  422. transmission rate reduces the amount of header overhead but at the same
  423. time increases latency and error sensitivity and should be done with care.</t>
  424. <t>It is RECOMMENDED that congestion control is applied during the
  425. transmission of Opus encoded data.</t>
  426. </section>
  427. <section title='IANA Considerations'>
  428. <t>One media subtype (audio/opus) has been defined and registered as
  429. described in the following section.</t>
  430. <section title='Opus Media Type Registration'>
  431. <t>Media type registration is done according to <xref
  432. target="RFC4288"/> and <xref target="RFC4855"/>.<vspace
  433. blankLines='1'/></t>
  434. <t>Type name: audio<vspace blankLines='1'/></t>
  435. <t>Subtype name: opus<vspace blankLines='1'/></t>
  436. <t>Required parameters:</t>
  437. <t><list style="hanging">
  438. <t hangText="rate:"> RTP timestamp clock rate is incremented with
  439. 48000 Hz clock rate for all modes of Opus and all sampling
  440. frequencies. For audio sampling rates other than 48000 Hz the rate
  441. has to be adjusted to 48000 Hz according to <xref target="fs-upsample-factors"/>.
  442. </t>
  443. </list></t>
  444. <t>Optional parameters:</t>
  445. <t><list style="hanging">
  446. <t hangText="maxplaybackrate:">
  447. a hint about the maximum output sampling rate that the receiver is
  448. capable of renderingin in Hz.
  449. The decoder MUST be capable of decoding
  450. any audio bandwidth but due to hardware limitations only signals
  451. up to the specified sampling rate can be played back. Sending signals
  452. with higher audio bandwidth results in higher than necessary network
  453. usage and encoding complexity, so an encoder SHOULD NOT encode
  454. frequencies above the audio bandwidth specified by maxplaybackrate.
  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 receiver is assumed to have no limitations, i.e. 48000.
  459. <vspace blankLines='1'/>
  460. </t>
  461. <t hangText="sprop-maxcapturerate:">
  462. a hint about the maximum input sampling rate that the sender is likely to produce.
  463. This is not a guarantee that the sender will never send any higher bandwidth
  464. (e.g. it could send a pre-recorded prompt that uses a higher bandwidth), but it
  465. indicates to the receiver that frequencies above this maximum can safely be discarded.
  466. This parameter is useful to avoid wasting receiver resources by operating the audio
  467. processing pipeline (e.g. echo cancellation) at a higher rate than necessary.
  468. This parameter can take any value between 8000 and 48000, although
  469. commonly the value will match one of the Opus bandwidths
  470. (<xref target="bandwidth_definitions"/>).
  471. By default, the sender is assumed to have no limitations, i.e. 48000.
  472. <vspace blankLines='1'/>
  473. </t>
  474. <t hangText="maxptime:"> the decoder's maximum length of time in
  475. milliseconds rounded up to the next full integer value represented
  476. by the media in a packet that can be
  477. encapsulated in a received packet according to Section 6 of
  478. <xref target="RFC4566"/>. Possible values are 3, 5, 10, 20, 40,
  479. and 60 or an arbitrary multiple of Opus frame sizes rounded up to
  480. the next full integer value up to a maximum value of 120 as
  481. defined in <xref target='opus-rtp-payload-format'/>. If no value is
  482. specified, 120 is assumed as default. This value is a recommendation
  483. by the decoding side to ensure the best
  484. performance for the decoder. The decoder MUST be
  485. capable of accepting any allowed packet sizes to
  486. ensure maximum compatibility.
  487. <vspace blankLines='1'/></t>
  488. <t hangText="ptime:"> the decoder's recommended length of time in
  489. milliseconds rounded up to the next full integer value represented
  490. by the media in a packet according to
  491. Section 6 of <xref target="RFC4566"/>. Possible values are
  492. 3, 5, 10, 20, 40, or 60 or an arbitrary multiple of Opus frame sizes
  493. rounded up to the next full integer value up to a maximum
  494. value of 120 as defined in <xref
  495. target='opus-rtp-payload-format'/>. If no value is
  496. specified, 20 is assumed as default. If ptime is greater than
  497. maxptime, ptime MUST be ignored. This parameter MAY be changed
  498. during a session. This value is a recommendation by the decoding
  499. side to ensure the best
  500. performance for the decoder. The decoder MUST be
  501. capable of accepting any allowed packet sizes to
  502. ensure maximum compatibility.
  503. <vspace blankLines='1'/></t>
  504. <t hangText="minptime:"> the decoder's minimum length of time in
  505. milliseconds rounded up to the next full integer value represented
  506. by the media in a packet that SHOULD
  507. be encapsulated in a received packet according to Section 6 of <xref
  508. target="RFC4566"/>. Possible values are 3, 5, 10, 20, 40, and 60
  509. or an arbitrary multiple of Opus frame sizes rounded up to the next
  510. full integer value up to a maximum value of 120
  511. as defined in <xref target='opus-rtp-payload-format'/>. If no value is
  512. specified, 3 is assumed as default. This value is a recommendation
  513. by the decoding side to ensure the best
  514. performance for the decoder. The decoder MUST be
  515. capable to accept any allowed packet sizes to
  516. ensure maximum compatibility.
  517. <vspace blankLines='1'/></t>
  518. <t hangText="maxaveragebitrate:"> specifies the maximum average
  519. receive bitrate of a session in bits per second (b/s). The actual
  520. value of the bitrate may vary as it is dependent on the
  521. characteristics of the media in a packet. Note that the maximum
  522. average bitrate MAY be modified dynamically during a session. Any
  523. positive integer is allowed but values outside the range between
  524. 6000 and 510000 SHOULD be ignored. If no value is specified, the
  525. maximum value specified in <xref target='bitrate_by_bandwidth'/>
  526. for the corresponding mode of Opus and corresponding maxplaybackrate:
  527. will be the default.<vspace blankLines='1'/></t>
  528. <t hangText="stereo:">
  529. specifies whether the decoder prefers receiving stereo or mono signals.
  530. Possible values are 1 and 0 where 1 specifies that stereo signals are preferred
  531. and 0 specifies that only mono signals are preferred.
  532. Independent of the stereo parameter every receiver MUST be able to receive and
  533. decode stereo signals but sending stereo signals to a receiver that signaled a
  534. preference for mono signals may result in higher than necessary network
  535. utilisation and encoding complexity. If no value is specified, mono
  536. is assumed (stereo=0).<vspace blankLines='1'/>
  537. </t>
  538. <t hangText="sprop-stereo:">
  539. specifies whether the sender is likely to produce stereo audio.
  540. Possible values are 1 and 0 where 1 specifies that stereo signals are likely to
  541. be sent, and 0 speficies that the sender will likely only send mono.
  542. This is not a guarantee that the sender will never send stereo audio
  543. (e.g. it could send a pre-recorded prompt that uses stereo), but it
  544. indicates to the receiver that the received signal can be safely downmixed to mono.
  545. This parameter is useful to avoid wasting receiver resources by operating the audio
  546. processing pipeline (e.g. echo cancellation) in stereo when not necessary.
  547. If no value is specified, mono
  548. is assumed (stereo=0).<vspace blankLines='1'/>
  549. </t>
  550. <t hangText="cbr:">
  551. specifies if the decoder prefers the use of a constant bitrate versus
  552. variable bitrate. Possible values are 1 and 0 where 1 specifies constant
  553. bitrate and 0 specifies variable bitrate. If no value is specified, cbr
  554. is assumed to be 0. Note that the maximum average bitrate may still be
  555. changed, e.g. to adapt to changing network conditions.<vspace blankLines='1'/>
  556. </t>
  557. <t hangText="useinbandfec:"> specifies that Opus in-band FEC is
  558. supported by the decoder and MAY be used during a
  559. session. Possible values are 1 and 0. It is RECOMMENDED to provide
  560. 0 in case FEC is not implemented on the receiving side. If no
  561. value is specified, useinbandfec is assumed to be 1.<vspace blankLines='1'/></t>
  562. <t hangText="usedtx:"> specifies if the decoder prefers the use of
  563. DTX. Possible values are 1 and 0. If no value is specified, usedtx
  564. is assumed to be 0.<vspace blankLines='1'/></t>
  565. </list></t>
  566. <t>Encoding considerations:<vspace blankLines='1'/></t>
  567. <t><list style="hanging">
  568. <t>Opus media type is framed and consists of binary data according
  569. to Section 4.8 in <xref target="RFC4288"/>.</t>
  570. </list></t>
  571. <t>Security considerations: </t>
  572. <t><list style="hanging">
  573. <t>See <xref target='security-considerations'/> of this document.</t>
  574. </list></t>
  575. <t>Interoperability considerations: none<vspace blankLines='1'/></t>
  576. <t>Published specification: none<vspace blankLines='1'/></t>
  577. <t>Applications that use this media type: </t>
  578. <t><list style="hanging">
  579. <t>Any application that requires the transport of
  580. speech or audio data may use this media type. Some examples are,
  581. but not limited to, audio and video conferencing, Voice over IP,
  582. media streaming.</t>
  583. </list></t>
  584. <t>Person & email address to contact for further information:</t>
  585. <t><list style="hanging">
  586. <t>SILK Support silksupport@skype.net</t>
  587. <t>Jean-Marc Valin jmvalin@jmvalin.ca</t>
  588. </list></t>
  589. <t>Intended usage: COMMON<vspace blankLines='1'/></t>
  590. <t>Restrictions on usage:<vspace blankLines='1'/></t>
  591. <t><list style="hanging">
  592. <t>For transfer over RTP, the RTP payload format (<xref
  593. target='opus-rtp-payload-format'/> of this document) SHALL be
  594. used.</t>
  595. </list></t>
  596. <t>Author:</t>
  597. <t><list style="hanging">
  598. <t>Julian Spittka julian.spittka@skype.net<vspace blankLines='1'/></t>
  599. <t>Koen Vos koen.vos@skype.net<vspace blankLines='1'/></t>
  600. <t>Jean-Marc Valin jmvalin@jmvalin.ca<vspace blankLines='1'/></t>
  601. </list></t>
  602. <t> Change controller: TBD</t>
  603. </section>
  604. <section title='Mapping to SDP Parameters'>
  605. <t>The information described in the media type specification has a
  606. specific mapping to fields in the Session Description Protocol (SDP)
  607. <xref target="RFC4566"/>, which is commonly used to describe RTP
  608. sessions. When SDP is used to specify sessions employing the Opus codec,
  609. the mapping is as follows:</t>
  610. <t>
  611. <list style="symbols">
  612. <t>The media type ("audio") goes in SDP "m=" as the media name.</t>
  613. <t>The media subtype ("opus") goes in SDP "a=rtpmap" as the encoding
  614. name. The RTP clock rate in "a=rtpmap" MUST be 48000 and the number of
  615. channels MUST be 2.</t>
  616. <t>The optional media type parameters "ptime" and "maxptime" are
  617. mapped to "a=ptime" and "a=maxptime" attributes, respectively, in the
  618. SDP.</t>
  619. <t>All remaining media type parameters are mapped to the "a=fmtp"
  620. attribute in the SDP by copying them directly from the media type
  621. parameter string as a semicolon-separated list of parameter=value
  622. pairs (e.g. maxaveragebitrate=20000).</t>
  623. </list>
  624. </t>
  625. <t>Below are some examples of SDP session descriptions for Opus:</t>
  626. <t>Example 1: Standard session with 48000 Hz clock rate</t>
  627. <figure>
  628. <artwork>
  629. <![CDATA[
  630. m=audio 54312 RTP/AVP 101
  631. a=rtpmap:101 opus/48000/2
  632. ]]>
  633. </artwork>
  634. </figure>
  635. <t>Example 2: 16000 Hz clock rate, maximum packet size of 40 ms,
  636. recommended packet size of 40 ms, maximum average bitrate of 20000 bps,
  637. stereo signals are preferred, FEC is allowed, DTX is not allowed</t>
  638. <figure>
  639. <artwork>
  640. <![CDATA[
  641. m=audio 54312 RTP/AVP 101
  642. a=rtpmap:101 opus/48000/2
  643. a=fmtp:101 maxplaybackrate=16000; maxaveragebitrate=20000;
  644. stereo=1; useinbandfec=1; usedtx=0
  645. a=ptime:40
  646. a=maxptime:40
  647. ]]>
  648. </artwork>
  649. </figure>
  650. <section title='Offer-Answer Model Considerations for Opus'>
  651. <t>When using the offer-answer procedure described in <xref
  652. target="RFC3264"/> to negotiate the use of Opus, the following
  653. considerations apply:</t>
  654. <t><list style="symbols">
  655. <t>Opus supports several clock rates. For signaling purposes only
  656. the highest, i.e. 48000, is used. The actual clock rate of the
  657. corresponding media is signaled inside the payload and is not
  658. subject to this payload format description. The decoder MUST be
  659. capable to decode every received clock rate. An example
  660. is shown below:
  661. <figure>
  662. <artwork>
  663. <![CDATA[
  664. m=audio 54312 RTP/AVP 100
  665. a=rtpmap:100 opus/48000/2
  666. ]]>
  667. </artwork>
  668. </figure>
  669. </t>
  670. <t>The parameters "ptime" and "maxptime" are unidirectional
  671. receive-only parameters and typically will not compromise
  672. interoperability; however, dependent on the set values of the
  673. parameters the performance of the application may suffer. <xref
  674. target="RFC3264"/> defines the SDP offer-answer handling of the
  675. "ptime" parameter. The "maxptime" parameter MUST be handled in the
  676. same way.</t>
  677. <t>
  678. The parameter "minptime" is a unidirectional
  679. receive-only parameters and typically will not compromise
  680. interoperability; however, dependent on the set values of the
  681. parameter the performance of the application may suffer and should be
  682. set with care.
  683. </t>
  684. <t>
  685. The parameter "maxplaybackrate" is a unidirectional receive-only
  686. parameter that reflects limitations of the local receiver. The sender
  687. of the other side SHOULD NOT send with an audio bandwidth higher than
  688. "maxplaybackrate" as this would lead to inefficient use of network resources.
  689. The "maxplaybackrate" parameter does not
  690. affect interoperability. Also, this parameter SHOULD NOT be used
  691. to adjust the audio bandwidth as a function of the bitrates, as this
  692. is the responsibility of the Opus encoder implementation.
  693. </t>
  694. <t>The parameter "maxaveragebitrate" is a unidirectional receive-only
  695. parameter that reflects limitations of the local receiver. The sender
  696. of the other side MUST NOT send with an average bitrate higher than
  697. "maxaveragebitrate" as it might overload the network and/or
  698. receiver. The parameter "maxaveragebitrate" typically will not
  699. compromise interoperability; however, dependent on the set value of
  700. the parameter the performance of the application may suffer and should
  701. be set with care.</t>
  702. <t>If the parameter "maxaveragebitrate" is below the range specified
  703. in <xref target='bitrate_by_bandwidth'/> the session MUST be rejected.</t>
  704. <t>
  705. The "stereo" parameter is a unidirectional receive-only
  706. parameter.
  707. </t>
  708. <t>
  709. The "cbr" parameter is a unidirectional receive-only
  710. parameter.
  711. </t>
  712. <t>The "useinbandfec" parameter is a unidirectional receive-only
  713. parameter.</t>
  714. <t>The "usedtx" parameter is a unidirectional receive-only
  715. parameter.</t>
  716. <t>Any unknown parameter in an offer MUST be ignored by the receiver
  717. and MUST be removed from the answer.</t>
  718. </list></t>
  719. </section>
  720. <section title='Declarative SDP Considerations for Opus'>
  721. <t>For declarative use of SDP such as in Session Announcement Protocol
  722. (SAP), <xref target="RFC2974"/>, and RTSP, <xref target="RFC2326"/>, for
  723. Opus, the following needs to be considered:</t>
  724. <t><list style="symbols">
  725. <t>The values for "maxptime", "ptime", "minptime", "maxplaybackrate", and
  726. "maxaveragebitrate" should be selected carefully to ensure that a
  727. reasonable performance can be achieved for the participants of a session.</t>
  728. <t>
  729. The values for "maxptime", "ptime", and "minptime" of the payload
  730. format configuration are recommendations by the decoding side to ensure
  731. the best performance for the decoder. The decoder MUST be
  732. capable to accept any allowed packet sizes to
  733. ensure maximum compatibility.
  734. </t>
  735. <t>All other parameters of the payload format configuration are declarative
  736. and a participant MUST use the configurations that are provided for
  737. the session. More than one configuration may be provided if necessary
  738. by declaring multiple RTP payload types; however, the number of types
  739. should be kept small.</t>
  740. </list></t>
  741. </section>
  742. </section>
  743. </section>
  744. <section title='Security Considerations' anchor='security-considerations'>
  745. <t>All RTP packets using the payload format defined in this specification
  746. are subject to the general security considerations discussed in the RTP
  747. specification <xref target="RFC3550"/> and any profile from
  748. e.g. <xref target="RFC3711"/> or <xref target="RFC3551"/>.</t>
  749. <t>This payload format transports Opus encoded speech or audio data,
  750. hence, security issues include confidentiality, integrity protection, and
  751. authentication of the speech or audio itself. The Opus payload format does
  752. not have any built-in security mechanisms. Any suitable external
  753. mechanisms, such as SRTP <xref target="RFC3711"/>, MAY be used.</t>
  754. <t>This payload format and the Opus encoding do not exhibit any
  755. significant non-uniformity in the receiver-end computational load and thus
  756. are unlikely to pose a denial-of-service threat due to the receipt of
  757. pathological datagrams.</t>
  758. </section>
  759. <section title='Acknowledgements'>
  760. <t>TBD</t>
  761. </section>
  762. </middle>
  763. <back>
  764. <references title="Normative References">
  765. &rfc2119;
  766. &rfc3550;
  767. &rfc3711;
  768. &rfc3551;
  769. &rfc4288;
  770. &rfc4855;
  771. &rfc4566;
  772. &rfc3264;
  773. &rfc2974;
  774. &rfc2326;
  775. &rfc6562;
  776. </references>
  777. <section title='Informational References'>
  778. <t><list style="hanging">
  779. <t>[codec] http://datatracker.ietf.org/wg/codec/</t>
  780. <t>[Opus] http://datatracker.ietf.org/doc/draft-ietf-codec-opus/</t>
  781. </list></t>
  782. </section>
  783. </back>
  784. </rfc>