draft-herlein-speex-rtp-profile-03.xml 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815
  1. <?xml version='1.0'?>
  2. <!DOCTYPE rfc SYSTEM 'rfc2629.dtd'>
  3. <?rfc toc="yes" ?>
  4. <rfc ipr="full3667" docName="RTP Payload Format for the Speex Codec">
  5. <front>
  6. <title>draft-herlein-speex-rtp-profile-03</title>
  7. <author initials="G" surname="Herlein" fullname="Greg Herlein">
  8. <organization></organization>
  9. <address>
  10. <email>gherlein@herlein.com</email>
  11. <postal>
  12. <street>2034 Filbert Street</street>
  13. <city>San Francisco</city>
  14. <region>California</region>
  15. <code>94123</code>
  16. <country>United States</country>
  17. </postal>
  18. </address>
  19. </author>
  20. <author initials="S" surname="Morlat" fullname="Simon Morlat">
  21. <address>
  22. <email>simon.morlat@linphone.org</email>
  23. <postal>
  24. <street>35, av de Vizille App 42</street>
  25. <city>Grenoble</city>
  26. <code>38000</code>
  27. <country>France</country>
  28. </postal>
  29. </address>
  30. </author>
  31. <author initials="J" surname="Jean-Marc" fullname="Jean-Marc Valin">
  32. <address>
  33. <email>jean-marc.valin@hermes.usherb.ca</email>
  34. <postal>
  35. <street>Department of Electrical and Computer Engineering</street>
  36. <street>University of Sherbrooke</street>
  37. <street>2500 blvd Universite</street>
  38. <city>Sherbrooke</city>
  39. <region>Quebec</region>
  40. <code>J1K 2R1</code>
  41. <country>Canada</country>
  42. </postal>
  43. </address>
  44. </author>
  45. <author initials="R" surname="Hardiman" fullname="Roger Hardiman">
  46. <address>
  47. <email>roger@freebsd.org</email>
  48. <postal>
  49. <street>49 Nettleton Road</street>
  50. <city>Cheltenham</city>
  51. <region>Gloucestershire</region>
  52. <code>GL51 6NR</code>
  53. <country>England</country>
  54. </postal>
  55. </address>
  56. </author>
  57. <author initials="P" surname="Kerr" fullname="Phil Kerr">
  58. <address>
  59. <email>phil@plus24.com</email>
  60. <postal>
  61. <country>England</country>
  62. </postal>
  63. </address>
  64. </author>
  65. <date day="01" month="January" year="2005" />
  66. <area>General</area>
  67. <workgroup>AVT Working Group</workgroup>
  68. <keyword>I-D</keyword>
  69. <keyword>Internet-Draft</keyword>
  70. <keyword>Speex</keyword>
  71. <keyword>RTP</keyword>
  72. <abstract>
  73. <t>
  74. Speex is an open-source voice codec suitable for use in Voice over
  75. IP (VoIP) type applications. This document describes the payload
  76. format for Speex generated bit streams within an RTP packet. Also
  77. included here are the necessary details for the use of Speex with
  78. the Session Description Protocol (SDP) and a preliminary method of
  79. using Speex within H.323 applications.
  80. </t>
  81. </abstract>
  82. </front>
  83. <middle>
  84. <section anchor="Conventions used in this document" title="Conventions used in this document">
  85. <t>
  86. The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
  87. "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
  88. document are to be interpreted as described in RFC 2119 <xref target="rfc2119"></xref>.
  89. </t>
  90. </section>
  91. <section anchor="Overview of the Speex Codec" title="Overview of the Speex Codec">
  92. <t>
  93. Speex is based on the CELP <xref target="CELP"></xref> encoding technique with support for
  94. either narrowband (nominal 8kHz), wideband (nominal 16kHz) or
  95. ultra-wideband (nominal 32kHz), and (non-optimal) rates up to 48 kHz
  96. sampling also available. The main characteristics can be summarized
  97. as follows:
  98. </t>
  99. <t>
  100. <list style="symbols">
  101. <t>Free software/open-source</t>
  102. <t>Integration of wideband and narrowband in the same bit-stream</t>
  103. <t>Wide range of bit-rates available</t>
  104. <t>Dynamic bit-rate switching and variable bit-rate (VBR)</t>
  105. <t>Voice Activity Detection (VAD, integrated with VBR)</t>
  106. <t>Variable complexity</t>
  107. </list>
  108. </t>
  109. </section>
  110. <section anchor="RTP payload format for Speex" title="RTP payload format for Speex">
  111. <t>
  112. For RTP based transportation of Speex encoded audio the standard
  113. RTP header [2] is followed by one or more payload data blocks.
  114. An optional padding terminator may also be used.
  115. </t>
  116. <artwork><![CDATA[
  117. 0 1 2 3
  118. 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  119. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  120. | RTP Header |
  121. +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
  122. | one or more frames of Speex .... |
  123. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  124. | one or more frames of Speex .... | padding |
  125. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  126. ]]></artwork>
  127. </section>
  128. <section anchor="RTP Header" title="RTP Header">
  129. <artwork><![CDATA[
  130. 0 1 2 3
  131. 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  132. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  133. |V=2|P|X| CC |M| PT | sequence number |
  134. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  135. | timestamp |
  136. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  137. | synchronization source (SSRC) identifier |
  138. +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
  139. | contributing source (CSRC) identifiers |
  140. | ... |
  141. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  142. ]]></artwork>
  143. <t>
  144. The RTP header begins with an octet of fields (V, P, X, and CC) to
  145. support specialized RTP uses (see <xref target="rfc3550"></xref> and <xref target="rfc3551"></xref> for details). For
  146. Speex the following values are used.
  147. </t>
  148. <t>Version (V): 2 bits</t><t>
  149. This field identifies the version of RTP. The version
  150. used by this specification is two <xref target="rfc3550"></xref>.
  151. </t>
  152. <t>Padding (P): 1 bit</t><t>
  153. If the padding bit is set, the packet contains one or more
  154. additional padding octets at the end which are not part of
  155. the payload. P is set if the total packet size is less than
  156. the MTU.
  157. </t>
  158. <t>Extension (X): 1 bit</t><t>
  159. If the extension, X, bit is set, the fixed header MUST be
  160. followed by exactly one header extension, with a format defined
  161. in Section 5.3.1. of <xref target="rfc3550"></xref>.
  162. </t>
  163. <t>CSRC count (CC): 4 bits</t><t>
  164. The CSRC count contains the number of CSRC identifiers.
  165. </t>
  166. <t>Marker (M): 1 bit</t><t>
  167. The M bit indicates if the packet contains comfort noise. This
  168. field is used in conjunction with the cng SDP attribute and is
  169. detailed further in section 5 below. In normal usage this bit
  170. is set if the packet contains comfort noise.
  171. </t>
  172. <t>Payload Type (PT): 7 bits</t><t>
  173. An RTP profile for a class of applications is expected to assign
  174. a payload type for this format, or a dynamically allocated
  175. payload type SHOULD be chosen which designates the payload as
  176. Speex.
  177. </t>
  178. <t>Sequence number: 16 bits</t><t>
  179. The sequence number increments by one for each RTP data packet
  180. sent, and may be used by the receiver to detect packet loss and
  181. to restore packet sequence. This field is detailed further in
  182. <xref target="rfc3550"></xref>.
  183. </t>
  184. <t>Timestamp: 32 bits</t><t>
  185. A timestamp representing the sampling time of the first sample of
  186. the first Speex packet in the RTP packet. The clock frequency
  187. MUST be set to the sample rate of the encoded audio data.
  188. Speex uses 20 msec frames and a variable sampling rate clock.
  189. The RTP timestamp MUST be in units of 1/X of a second where X
  190. is the sample rate used. Speex uses a nominal 8kHz sampling rate
  191. for narrowband use, a nominal 16kHz sampling rate for wideband use,
  192. and a nominal 32kHz sampling rate for ultra-wideband use.
  193. </t>
  194. <t>SSRC/CSRC identifiers:</t><t>
  195. These two fields, 32 bits each with one SSRC field and a maximum
  196. of 16 CSRC fields, are as defined in <xref target="rfc3550"></xref>.
  197. </t>
  198. </section>
  199. <section anchor="Speex payload" title="Speex payload">
  200. <t>
  201. For the purposes of packetizing the bit stream in RTP, it is only
  202. necessary to consider the sequence of bits as output by the Speex
  203. encoder <xref target="speexenc"></xref>, and present the same sequence to the decoder. The
  204. payload format described here maintains this sequence.
  205. </t>
  206. <t>
  207. A typical Speex frame, encoded at the maximum bitrate, is approx.
  208. 110 octets and the total number of Speex frames SHOULD be kept
  209. less than the path MTU to prevent fragmentation. Speex frames MUST
  210. NOT be fragmented across multiple RTP packets,
  211. </t>
  212. <t>
  213. An RTP packet MAY contain Speex frames of the same bit rate or of
  214. varying bit rates, since the bit-rate for a frame is conveyed in
  215. band with the signal.
  216. </t>
  217. <t>
  218. The encoding and decoding algorithm can change the bit rate at any
  219. 20 msec frame boundary, with the bit rate change notification provided
  220. in-band with the bit stream. Each frame contains both "mode"
  221. (narrowband, wideband or ultra-wideband) and "sub-mode" (bit-rate)
  222. information in the bit stream. No out-of-band notification is
  223. required for the decoder to process changes in the bit rate sent
  224. by the encoder.
  225. </t>
  226. <t>
  227. It is RECOMMENDED that values of 8000, 16000 and 32000 be used
  228. for normal internet telephony applications, though the sample
  229. rate is supported at rates as low as 6000 Hz and as high as
  230. 48 kHz.
  231. </t>
  232. <t>
  233. The RTP payload MUST be padded to provide an integer number of
  234. octets as the payload length. These padding bits are LSB aligned
  235. in network octet order and consist of a 0 followed by all ones
  236. (until the end of the octet). This padding is only required for
  237. the last frame in the packet, and only to ensure the packet
  238. contents ends on an octet boundary.
  239. </t>
  240. </section>
  241. <section anchor="Example Speex packet" title="Example Speex packet">
  242. <t>
  243. In the example below we have a single Speex frame with 5 bits
  244. of padding to ensure the packet size falls on an octet boundary.
  245. </t>
  246. <artwork><![CDATA[
  247. 0 1 2 3
  248. 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  249. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  250. |V=2|P|X| CC |M| PT | sequence number |
  251. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  252. | timestamp |
  253. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  254. | synchronization source (SSRC) identifier |
  255. +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
  256. 0 1 2 3
  257. 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  258. +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
  259. | contributing source (CSRC) identifiers |
  260. | ... |
  261. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  262. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  263. | ..speex data.. |
  264. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  265. | ..speex data.. |0 1 1 1 1|
  266. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  267. ]]></artwork>
  268. </section>
  269. <section anchor="Multiple Speex frames in a RTP packet" title="Multiple Speex frames in a RTP packet">
  270. <t>
  271. Below is an example of two Speex frames contained within one RTP
  272. packet. The Speex frame length in this example fall on an octet
  273. boundary so there is no padding.
  274. </t>
  275. <t>
  276. Speex codecs <xref target="speexenc"></xref> are able to detect the the bitrate from the
  277. payload and are responsible for detecting the 20 msec boundaries
  278. between each frame.
  279. </t>
  280. <artwork><![CDATA[
  281. 0 1 2 3
  282. 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  283. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  284. |V=2|P|X| CC |M| PT | sequence number |
  285. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  286. | timestamp |
  287. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  288. | synchronization source (SSRC) identifier |
  289. +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
  290. | contributing source (CSRC) identifiers |
  291. | ... |
  292. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  293. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  294. | ..speex data.. |
  295. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  296. | ..speex data.. | ..speex data.. |
  297. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  298. | ..speex data.. |
  299. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  300. ]]></artwork>
  301. </section>
  302. <section anchor="MIME registration of Speex" title="MIME registration of Speex">
  303. <t>
  304. Full definition of the MIME <xref target="rfc2045"></xref> type for Speex will be part of the Ogg
  305. Vorbis MIME type definition application <xref target="rfc3534"></xref>.
  306. </t>
  307. <t>MIME media type name: audio</t>
  308. <t>MIME subtype: speex</t>
  309. <t>Optional parameters:</t>
  310. <t>Required parameters: to be included in the Ogg MIME specification.</t>
  311. <t>Encoding considerations:</t>
  312. <t>Security Considerations:</t>
  313. <t>See Section 6 of RFC 3047.</t>
  314. <t>Interoperability considerations: none</t>
  315. <t>Published specification: </t>
  316. <t>Applications which use this media type:</t>
  317. <t>Additional information: none</t>
  318. <t>Person &amp; email address to contact for further information:<vspace blankLines="1" />
  319. <list style="empty">
  320. <t>Greg Herlein &lt;gherlein@herlein.com&gt;</t>
  321. <t>Jean-Marc Valin &lt;jean-marc.valin@hermes.usherb.ca&gt;</t>
  322. </list>
  323. </t>
  324. <t>Intended usage: COMMON</t>
  325. <t>Author/Change controller:</t>
  326. <t>
  327. <list style="empty">
  328. <t>Author: Greg Herlein &lt;gherlein@herlein.com&gt;</t>
  329. <t>Change controller: Greg Herlein &lt;gherlein@herlein.com&gt;</t>
  330. <t>Change controller: IETF AVT Working Group</t>
  331. </list>
  332. </t>
  333. <t>
  334. This transport type signifies that the content is to be interpreted
  335. according to this document if the contents are transmitted over RTP.
  336. Should this transport type appear over a lossless streaming protocol
  337. such as TCP, the content encapsulation should be interpreted as an
  338. Ogg Stream in accordance with <xref target="rfc3534"></xref>, with the exception that the
  339. content of the Ogg Stream may be assumed to be Speex audio and
  340. Speex audio only.
  341. </t>
  342. </section>
  343. <section anchor="SDP usage of Speex" title="SDP usage of Speex">
  344. <t>
  345. When conveying information by SDP <xref target="rfc2327"></xref>, the encoding name MUST be
  346. set to "speex". An example of the media representation in SDP for
  347. offering a single channel of Speex at 8000 samples per second might
  348. be:
  349. </t>
  350. <vspace blankLines="1" />
  351. <list style="empty">
  352. <t>m=audio 8088 RTP/AVP 97</t>
  353. <t>a=rtpmap:97 speex/8000</t>
  354. </list>
  355. <t>
  356. Note that the RTP payload type code of 97 is defined in this media
  357. definition to be 'mapped' to the speex codec at an 8kHz sampling
  358. frequency using the 'a=rtpmap' line. Any number from 96 to 127
  359. could have been chosen (the allowed range for dynamic types).
  360. </t>
  361. <t>
  362. The value of the sampling frequency is typically 8000 for narrow band
  363. operation, 16000 for wide band operation, and 32000 for ultra-wide
  364. band operation.
  365. </t>
  366. <t>
  367. If for some reason the offerer has bandwidth limitations, the client
  368. may use the "b=" header, as explained in SDP <xref target="rfc2327"></xref>. The following example
  369. illustrates the case where the offerer cannot receive more than
  370. 10 kbit/s.
  371. </t>
  372. <vspace blankLines="1" />
  373. <list style="empty">
  374. <t>m=audio 8088 RTP/AVP 97</t>
  375. <t>b=AS:10</t>
  376. <t>a=rtmap:97 speex/8000</t>
  377. </list>
  378. <t>
  379. In this case, if the remote part agrees, it should configure its
  380. Speex encoder so that it does not use modes that produce more than
  381. 10 kbit/s. Note that the "b=" constraint also applies on all
  382. payload types that may be proposed in the media line ("m=").
  383. </t>
  384. <t>
  385. An other way to make recommendations to the remote Speex encoder
  386. is to use its specific parameters via the a=fmtp: directive. The
  387. following parameters are defined for use in this way:
  388. </t>
  389. <vspace blankLines="1" />
  390. <list style="empty">
  391. <t>ptime: duration of each packet in milliseconds.<vspace blankLines="1" /></t>
  392. <t>sr: actual sample rate in Hz.<vspace blankLines="1" /></t>
  393. <t>ebw: encoding bandwidth - either 'narrow' or 'wide' or
  394. 'ultra' (corresponds to nominal 8000, 16000, and
  395. 32000 Hz sampling rates).<vspace blankLines="1" /></t>
  396. <t>vbr: variable bit rate - either 'on' 'off' or 'vad'
  397. (defaults to off). If on, variable bit rate is
  398. enabled. If off, disabled. If set to 'vad' then
  399. constant bit rate is used but silence will be encoded
  400. with special short frames to indicate a lack of voice
  401. for that period.<vspace blankLines="1" /></t>
  402. <t>cng: comfort noise generation - either 'on' or 'off'. If
  403. off then silence frames will be silent; if 'on' then
  404. those frames will be filled with comfort noise.<vspace blankLines="1" /></t>
  405. <t>mode: Speex encoding mode. Can be {1,2,3,4,5,6,any}
  406. defaults to 3 in narrowband, 6 in wide and ultra-wide.<vspace blankLines="1" /></t>
  407. <t>penh: use of perceptual enhancement. 1 indicates
  408. to the decoder that perceptual enhancement is recommended,
  409. 0 indicates that it is not. Defaults to on (1).<vspace blankLines="1" /></t>
  410. </list>
  411. <t>Examples:</t>
  412. <vspace blankLines="1" />
  413. <list style="empty">
  414. <t>m=audio 8008 RTP/AVP 97</t>
  415. <t>a=rtpmap:97 speex/8000</t>
  416. <t>a=fmtp:97 mode=4</t>
  417. </list>
  418. <t>
  419. This examples illustrate an offerer that wishes to receive
  420. a Speex stream at 8000Hz, but only using speex mode 3.
  421. </t>
  422. <t>
  423. The offerer may suggest to the remote decoder to activate
  424. its perceptual enhancement filter like this:
  425. </t>
  426. <vspace blankLines="1" />
  427. <list style="empty">
  428. <t>m=audio 8088 RTP/AVP 97</t>
  429. <t>a=rtmap:97 speex/8000</t>
  430. <t>a=fmtp:97 penh=1 </t>
  431. </list>
  432. <t>
  433. Several Speex specific parameters can be given in a single
  434. a=fmtp line provided that they are separated by a semi-colon:
  435. </t>
  436. <vspace blankLines="1" />
  437. <list style="empty">
  438. <t>a=fmtp:97 mode=any;penh=1</t>
  439. </list>
  440. <t>
  441. The offerer may indicate that it wishes to send variable bit rate
  442. frames with comfort noise:
  443. </t>
  444. <vspace blankLines="1" />
  445. <list style="empty">
  446. <t>m=audio 8088 RTP/AVP 97</t>
  447. <t>a=rtmap:97 speex/8000</t>
  448. <t>a=fmtp:97 vbr=on;cng=on</t>
  449. </list>
  450. <t>
  451. The "ptime" attribute is used to denote the packetization
  452. interval (ie, how many milliseconds of audio is encoded in a
  453. single RTP packet). Since Speex uses 20 msec frames, ptime values
  454. of multiples of 20 denote multiple Speex frames per packet.
  455. Values of ptime which are not multiples of 20 MUST be ignored
  456. and clients MUST use the default value of 20 instead.
  457. </t>
  458. <t>
  459. In the example below the ptime value is set to 40, indicating that
  460. there are 2 frames in each packet.
  461. </t>
  462. <vspace blankLines="1" />
  463. <list style="empty">
  464. <t>m=audio 8008 RTP/AVP 97</t>
  465. <t>a=rtpmap:97 speex/8000</t>
  466. <t>a=ptime:40</t>
  467. </list>
  468. <t>
  469. Note that the ptime parameter applies to all payloads listed
  470. in the media line and is not used as part of an a=fmtp directive.
  471. </t>
  472. <t>
  473. Values of ptime not multiple of 20 msec are meaningless, so the
  474. receiver of such ptime values MUST ignore them. If during the
  475. life of an RTP session the ptime value changes, when there are
  476. multiple Speex frames for example, the SDP value must also reflect
  477. the new value.
  478. </t>
  479. <t>
  480. Care must be taken when setting the value of ptime so that the
  481. RTP packet size does not exceed the path MTU.
  482. </t>
  483. </section>
  484. <section anchor="ITU H.323/H.245 Use of Speex" title="ITU H.323/H.245 Use of Speex">
  485. <t>
  486. Application is underway to make Speex a standard ITU codec.
  487. However, until that is finalized, Speex MAY be used in H.323 <xref target="H323"></xref> by
  488. using a non-standard codec block definition in the H.245 <xref target="H245"></xref> codec
  489. capability negotiations.
  490. </t>
  491. </section>
  492. <section anchor="NonStandardMessage format" title="NonStandardMessage format">
  493. <t>
  494. For Speex use in H.245 <xref target="H245"></xref> based systems, the fields in the
  495. NonStandardMessage should be:
  496. </t>
  497. <vspace blankLines="1" />
  498. <list style="empty">
  499. <t>t35CountryCode = Hex: B5</t>
  500. <t>t35Extension = Hex: 00</t>
  501. <t>manufacturerCode = Hex: 0026</t>
  502. <t>[Length of the Binary Sequence (8 bit number)]</t>
  503. <t>[Binary Sequence consisting of an ASCII string, no NULL terminator]</t>
  504. </list>
  505. <t>
  506. The binary sequence is an ascii string merely for ease of use.
  507. The string is not null terminated. The format of this string is
  508. </t>
  509. <vspace blankLines="1" />
  510. <list style="empty">
  511. <t>speex [optional variables]</t>
  512. </list>
  513. <t>
  514. The optional variables are identical to those used for the SDP
  515. a=fmtp strings discussed in section 5 above. The string is built
  516. to be all on one line, each key-value pair separated by a
  517. semi-colon. The optional variables MAY be omitted, which causes
  518. the default values to be assumed. They are:
  519. </t>
  520. <vspace blankLines="1" />
  521. <list style="empty">
  522. <t>ebw=narrow;mode=3;vbr=off;cng=off;ptime=20;sr=8000;penh=no;</t>
  523. </list>
  524. <t>
  525. The fifth octet of the block is the length of the binary sequence.
  526. </t>
  527. <t>
  528. NOTE: this method can result in the advertising of a large number
  529. of Speex 'codecs' based on the number of variables possible. For
  530. most VoIP applications, use of the default binary sequence of
  531. 'speex' is RECOMMENDED to be used in addition to all other options.
  532. This maximizes the chances that two H.323 based applications that
  533. support Speex can find a mutual codec.
  534. </t>
  535. </section>
  536. <section anchor="RTP Payload Types" title="RTP Payload Types">
  537. <t>
  538. Dynamic payload type codes MUST be negotiated 'out-of-band'
  539. for the assignment of a dynamic payload type from the
  540. range of 96-127. H.323 applications MUST use the H.245
  541. H2250LogicalChannelParameters encoding to accomplish this.
  542. </t>
  543. </section>
  544. <section anchor="Security Considerations" title="Security Considerations">
  545. <t>
  546. RTP packets using the payload format defined in this specification
  547. are subject to the security considerations discussed in the RTP
  548. specification <xref target="rfc3550"></xref>, and any appropriate RTP profile. This implies
  549. that confidentiality of the media streams is achieved by encryption.
  550. Because the data compression used with this payload format is applied
  551. end-to-end, encryption may be performed after compression so there is
  552. no conflict between the two operations.
  553. </t>
  554. <t>
  555. A potential denial-of-service threat exists for data encodings using
  556. compression techniques that have non-uniform receiver-end
  557. computational load. The attacker can inject pathological datagrams
  558. into the stream which are complex to decode and cause the receiver to
  559. be overloaded. However, this encoding does not exhibit any
  560. significant non-uniformity.
  561. </t>
  562. <t>
  563. As with any IP-based protocol, in some circumstances a receiver may
  564. be overloaded simply by the receipt of too many packets, either
  565. desired or undesired. Network-layer authentication may be used to
  566. discard packets from undesired sources, but the processing cost of
  567. the authentication itself may be too high.
  568. </t>
  569. </section>
  570. <section anchor="Acknowledgments" title="Acknowledgments">
  571. <t>
  572. The authors would like to thank Equivalence Pty Ltd of Australia
  573. for their assistance in attempting to standardize the use of Speex
  574. in H.323 applications, and for implementing Speex in their open
  575. source OpenH323 stack. The authors would also like to thank Brian
  576. C. Wiles &lt;brian@streamcomm.com&gt; of StreamComm for his assistance in
  577. developing the proposed standard for Speex use in H.323
  578. applications.
  579. </t>
  580. <t>
  581. The authors would also like to thank the following members of the
  582. Speex and AVT communities for their input: Ross Finlayson,
  583. Federico Montesino Pouzols, Henning Schulzrinne, Magnus Westerlund.
  584. </t>
  585. </section>
  586. </middle>
  587. <back>
  588. <references title="Normative References">
  589. <reference anchor="rfc2119">
  590. <front>
  591. <title>Key words for use in RFCs to Indicate Requirement Levels </title>
  592. <author initials="S." surname="Bradner" fullname="Scott Bradner"></author>
  593. </front>
  594. <seriesInfo name="RFC" value="2119" />
  595. </reference>
  596. <reference anchor="rfc3550">
  597. <front>
  598. <title>RTP: A Transport Protocol for real-time applications</title>
  599. <author initials="H." surname="Schulzrinne" fullname=""></author>
  600. <author initials="S." surname="Casner" fullname=""></author>
  601. <author initials="R." surname="Frederick" fullname=""></author>
  602. <author initials="V." surname="Jacobson" fullname=""></author>
  603. </front>
  604. <seriesInfo name="RFC" value="3550" />
  605. </reference>
  606. <reference anchor="rfc2045">
  607. <front>
  608. <title>Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies</title>
  609. <author initials="" surname="" fullname=""></author>
  610. </front>
  611. <date month="November" year="1998" />
  612. <seriesInfo name="RFC" value="2045" />
  613. </reference>
  614. <reference anchor="rfc2327">
  615. <front>
  616. <title>SDP: Session Description Protocol</title>
  617. <author initials="V." surname="Jacobson" fullname=""></author>
  618. <author initials="M." surname="Handley" fullname=""></author>
  619. </front>
  620. <date month="April" year="1998" />
  621. <seriesInfo name="RFC" value="2327" />
  622. </reference>
  623. <reference anchor="H323">
  624. <front>
  625. <title>Packet-based Multimedia Communications Systems</title>
  626. <author initials="" surname="" fullname=""></author>
  627. </front>
  628. <date month="" year="1998" />
  629. <seriesInfo name="ITU-T Recommendation" value="H.323" />
  630. </reference>
  631. <reference anchor="H245">
  632. <front>
  633. <title>Control of communications between Visual Telephone Systems and Terminal Equipment</title>
  634. <author initials="" surname="" fullname=""></author>
  635. </front>
  636. <date month="" year="1998" />
  637. <seriesInfo name="ITU-T Recommendation" value="H.245" />
  638. </reference>
  639. <reference anchor="rfc3551">
  640. <front>
  641. <title>RTP Profile for Audio and Video Conferences with Minimal Control.</title>
  642. <author initials="H." surname="Schulzrinne" fullname=""></author>
  643. <author initials="S." surname="Casner" fullname=""></author>
  644. </front>
  645. <date month="July" year="2003" />
  646. <seriesInfo name="RFC" value="3551" />
  647. </reference>
  648. <reference anchor="rfc3534">
  649. <front>
  650. <title>The application/ogg Media Type</title>
  651. <author initials="L." surname="Walleij" fullname=""></author>
  652. </front>
  653. <date month="May" year="2003" />
  654. <seriesInfo name="RFC" value="3534" />
  655. </reference>
  656. </references>
  657. <references title="Informative References">
  658. <reference anchor="speexenc">
  659. <front>
  660. <title>Speexenc/speexdec, reference command-line encoder/decoder</title>
  661. </front>
  662. <seriesInfo name="Speex website" value="http://www.speex.org/" />
  663. </reference>
  664. <reference anchor="CELP">
  665. <front>
  666. <title>CELP, U.S. Federal Standard 1016.</title>
  667. <author initials="" surname="" fullname=""></author>
  668. </front>
  669. <seriesInfo name="National Technical Information Service (NTIS) website" value="http://www.ntis.gov/" />
  670. </reference>
  671. </references>
  672. </back>
  673. </rfc>