⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 draft-herlein-avt-rtp-speex-00.txt

📁 一个开源的sip源代码
💻 TXT
📖 第 1 页 / 共 2 页
字号:
Internet Engineering Task Force                          Greg HerleinInternet Draft                                        Jean-Marc Valindraft-herlein-avt-rtp-speex-00.txt                       Simon MorlatMarch 3, 2004                                          Roger HardimanExpires: September 3, 2004                                  Phil Kerr                 RTP Payload Format for the Speex CodecStatus of this Memo   This document is an Internet-Draft and is in full conformance with   all provisions of Section 10 of RFC 2026.   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   To view the list Internet-Draft Shadow Directories, see   http://www.ietf.org/shadow.html.Copyright Notice   Copyright (C) The Internet Society (2003).  All Rights Reserved.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) and a preliminary method of   using Speex within H.323 applications.1. Conventions used in this document   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 RFC 2119 [5].Herlein, Valin, et. al.     Expires September 3, 2004            [Page 1]^LInternet-Draft       draft-herlein-avt-rtp-speex-00.txt    March 3, 20042. Overview of the Speex Codec   Speex is based on the CELP [12] encoding technique with support for    either narrowband (nominal 8kHz), wideband (nominal 16kHz) or    ultra-wideband (nominal 32kHz), and (non-optimal) rates up to 48 kHz    sampling also available.  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 complexity3. RTP payload format for Speex   For RTP based transportation of Speex encoded audio the standard    RTP header [2] 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    |     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+3.1 RTP Header      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     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+     |V=2|P|X|  CC   |M|     PT      |       sequence number         |     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+     |                           timestamp                           |     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+     |           synchronization source (SSRC) identifier            |     +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+     |            contributing source (CSRC) identifiers             |     |                              ...                              |     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   The RTP header begins with an octet of fields (V, P, X, and CC) to      support specialized RTP uses (see [8] and [9] for details). For    Speex the following values are used.Herlein, Valin, et. al.     Expires September 3, 2004            [Page 2]^LInternet-Draft       draft-herlein-avt-rtp-speex-00.txt    March 3, 2004   Version (V): 2 bits      This field identifies the version of RTP. The version      used by this specification is two (2).   Padding (P): 1 bit      If the padding bit is set, the packet contains one or more      additional padding octets at the end which are not part of      the payload.  P is set if the total packet size is less than       the MTU.     Extension (X): 1 bit      If the extension, X, bit is set, the fixed header MUST be       followed by exactly one header extension, with a format defined       in Section 5.3.1. of [8],    CSRC count (CC): 4 bits      The CSRC count contains the number of CSRC identifiers.   Marker (M): 1 bit      The M bit indicates if the packet contains comfort noise.  This       field is used in conjunction with the cng SDP attribute and is       detailed further in section 5 below.  In normal usage this bit       is set if the packet contains comfort noise.   Payload Type (PT): 7 bits      An RTP profile for a class of applications is expected to assign       a payload type for this format, or a dynamically allocated       payload type SHOULD be chosen which designates the payload as       Speex.   Sequence number: 16 bits      The sequence number increments by one for each RTP data packet      sent, and may be used by the receiver to detect packet loss and      to restore packet sequence.  This field is detailed further in      [2].   Timestamp: 32 bits      A timestamp representing the sampling time of the first sample of      the first Speex packet in the RTP packet.  The clock frequency       MUST be set to the sample rate of the encoded audio data.      Speex uses 20 msec frames and a variable sampling rate clock.        The RTP timestamp MUST be in units of 1/X of a second where X       is the sample rate used.  Speex uses a nominal 8kHz sampling rate      for narrowband use, a nominal 16kHz sampling rate for wideband use,       and a nominal 32kHz sampling rate for ultra-wideband use.   SSRC/CSRC identifiers:       These two fields, 32 bits each with one SSRC field and a maximum       of 16 CSRC fields, are as defined in [2].  Herlein, Valin, et. al.     Expires September 3, 2004            [Page 3]^LInternet-Draft       draft-herlein-avt-rtp-speex-00.txt    March 3, 20043.2 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 [11], and present the same sequence to the decoder.  The    payload format described here maintains this sequence.     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 "mode"    (narrowband, wideband or ultra-wideband) and "sub-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.   It is RECOMMENDED that values of 8000, 16000 and 32000 be used    for normal internet telephony applications, though the sample    rate is supported at rates as low as 6000 Hz and as high as    48 kHz.   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 byte 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.2.1 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   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   |V=2|P|X|  CC   |M|     PT      |       sequence number         |   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   |                           timestamp                           |   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   |         synchronization source (SSRC) identifier              |   +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+Herlein, Valin, et. al.     Expires September 3, 2004            [Page 4]^LInternet-Draft       draft-herlein-avt-rtp-speex-00.txt    March 3, 2004    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   +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+   |         contributing source (CSRC) identifiers                |   |                              ...                              |   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   |                        ..speex data..                         |   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   |                        ..speex data..               |0 1 1 1 1|   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+3.4 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.   Speex codecs [11] are able to detect the the bitrate from the   payload and are 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   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   |V=2|P|X|  CC   |M|     PT      |       sequence number         |   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   |                           timestamp                           |   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   |         synchronization source (SSRC) identifier              |   +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+   |         contributing source (CSRC) identifiers                |   |                              ...                              |   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   |                        ..speex data..                         |   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   |        ..speex data..         |        ..speex data..         |   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   |                        ..speex data..                         |   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+4. MIME registration of Speex   Full definition of the MIME type for Speex will be part of the Ogg   Vorbis MIME type definition application [10].     MIME media type name: audio   MIME subtype: speexHerlein, Valin, et. al.     Expires September 3, 2004            [Page 5]^LInternet-Draft       draft-herlein-avt-rtp-speex-00.txt    March 3, 2004   Optional parameters:   Required parameters: to be included in the Ogg MIME specification.   Encoding considerations:   Security Considerations:         See Section 6 of RFC 3047.   Interoperability considerations: none   Published specification:     Applications which use this media type:   Additional information: none   Person & email address to contact for further information:	 Greg Herlein <gherlein@herlein.com>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -