Commit 97303fce authored by Jean-Marc Valin's avatar Jean-Marc Valin
Browse files

Updated draft

parent c8a2ba49
AVT G. Herlein
Internet-Draft
Intended status: Standards Track J. Valin
Expires: August 19, 2008 CSIRO
A. Heggestad
Creytiv.com
A. Moizard
Antisip
February 16, 2008
RTP Payload Format for the Speex Codec
draft-ietf-avt-rtp-speex-05
Status of this Memo
By submitting this Internet-Draft, each author represents that any
applicable patent or other IPR claims of which he or she is aware
have been or will be disclosed, and any of which he or she becomes
aware will be disclosed, in accordance with Section 6 of BCP 79.
Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF), its areas, and its working groups. Note that
other groups may also distribute working documents as Internet-
Drafts.
Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress."
The list of current Internet-Drafts can be accessed at
http://www.ietf.org/ietf/1id-abstracts.txt.
The list of Internet-Draft Shadow Directories can be accessed at
http://www.ietf.org/shadow.html.
This Internet-Draft will expire on August 19, 2008.
Copyright Notice
Copyright (C) The IETF Trust (2008).
Herlein, et al. Expires August 19, 2008 [Page 1]
Internet-Draft Speex February 2008
Abstract
Speex is an open-source voice codec suitable for use in Voice over IP
(VoIP) type applications. This document describes the payload format
for Speex generated bit streams within an RTP packet. Also included
here are the necessary details for the use of Speex with the Session
Description Protocol (SDP).
Herlein, et al. Expires August 19, 2008 [Page 2]
Internet-Draft Speex February 2008
Editors Note
All references to RFC XXXX are to be replaced by references to the
RFC number of this memo, when published.
Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4
2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 5
3. RTP usage for Speex . . . . . . . . . . . . . . . . . . . . . 6
3.1. RTP Speex Header Fields . . . . . . . . . . . . . . . . . 6
3.2. RTP payload format for Speex . . . . . . . . . . . . . . . 6
3.3. Speex payload . . . . . . . . . . . . . . . . . . . . . . 6
3.4. Example Speex packet . . . . . . . . . . . . . . . . . . . 7
3.5. Multiple Speex frames in a RTP packet . . . . . . . . . . 7
4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 9
4.1. Media Type Registration . . . . . . . . . . . . . . . . . 9
4.1.1. Registration of media type audio/speex . . . . . . . . 9
5. SDP usage of Speex . . . . . . . . . . . . . . . . . . . . . . 12
5.1. Example supporting all modes, prefer mode 4 . . . . . . . 15
5.2. Example supporting only mode 3 and 5 . . . . . . . . . . . 15
5.3. Example with Variable Bit Rate and Comfort Noise . . . . . 15
5.4. Example with Voice Activity Detection . . . . . . . . . . 15
5.5. Example with Multiple sampling rates . . . . . . . . . . . 15
5.6. Example with ptime and Multiple Speex frames . . . . . . . 16
5.7. Example with Complete Offer/Answer exchange . . . . . . . 16
6. Implementation Guidelines . . . . . . . . . . . . . . . . . . 17
7. Security Considerations . . . . . . . . . . . . . . . . . . . 18
8. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 19
9. Copying conditions . . . . . . . . . . . . . . . . . . . . . . 20
10. References . . . . . . . . . . . . . . . . . . . . . . . . . . 21
10.1. Normative References . . . . . . . . . . . . . . . . . . . 21
10.2. Informative References . . . . . . . . . . . . . . . . . . 21
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 22
Intellectual Property and Copyright Statements . . . . . . . . . . 23
Herlein, et al. Expires August 19, 2008 [Page 3]
Internet-Draft Speex February 2008
1. Introduction
Speex is based on the CELP [CELP] encoding technique with support for
either narrowband (nominal 8kHz), wideband (nominal 16kHz) or ultra-
wideband (nominal 32kHz). The main characteristics can be summarized
as follows:
o Free software/open-source
o Integration of wideband and narrowband in the same bit-stream
o Wide range of bit-rates available
o Dynamic bit-rate switching and variable bit-rate (VBR)
o Voice Activity Detection (VAD, integrated with VBR)
o Variable complexity
The Speex codec supports a wide range of bit-rates from 2.15 kbit/s
to 44 kbit/s. In some cases however, it may not be possible for an
implementation to include support for all rates (e.g. because of
bandwidth, RAM or CPU constraints). In those cases, to be compliant
with this specification, implementations MUST support at least
narrowband (8 kHz) encoding and decoding at 8 kbit/s bit-rate
(narrowband mode 3). Support for narrowband at 15 kbit/s (narrowband
mode 5) is RECOMMENDED and support for wideband at 27.8 kbit/s
(wideband mode 8) is also RECOMMENDED. The sampling rate MUST be 8,
16 or 32 kHz.
Herlein, et al. Expires August 19, 2008 [Page 4]
Internet-Draft Speex February 2008
2. Terminology
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in RFC2119 [RFC2119] and
indicate requirement levels for compliant RTP implementations.
Herlein, et al. Expires August 19, 2008 [Page 5]
Internet-Draft Speex February 2008
3. RTP usage for Speex
3.1. RTP Speex Header Fields
The RTP header is defined in the RTP specification [RFC3550]. This
section defines how fields in the RTP header are used.
Payload Type (PT): The assignment of an RTP payload type for this
packet format is outside the scope of this document; it is
specified by the RTP profile under which this payload format is
used, or signaled dynamically out-of-band (e.g., using SDP).
Marker (M) bit: The M bit is set to one on the first packet sent
after a silence period, during which packets have not been
transmitted contiguously.
Extension (X) bit: Defined by the RTP profile used.
Timestamp: A 32-bit word that corresponds to the sampling instant
for the first frame in the RTP packet.
3.2. RTP payload format for Speex
The RTP payload for Speex has the format shown in Figure 1. No
additional header fields specific to this payload format are
required. For RTP based transportation of Speex encoded audio the
standard RTP header [RFC3550] is followed by one or more payload data
blocks. An optional padding terminator may also be used.
0 1 2 3
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| RTP Header |
+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
| one or more frames of Speex .... |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| one or more frames of Speex .... | padding |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 1: RTP payload for Speex
3.3. Speex payload
For the purposes of packetizing the bit stream in RTP, it is only
necessary to consider the sequence of bits as output by the Speex
encoder [speex_manual], and present the same sequence to the decoder.
The payload format described here maintains this sequence.
Herlein, et al. Expires August 19, 2008 [Page 6]
Internet-Draft Speex February 2008
A typical Speex frame, encoded at the maximum bitrate, is approx. 110
octets and the total number of Speex frames SHOULD be kept less than
the path MTU to prevent fragmentation. Speex frames MUST NOT be
fragmented across multiple RTP packets,
An RTP packet MAY contain Speex frames of the same bit rate or of
varying bit rates, since the bit-rate for a frame is conveyed in band
with the signal.
The encoding and decoding algorithm can change the bit rate at any 20
msec frame boundary, with the bit rate change notification provided
in-band with the bit stream. Each frame contains both sampling rate
(narrowband, wideband or ultra-wideband) and "mode" (bit-rate)
information in the bit stream. No out-of-band notification is
required for the decoder to process changes in the bit rate sent by
the encoder.
The sampling rate MUST be either 8000 Hz, 16000 Hz, or 32000 Hz.
The RTP payload MUST be padded to provide an integer number of octets
as the payload length. These padding bits are LSB aligned in network
octet order and consist of a 0 followed by all ones (until the end of
the octet). This padding is only required for the last frame in the
packet, and only to ensure the packet contents ends on an octet
boundary.
3.4. Example Speex packet
In the example below we have a single Speex frame with 5 bits of
padding to ensure the packet size falls on an octet boundary.
0 1 2 3
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| RTP Header |
+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
| ..speex data.. |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ..speex data.. |0 1 1 1 1|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
3.5. Multiple Speex frames in a RTP packet
Below is an example of two Speex frames contained within one RTP
packet. The Speex frame length in this example fall on an octet
boundary so there is no padding.
The Speex decoder [speex_manual] can detect the bitrate from the
Herlein, et al. Expires August 19, 2008 [Page 7]
Internet-Draft Speex February 2008
payload and is responsible for detecting the 20 msec boundaries
between each frame.
0 1 2 3
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| RTP Header |
+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
| ..speex frame 1.. |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ..speex frame 1.. | ..speex frame 2.. |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ..speex frame 2.. |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Herlein, et al. Expires August 19, 2008 [Page 8]
Internet-Draft Speex February 2008
4. IANA Considerations
This document defines the Speex media type.
4.1. Media Type Registration
This section describes the media types and names associated with this
payload format. The section registers the media types, as per
RFC4288 [RFC4288]
4.1.1. Registration of media type audio/speex
Media type name: audio
Media subtype name: speex
Required parameters:
rate: RTP timestamp clock rate, which is equal to the sampling
rate in Hz. The sampling rate MUST be either 8000, 16000, or
32000.
Optional parameters:
ptime: SHOULD be a multiple of 20 msec [RFC4566]
maxptime: SHOULD be a multiple of 20 msec [RFC4566]
vbr: variable bit rate - either 'on' 'off' or 'vad' (defaults to
off). If on, variable bit rate is enabled. If off, disabled. If
set to 'vad' then constant bit rate is used but silence will be
encoded with special short frames to indicate a lack of voice for
that period.
cng: comfort noise generation - either 'on' or 'off'. If off then
silence frames will be silent; if 'on' then those frames will be
filled with comfort noise.
mode: List supported Speex decoding modes. The valid modes are
different for narrowband and wideband, and are defined as follows:
* {1,2,3,4,5,6,7,8,any} for narrowband
* {0,1,2,3,4,5,6,7,8,9,10,any} for wideband and ultra-wideband
Several 'mode' parameters can be provided. In this case, the
Herlein, et al. Expires August 19, 2008 [Page 9]
Internet-Draft Speex February 2008
remote party SHOULD configure its encoder using the first
supported mode provided. When 'any' is used, the offerer
indicates that it supports all decoding modes. If the 'mode'
parameter is not provided, the mode value is considered to be
equivalent to 'mode=3;mode=any' in narrowband and
'mode=8;mode=any' in wideband and ultra-wideband. Note that each
Speex frame does contains the mode (or bit-rate) that should be
used to decode it. Thus application MUST be able to decode any
Speex frame unless the SDP clearly specify that some modes are not
supported. (e.g., by not including 'mode=any')
Encoding considerations:
This media type is framed and binary, see section 4.8 in
[RFC4288].
Security considerations: See Section 6
Interoperability considerations:
None.
Published specification:
RFC XXXX [RFC Editor: please replace by the RFC number of this
memo, when published]
Applications which use this media type:
Audio streaming and conferencing applications.
Additional information: none
Person and email address to contact for further information :
Alfred E. Heggestad: aeh@db.org
Intended usage: COMMON
Restrictions on usage:
This media type depends on RTP framing, and hence is only defined
for transfer via RTP [RFC3550]. Transport within other framing
protocols is not defined at this time.
Author: Alfred E. Heggestad
Change controller:
Herlein, et al. Expires August 19, 2008 [Page 10]
Internet-Draft Speex February 2008
IETF Audio/Video Transport working group delegated from the IESG.
Herlein, et al. Expires August 19, 2008 [Page 11]
Internet-Draft Speex February 2008
5. SDP usage of Speex
The information carried in the media type specification has a
specific mapping to fields in the Session Description Protocol (SDP)
[RFC4566], which is commonly used to describe RTP sessions. When SDP
is used to specify sessions employing the Speex codec, the mapping is
as follows:
o The media type ("audio") goes in SDP "m=" as the media name.
o The media subtype ("speex") goes in SDP "a=rtpmap" as the encoding
name. The required parameter "rate" also goes in "a=rtpmap" as
the clock rate.
o The parameters "ptime" and "maxptime" go in the SDP "a=ptime" and
"a=maxptime" attributes, respectively.
o Any remaining parameters go in the SDP "a=fmtp" attribute by
copying them directly from the media type string as a semicolon
separated list of parameter=value pairs.
The tables below include the equivalence between modes and bitrates
for narrowband, wideband and ultra-wideband. Also, the corresponding
"Speex quality" setting (see SPEEX_SET_QUALITY in The Speex Codec
Manual [speex_manual]) is included as an indication.
<