<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type='text/xsl' href='xep.xsl'?>
<xep xmlns="">
<header>
  <title>Codecs for Jingle Audio</title>
  <abstract>This document describes implementation considerations related to audio codecs for use in Jingle RTP sessions.</abstract>
  
<legal>
<copyright>This XMPP Extension Protocol is copyright © 1999 – 2024 by the <link url="https://xmpp.org/">XMPP Standards Foundation</link> (XSF).</copyright>
<permissions>Permission is hereby granted, free of charge, to any person obtaining a copy of this specification (the "Specification"), to make use of the Specification without restriction, including without limitation the rights to implement the Specification in a software program, deploy the Specification in a network service, and copy, modify, merge, publish, translate, distribute, sublicense, or sell copies of the Specification, and to permit persons to whom the Specification is furnished to do so, subject to the condition that the foregoing copyright notice and this permission notice shall be included in all copies or substantial portions of the Specification. Unless separate permission is granted, modified works that are redistributed shall not contain misleading information regarding the authors, title, number, or publisher of the Specification, and shall not claim endorsement of the modified works by the authors, any organization or project to which the authors belong, or the XMPP Standards Foundation.</permissions>
<warranty>## NOTE WELL: This Specification is provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. ##</warranty>
<liability>In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall the XMPP Standards Foundation or any author of this Specification be liable for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising from, out of, or in connection with the Specification or the implementation, deployment, or other use of the Specification (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if the XMPP Standards Foundation or such author has been advised of the possibility of such damages.</liability>
<conformance>This XMPP Extension Protocol has been contributed in full conformance with the XSF's Intellectual Property Rights Policy (a copy of which can be found at &lt;<link url="https://xmpp.org/about/xsf/ipr-policy">https://xmpp.org/about/xsf/ipr-policy</link>&gt; or obtained by writing to XMPP Standards Foundation, P.O. Box 787, Parker, CO 80134 USA).</conformance>
</legal>
  <number>0266</number>
  <status>Draft</status>
  <interim/>
  <type>Standards Track</type>
  <sig>Standards</sig>
  <approver>Council</approver>
  <dependencies>
    <spec>XMPP Core</spec>
    <spec>XEP-0167</spec>
  </dependencies>
  <supersedes/>
  <supersededby/>
  <shortname>N/A</shortname>
  <discuss>jingle</discuss>
  
  <author>
    <firstname>Peter</firstname>
    <surname>Saint-Andre</surname>
    <email>stpeter@stpeter.im</email>
    <jid>stpeter@jabber.org</jid>
    <uri>https://stpeter.im/</uri>
  </author>

  <revision>
    <version>1.1.0-rc.1</version>
    <date>2013-03-01</date>
    <initials>psa</initials>
    <remark><p>Updated to reflect standardization of the Opus codec; changed client conformance to also recommend (but not require) support for Opus.</p></remark>
  </revision>
  <revision>
    <version>1.0</version>
    <date>2011-10-04</date>
    <initials>psa</initials>
    <remark><p>Per a vote of the XMPP Council, advanced specification from Experimental to Draft.</p></remark>
  </revision>
  <revision>
    <version>0.6</version>
    <date>2011-06-27</date>
    <initials>psa</initials>
    <remark><p>Clarified that the codec descriptions are non-normative.</p></remark>
  </revision>
  <revision>
    <version>0.5</version>
    <date>2011-06-12</date>
    <initials>psa</initials>
    <remark><p>Moved video codecs to XEP-0299.</p></remark>
  </revision>
  <revision>
    <version>0.4</version>
    <date>2011-06-09</date>
    <initials>psa</initials>
    <remark><p>Recommended G.711 as mandatory-to-implement for audio.</p></remark>
  </revision>
  <revision>
    <version>0.3</version>
    <date>2011-01-12</date>
    <initials>psa</initials>
    <remark><p>Added information about the Opus audio codec.</p></remark>
  </revision>
  <revision>
    <version>0.2</version>
    <date>2009-04-23</date>
    <initials>psa</initials>
    <remark><p>Added information about the Dirac video codec.</p></remark>
  </revision>
  <revision>
    <version>0.1</version>
    <date>2009-04-08</date>
    <initials>psa</initials>
    <remark><p>Initial published version.</p></remark>
  </revision>
  <revision>
    <version>0.0.4</version>
    <date>2009-04-04</date>
    <initials>psa</initials>
    <remark><p>Clarified status of H.264.</p></remark>
  </revision>
  <revision>
    <version>0.0.3</version>
    <date>2009-04-02</date>
    <initials>psa</initials>
    <remark><p>Rewrote document based on developer feedback and Council discussion.</p></remark>
  </revision>
  <revision>
    <version>0.0.2</version>
    <date>2009-03-04</date>
    <initials>psa</initials>
    <remark><p>Added more information about video codecs.</p></remark>
  </revision>
  <revision>
    <version>0.0.1</version>
    <date>2009-03-04</date>
    <initials>psa</initials>
    <remark><p>First draft, copied from XEP-0167 with slight revisions and addition of requirements section.</p></remark>
  </revision>
</header>

<section1 topic="Introduction" anchor="intro">
  <p><span class="ref"><link url="https://xmpp.org/extensions/xep-0167.html">Jingle RTP Sessions (XEP-0167)</link></span> <note>XEP-0167: Jingle RTP Sessions &lt;<link url="https://xmpp.org/extensions/xep-0167.html">https://xmpp.org/extensions/xep-0167.html</link>&gt;.</note> defines the <span class="ref"><link url="https://xmpp.org/extensions/xep-0166.html">Jingle (XEP-0166)</link></span> <note>XEP-0166: Jingle &lt;<link url="https://xmpp.org/extensions/xep-0166.html">https://xmpp.org/extensions/xep-0166.html</link>&gt;.</note> signalling exchanges needed to establish voice chat and other audio sessions using the Real-time Transport Protocol <span class="ref"><link url="http://tools.ietf.org/html/rfc3550">RFC 3550</link></span> <note>RFC 3550: RTP: A Transport Protocol for Real-Time Applications &lt;<link url="http://tools.ietf.org/html/rfc3550">http://tools.ietf.org/html/rfc3550</link>&gt;.</note>; however, it does not specify which audio codecs are mandatory-to-implement, since the state of codec technologies is more fluid than the signalling interactions. This document fills that gap by providing guidance to Jingle developers regarding audio codecs.</p>
  <p>Because codec technologies are typically subject to patents, the topics discussed here are controversial. This document attempts to steer a middle path between (1) specifying mandatory-to-implement technologies that realistically will not be implemented and deployed and (2) providing guidelines that, while realistic, do not encourage the implementation and deployment of patent-clear technologies.</p>
</section1>

<section1 topic="Basic Considerations" anchor="basics">
  <p>The ideal audio codec would meet the following criteria:</p>
  <dl>
    <di><dt>Quality</dt><dd>The encoding quality is acceptable for deployment among XMPP users.</dd></di>
    <di><dt>Packetization</dt><dd>The specification of the codec clearly defines packetization of data for sending over RTP.</dd></di>
    <di><dt>Availability</dt><dd>The codec can be implemented on a wide variety of computing platforms and is commonly used in Internet or other systems.</dd></di>
    <di><dt>Patents</dt><dd>The codec is patent-clear. <note>The term patent-clear does not necessarily mean that no patents have ever been applied for or granted regarding a technology, or that the technology is completely free from patents (since such a judgment is nearly impossible to make, and is outside the purview of the XMPP developer community and the XMPP Standards Foundation); the term means only that those who implement the technology are generally understood to be relatively safe from the threat of patent litigation, either because any relevant patents have expired, were filed in a defensive manner, or are made available under suitable royalty-free licenses.</note> (Although most XMPP developers would prefer to implement codecs that are patent-clear, such options are not always widely implemented and deployed.)</dd></di>
  </dl>
  <p>Unfortunately, not all codecs meet those criteria. In the remainder of this document we discuss the audio codecs that are most appropriate for implementation in Jingle RTP applications.</p>
</section1>

<section1 topic="Codecs" anchor="codecs">
  <p>This section is non-normative. Future versions of this specification might provide information about additional codecs not listed here.</p>
  <section2 topic="G.711" anchor="codecs-g711">
    <p>G.711 refers to the Pulse Code Modulation (PCM) codec defined in <span class="ref"><link url="http://www.itu.int/">International Telecommunication Union (ITU)</link></span> <note>The International Telecommunication Union develops technical and operating standards (such as H.323) for international telecommunication services. For further information, see &lt;<link url="http://www.itu.int/">http://www.itu.int/</link>&gt;.</note> recommendation G.711, which is widely used on the public switched telephone network (PSTN) and by many voice over Internet Protocol (VoIP) providers. There are two versions: the μ-law ("U-law") version is widely deployed in North America and in Japan, whereas the A-law version is widely deployed in the rest of the world. The following table summarizes the available information about G.711.</p>
    <table caption="Codec Considerations for G.711">
      <tr>
        <th>Quality</th>
        <th>Packetization</th>
        <th>Availability</th>
        <th>Patents</th>
      </tr>
      <tr>
        <td>Good quality; no wide-band mode.</td>
        <td>See <span class="ref"><link url="http://tools.ietf.org/html/rfc5391">RFC 5391</link></span> <note>RFC 5391: RTP Payload Format for ITU-T Recommendation G.711.1 &lt;<link url="http://tools.ietf.org/html/rfc5391">http://tools.ietf.org/html/rfc5391</link>&gt;.</note>.</td>
        <td>Commonly deployed in both PSTN and VoIP systems.</td>
        <td>Developed in 1972; patents have expired.</td>
      </tr>
    </table>
  </section2>
  <section2 topic="Opus" anchor="codecs-opus">
    <p>The Opus codec was developed within the IETF's <link url="http://tools.ietf.org/wg/codec/">Codec Working Group</link> and has been published as <span class="ref"><link url="http://tools.ietf.org/html/rfc6716">RFC 6716</link></span> <note>RFC 6716: Definition of the Opus Audio Codec &lt;<link url="http://tools.ietf.org/html/rfc6716">http://tools.ietf.org/html/rfc6716</link>&gt;.</note>. In essence it combines the best features of CELT (developed by Jean-Marc Valin, the creator of Speex) and SILK (created by and widely used in the Skype service). The following table summarizes the available information about Opus.</p>
    <table caption="Codec Considerations for Opus">
      <tr>
        <th>Quality</th>
        <th>Packetization</th>
        <th>Availability</th>
        <th>Patents</th>
      </tr>
      <tr>
        <td>Extremely high quality; can be used for wide-band audio; very robust in the face of packet loss.</td>
        <td>See <span class="ref"><link url="http://tools.ietf.org/html/draft-ietf-payload-rtp-opus">RTP Payload Format and File Storage Format for Opus Speech and Audio Codec</link></span> <note>RTP Payload Format and File Storage Format for Opus Speech and Audio Codec &lt;<link url="http://tools.ietf.org/html/draft-ietf-payload-rtp-opus">http://tools.ietf.org/html/draft-ietf-payload-rtp-opus</link>&gt;. Work in progress.</note>.</td>
        <td>In accordance with IETF IPR rules, the codec is covered under a simplified BSD license. See RFC 6716 for details. Starting to be more commonly deployed, and the SILK codec on which it is partly based is very widely deployed.</td>
        <td>Designed to be patent-clear, although IPR claims have been filed.</td>
      </tr>
    </table>
  </section2>
  <section2 topic="Speex" anchor="codecs-speex">
    <p>According to the speex.org website, the Speex codec is "an Open Source/Free Software  patent-free audio compression format designed for speech". Speex was developed by Jean-Marc Valin and is maintained by the <link url="http://www.xiph.org/">Xiph.org Foundation</link>. The following table summarizes the available information about Speex.</p>
    <table caption="Codec Considerations for Speex">
      <tr>
        <th>Quality</th>
        <th>Packetization</th>
          <th>Availability</th>
        <th>Patents</th>
      </tr>
      <tr>
        <td>Good quality; optimized for voice; can be used for wide-band audio.</td>
        <td>See <span class="ref"><link url="http://tools.ietf.org/html/rfc5574">RFC 5574</link></span> <note>RFC 5574: RTP Payload Format for the Speex Codec &lt;<link url="http://tools.ietf.org/html/rfc5574">http://tools.ietf.org/html/rfc5574</link>&gt;.</note>.</td>
        <td>Freely downloadable under a revised BSD license at &lt;<link url="http://speex.org/">http://speex.org/</link>&gt; and commonly deployed on Internet (VoIP) systems; not commonly deployed on non-Internet systems.</td>
        <td>Designed to be patent-clear.</td>
      </tr>
    </table>
  </section2>
</section1>

<section1 topic="Guidance for Implementers" anchor="impl">
  <p>This section is non-normative.</p>
  <p>Given that Opus and G.711 are patent-clear, freely implementable, and commonly deployed, implementers are encouraged to consider including support for both codecs in audio applications of Jingle RTP sessions. Discussion on the jingle@xmpp.org mailing list indicates a slight preference for G.711 because it is easily available and so widely deployed (e.g., in SIP networks and the PSTN). Opus has effectively superseded Speex, and implementers are strongly encouraged to include support for Opus rather than Speex among the "open" codecs.</p>
</section1>

<section1 topic="Mandatory-to-Implement Codecs" anchor="mti">
  <p>As of January 2013, this document makes the following recommendations:</p>
  <ol>
    <li>Jingle clients MUST implement G.711 (i.e., both PCMU and PCMA) and SHOULD implement Opus.</li>
    <li>Gateways between Jingle networks and other networks (e.g., SIP networks and the PSTN) MUST implement either PCMU or PCMA (and preferably both).</li>
  </ol>
  <p>Naturally, clients and gateways can implement additional codecs, such as those listed in this document.</p>
</section1>

<section1 topic="Security Considerations" anchor="security">
  <p>For security considerations related to Jingle RTP sessions, refer to <span class="ref"><link url="https://xmpp.org/extensions/xep-0167.html">Jingle RTP Sessions (XEP-0167)</link></span> <note>XEP-0167: Jingle RTP Sessions &lt;<link url="https://xmpp.org/extensions/xep-0167.html">https://xmpp.org/extensions/xep-0167.html</link>&gt;.</note>. This document introduces no new security considerations. See also the security considerations described in the relevant codec specifications.</p>
</section1>

<section1 topic="IANA Considerations" anchor="iana">
  <p>This document requires no interaction with the <span class="ref"><link url="http://www.iana.org/">Internet Assigned Numbers Authority (IANA)</link></span> <note>The Internet Assigned Numbers Authority (IANA) is the central coordinator for the assignment of unique parameter values for Internet protocols, such as port numbers and URI schemes. For further information, see &lt;<link url="http://www.iana.org/">http://www.iana.org/</link>&gt;.</note>.</p>
</section1>

<section1 topic="XMPP Registrar Considerations" anchor="registrar">
  <p>This document requires no interaction with the <span class="ref"><link url="https://xmpp.org/registrar/">XMPP Registrar</link></span> <note>The XMPP Registrar maintains a list of reserved protocol namespaces as well as registries of parameters used in the context of XMPP extension protocols approved by the XMPP Standards Foundation. For further information, see &lt;<link url="https://xmpp.org/registrar/">https://xmpp.org/registrar/</link>&gt;.</note>.</p>
</section1>

<section1 topic="Acknowledgements" anchor="ack">
  <p>Thanks to Olivier Crête, Dave Cridland, Florian Jensen, Justin Karneges, Evgeniy Khramtsov, Marcus Lundblad, Tobias Markmann, Jean-Marc Valin, Pedro Melo, Jack Moffitt, Jeff Muller, Jehan Pagès, Arc Riley, Kevin Smith, Remko Tronçon, Justin Uberti, and Paul Witty for their feedback.</p>
</section1>
</xep>
