cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: RTP Payload Format for Vorbis Encoded Audio cannam@86: cannam@86: cannam@86: Xiph.Org Foundation cannam@86:
cannam@86: lu_zero@gentoo.org cannam@86: http://xiph.org/ cannam@86:
cannam@86:
cannam@86: cannam@86: cannam@86: cannam@86: General cannam@86: AVT Working Group cannam@86: I-D cannam@86: cannam@86: Internet-Draft cannam@86: Vorbis cannam@86: RTP cannam@86: cannam@86: example cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: This document describes an RTP payload format for transporting Vorbis encoded cannam@86: audio. It details the RTP encapsulation mechanism for raw Vorbis data and cannam@86: the delivery mechanisms for the decoder probability model (referred to cannam@86: as a codebook), as well as other setup information. cannam@86: cannam@86: cannam@86: cannam@86: Also included within this memo are media type registrations and the details cannam@86: necessary for the use of Vorbis with the Session Description Protocol (SDP). cannam@86: cannam@86: cannam@86: cannam@86: cannam@86:
cannam@86: cannam@86: cannam@86: cannam@86:
cannam@86: cannam@86: cannam@86: Vorbis is a general purpose perceptual audio codec intended to allow cannam@86: maximum encoder flexibility, thus allowing it to scale competitively cannam@86: over an exceptionally wide range of bit rates. At the high cannam@86: quality/bitrate end of the scale (CD or DAT rate stereo, 16/24 bits), it cannam@86: is in the same league as MPEG-4 AAC. cannam@86: Vorbis is also intended for lower and higher sample rates (from cannam@86: 8kHz telephony to 192kHz digital masters) and a range of channel cannam@86: representations (monaural, polyphonic, stereo, quadraphonic, 5.1, cannam@86: ambisonic, or up to 255 discrete channels). cannam@86: cannam@86: cannam@86: cannam@86: Vorbis encoded audio is generally encapsulated within an Ogg format bitstream cannam@86: , which provides framing and synchronization. cannam@86: For the purposes of RTP transport, this layer is unnecessary, and so raw Vorbis cannam@86: packets are used in the payload. cannam@86: cannam@86: cannam@86:
cannam@86: cannam@86: 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 BCP 14, and indicate requirement levels for compliant implementations. Requirements apply to all implementations unless otherwise stated. cannam@86: An implementation is a software module that supports one of the media types defined in this document. Software modules may support multiple media types, but conformance is considered individually for each type. cannam@86: Implementations that fail to satisfy one or more "MUST" requirements are considered non-compliant. Implementations that satisfy all "MUST" requirements, but fail to satisfy one or more "SHOULD" requirements, are said to be "conditionally compliant". All other implementations are "unconditionally compliant". cannam@86: cannam@86:
cannam@86:
cannam@86: cannam@86:
cannam@86: cannam@86: cannam@86: For RTP-based transport of Vorbis-encoded audio, the standard RTP header is cannam@86: followed by a 4-octet payload header, and then the payload data. The payload cannam@86: headers are used to associate the Vorbis data with its associated decoding cannam@86: codebooks as well as indicate if the following packet contains fragmented cannam@86: Vorbis data and/or the number of whole Vorbis data frames. The payload data cannam@86: contains the raw Vorbis bitstream information. There are 3 types of Vorbis cannam@86: data; an RTP payload MUST contain just one of them at a time. cannam@86: cannam@86: cannam@86:
cannam@86: cannam@86: cannam@86: The format of the RTP header is specified in cannam@86: and shown in . This payload format cannam@86: uses the fields of the header in a manner consistent with that specification. cannam@86: cannam@86: cannam@86: cannam@86:
cannam@86: cannam@86:
cannam@86:
cannam@86: cannam@86: cannam@86: The RTP header begins with an octet of fields (V, P, X, and CC) to support cannam@86: specialized RTP uses (see and cannam@86: for details). For Vorbis RTP, the following cannam@86: values are used. cannam@86: cannam@86: cannam@86: cannam@86: Version (V): 2 bits cannam@86: cannam@86: This field identifies the version of RTP. The version used by this cannam@86: specification is two (2). cannam@86: cannam@86: cannam@86: cannam@86: Padding (P): 1 bit cannam@86: cannam@86: Padding MAY be used with this payload format according to Section 5.1 of cannam@86: . cannam@86: cannam@86: cannam@86: cannam@86: Extension (X): 1 bit cannam@86: cannam@86: The Extension bit is used in accordance with . cannam@86: cannam@86: cannam@86: cannam@86: CSRC count (CC): 4 bits cannam@86: cannam@86: The CSRC count is used in accordance with . cannam@86: cannam@86: cannam@86: cannam@86: Marker (M): 1 bit cannam@86: cannam@86: Set to zero. Audio silence suppression is not used. This conforms to Section 4.1 cannam@86: of . cannam@86: cannam@86: cannam@86: cannam@86: Payload Type (PT): 7 bits cannam@86: cannam@86: An RTP profile for a class of applications is expected to assign a payload type cannam@86: for this format, or a dynamically allocated payload type SHOULD be chosen that cannam@86: designates the payload as Vorbis. cannam@86: cannam@86: cannam@86: cannam@86: Sequence number: 16 bits cannam@86: cannam@86: The sequence number increments by one for each RTP data packet sent, and may be cannam@86: used by the receiver to detect packet loss and to restore the packet sequence. This cannam@86: field is detailed further in . cannam@86: cannam@86: cannam@86: cannam@86: Timestamp: 32 bits cannam@86: cannam@86: A timestamp representing the sampling time of the first sample of the first cannam@86: Vorbis packet in the RTP payload. The clock frequency MUST be set to the sample cannam@86: rate of the encoded audio data and is conveyed out-of-band (e.g., as an SDP parameter). cannam@86: cannam@86: cannam@86: cannam@86: SSRC/CSRC identifiers: cannam@86: cannam@86: These two fields, 32 bits each with one SSRC field and a maximum of 16 CSRC cannam@86: fields, are as defined in cannam@86: . cannam@86: cannam@86: cannam@86:
cannam@86: cannam@86:
cannam@86: cannam@86: cannam@86: The 4 octets following the RTP Header section are the Payload Header. This cannam@86: header is split into a number of bit fields detailing the format of the cannam@86: following payload data packets. cannam@86: cannam@86: cannam@86:
cannam@86: cannam@86:
cannam@86: cannam@86: cannam@86: Ident: 24 bits cannam@86: cannam@86: This 24-bit field is used to associate the Vorbis data to a decoding cannam@86: Configuration. It is stored as a network byte order integer. cannam@86: cannam@86: cannam@86: cannam@86: Fragment type (F): 2 bits cannam@86: cannam@86: This field is set according to the following list: cannam@86: cannam@86: cannam@86: cannam@86: 0 = Not Fragmented cannam@86: 1 = Start Fragment cannam@86: 2 = Continuation Fragment cannam@86: 3 = End Fragment cannam@86: cannam@86: cannam@86: cannam@86: Vorbis Data Type (VDT): 2 bits cannam@86: cannam@86: This field specifies the kind of Vorbis data stored in this RTP packet. There cannam@86: are currently three different types of Vorbis payloads. Each packet MUST contain only a single type of Vorbis packet (e.g., you must not aggregate configuration and comment packets in the same RTP payload). cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: 0 = Raw Vorbis payload cannam@86: 1 = Vorbis Packed Configuration payload cannam@86: 2 = Legacy Vorbis Comment payload cannam@86: 3 = Reserved cannam@86: cannam@86: cannam@86: The packets with a VDT of value 3 MUST be ignored. cannam@86: cannam@86: cannam@86: The last 4 bits represent the number of complete packets in this payload. This cannam@86: provides for a maximum number of 15 Vorbis packets in the payload. If the cannam@86: payload contains fragmented data, the number of packets MUST be set to 0. cannam@86: cannam@86: cannam@86:
cannam@86: cannam@86:
cannam@86: cannam@86: cannam@86: Raw Vorbis packets are currently unbounded in length; application profiles will cannam@86: likely define a practical limit. Typical Vorbis packet sizes range from very cannam@86: small (2-3 bytes) to quite large (8-12 kilobytes). The reference implementation cannam@86: typically produces packets less than ~800 cannam@86: bytes, except for the setup header packets, which are ~4-12 kilobytes. Within an cannam@86: RTP context, to avoid fragmentation, the Vorbis data packet size SHOULD be kept cannam@86: sufficiently small so that after adding the RTP and payload headers, the cannam@86: complete RTP packet is smaller than the path MTU. cannam@86: cannam@86: cannam@86:
cannam@86: cannam@86:
cannam@86: cannam@86: cannam@86: Each Vorbis payload packet starts with a two octet length header, which is used cannam@86: to represent the size in bytes of the following data payload, and is followed by the cannam@86: raw Vorbis data padded to the nearest byte boundary, as explained by the Vorbis I Specification. The length value is stored cannam@86: as a network byte order integer. cannam@86: cannam@86: cannam@86: cannam@86: For payloads that consist of multiple Vorbis packets, the payload data consists cannam@86: of the packet length followed by the packet data for each of the Vorbis packets cannam@86: in the payload. cannam@86: cannam@86: cannam@86: cannam@86: The Vorbis packet length header is the length of the Vorbis data block only and cannam@86: does not include the length field. cannam@86: cannam@86: cannam@86: cannam@86: The payload packing of the Vorbis data packets MUST follow the guidelines cannam@86: set out in , where the oldest Vorbis packet occurs cannam@86: immediately after the RTP packet header. Subsequent Vorbis packets, if any, MUST cannam@86: follow in temporal order. cannam@86: cannam@86: cannam@86: cannam@86: Audio channel mapping is in accordance with the cannam@86: Vorbis I Specification. cannam@86: cannam@86: cannam@86:
cannam@86: cannam@86:
cannam@86: cannam@86: cannam@86: Here is an example RTP payload containing two Vorbis packets. cannam@86: cannam@86: cannam@86:
cannam@86: cannam@86:
cannam@86: cannam@86: cannam@86: The payload data section of the RTP packet begins with the 24-bit Ident field cannam@86: followed by the one octet bit field header, which has the number of Vorbis cannam@86: frames set to 2. Each of the Vorbis data frames is prefixed by the two octets cannam@86: length field. The Packet Type and Fragment Type are set to 0. The Configuration cannam@86: that will be used to decode the packets is the one indexed by the ident value. cannam@86: cannam@86: cannam@86:
cannam@86:
cannam@86: cannam@86: cannam@86: cannam@86:
cannam@86: cannam@86: cannam@86: Unlike other mainstream audio codecs, Vorbis has no statically cannam@86: configured probability model. Instead, it packs all entropy decoding cannam@86: configuration, Vector Quantization and Huffman models into a data block cannam@86: that must be transmitted to the decoder with the compressed data. cannam@86: A decoder also requires information detailing the number of audio cannam@86: channels, bitrates, and similar information to configure itself for a cannam@86: particular compressed data stream. These two blocks of information are cannam@86: often referred to collectively as the "codebooks" for a Vorbis stream, cannam@86: and are included as special "header" packets at the start cannam@86: of the compressed data. In addition, cannam@86: the Vorbis I specification cannam@86: requires the presence of a comment header packet that gives simple cannam@86: metadata about the stream, but this information is not required for cannam@86: decoding the frame sequence. cannam@86: cannam@86: cannam@86: cannam@86: Thus, these two codebook header packets must be received by the decoder before cannam@86: any audio data can be interpreted. These requirements pose problems in RTP, cannam@86: which is often used over unreliable transports. cannam@86: cannam@86: cannam@86: cannam@86: Since this information must be transmitted reliably and, as the RTP cannam@86: stream may change certain configuration data mid-session, there are cannam@86: different methods for delivering this configuration data to a cannam@86: client, both in-band and out-of-band, which are detailed below. cannam@86: In order to set up an initial state for the client application, the cannam@86: configuration MUST be conveyed via the signalling channel used to set up cannam@86: the session. One example of such signalling is cannam@86: SDP with the cannam@86: Offer/Answer Model. cannam@86: Changes to the configuration MAY be communicated via a re-invite, cannam@86: conveying a new SDP, or sent in-band in the RTP channel. cannam@86: Implementations MUST support an in-band delivery of updated codebooks, cannam@86: and SHOULD support out-of-band codebook update using a new SDP file. cannam@86: The changes may be due to different codebooks as well as cannam@86: different bitrates of the RTP stream. cannam@86: cannam@86: cannam@86: For non-chained streams, the recommended Configuration delivery cannam@86: method is inside the Packed cannam@86: Configuration in the SDP as explained the Mapping Media Type cannam@86: Parameters into SDP. cannam@86: cannam@86: cannam@86: cannam@86: The 24-bit Ident field is used to map which Configuration will be used to cannam@86: decode a packet. When the Ident field changes, it indicates that a change in cannam@86: the stream has taken place. The client application MUST have in advance the cannam@86: correct configuration. If the client detects a change in the Ident value and cannam@86: does not have this information, it MUST NOT decode the raw associated Vorbis cannam@86: data until it fetches the correct Configuration. cannam@86: cannam@86: cannam@86:
cannam@86: cannam@86: cannam@86: The Packed Configuration Payload is cannam@86: sent in-band with the packet type bits set to match the Vorbis Data Type. cannam@86: Clients MUST be capable of dealing with fragmentation and periodic cannam@86: re-transmission of the configuration headers. cannam@86: The RTP timestamp value MUST reflect the transmission time of the first data packet for which this configuration applies. cannam@86: cannam@86: cannam@86:
cannam@86: cannam@86: cannam@86: A Vorbis Packed Configuration is indicated with the Vorbis Data Type field set cannam@86: to 1. Of the three headers defined in the cannam@86: Vorbis I specification, the cannam@86: Identification and the Setup MUST be packed as they are, while the Comment cannam@86: header MAY be replaced with a dummy one. cannam@86: cannam@86: The packed configuration stores Xiph codec cannam@86: configurations in a generic way: the first field stores the number of the following packets cannam@86: minus one (count field), the next ones represent the size of the headers cannam@86: (length fields), and the headers immediately follow the list of length fields. cannam@86: The size of the last header is implicit. cannam@86: cannam@86: The count and the length fields are encoded using the following logic: the data cannam@86: is in network byte order; every byte has the most significant bit used cannam@86: as a flag, and the following 7 bits are used to store the value. cannam@86: The first 7 most significant bits are stored in the first byte. cannam@86: If there are remaining bits, the flag bit is set to 1 and the subsequent cannam@86: 7 bits are stored in the following byte. cannam@86: If there are remaining bits, set the flag to 1 and the same procedure is cannam@86: repeated. cannam@86: The ending byte has the flag bit set to 0. To decode, simply iterate cannam@86: over the bytes until the flag bit is set to 0. For every byte, the data cannam@86: is added to the accumulated value multiplied by 128. cannam@86: cannam@86: The headers are packed in the same order as they are present in Ogg : cannam@86: Identification, Comment, Setup. cannam@86: cannam@86: cannam@86: The 2 byte length tag defines the length of the packed headers as the sum of cannam@86: the Configuration, Comment, and Setup lengths. cannam@86: cannam@86:
cannam@86: cannam@86:
cannam@86: cannam@86: The Ident field is set with the value that will be used by the Raw Payload cannam@86: Packets to address this Configuration. The Fragment type is set to 0 because the cannam@86: packet bears the full Packed configuration. The number of the packet is set to 1. cannam@86:
cannam@86:
cannam@86: cannam@86:
cannam@86: cannam@86: cannam@86: The following packet definition MUST be used when Configuration is inside cannam@86: in the SDP. cannam@86: cannam@86: cannam@86:
cannam@86: cannam@86: cannam@86: As mentioned above, the RECOMMENDED delivery vector for Vorbis configuration cannam@86: data is via a retrieval method that can be performed using a reliable transport cannam@86: protocol. As the RTP headers are not required for this method of delivery, the cannam@86: structure of the configuration data is slightly different. The packed header cannam@86: starts with a 32-bit (network-byte ordered) count field, which details cannam@86: the number of packed headers that are contained in the bundle. The cannam@86: following shows the Packed header cannam@86: payload for each chained Vorbis stream. cannam@86: cannam@86: cannam@86:
cannam@86: cannam@86:
cannam@86: cannam@86:
cannam@86: cannam@86:
cannam@86: cannam@86: The key difference between the in-band format and this one is that there is no cannam@86: need for the payload header octet. In this figure, the comment has a size bigger cannam@86: than 127 bytes. cannam@86: cannam@86:
cannam@86: cannam@86:
cannam@86: cannam@86:
cannam@86: cannam@86: cannam@86: Unlike the loss of raw Vorbis payload data, loss of a configuration header cannam@86: leads to a situation where it will not be possible to successfully decode the cannam@86: stream. Implementations MAY try to recover from an error by requesting again the cannam@86: missing Configuration or, if the delivery method is in-band, by buffering the cannam@86: payloads waiting for the Configuration needed to decode them. cannam@86: The baseline reaction SHOULD either be reset or end the RTP session. cannam@86: cannam@86: cannam@86:
cannam@86: cannam@86:
cannam@86: cannam@86:
cannam@86: cannam@86: cannam@86: Vorbis Data Type flag set to 2 indicates that the packet contains cannam@86: the comment metadata, such as artist name, track title, and so on. These cannam@86: metadata messages are not intended to be fully descriptive but rather to offer basic cannam@86: track/song information. Clients MAY ignore it completely. The details on the cannam@86: format of the comments can be found in the Vorbis I Specification. cannam@86: cannam@86:
cannam@86: cannam@86:
cannam@86: cannam@86: cannam@86: The 2-byte length field is necessary since this packet could be fragmented. cannam@86: cannam@86: cannam@86:
cannam@86:
cannam@86: cannam@86: cannam@86: Each RTP payload contains either one Vorbis packet fragment or an integer cannam@86: number of complete Vorbis packets (up to a maximum of 15 packets, since the cannam@86: number of packets is defined by a 4-bit value). cannam@86: cannam@86: cannam@86: cannam@86: Any Vorbis data packet that is less than path MTU SHOULD be bundled in the RTP cannam@86: payload with as many Vorbis packets as will fit, up to a maximum of 15, except cannam@86: when such bundling would exceed an application's desired transmission latency. cannam@86: Path MTU is detailed in and . cannam@86: cannam@86: cannam@86: cannam@86: A fragmented packet has a zero in the last four bits of the payload header. cannam@86: The first fragment will set the Fragment type to 1. Each fragment after the cannam@86: first will set the Fragment type to 2 in the payload header. The consecutive cannam@86: fragments MUST be sent without any other payload being sent between the first cannam@86: and the last fragment. The RTP payload containing the last fragment of the cannam@86: Vorbis packet will have the Fragment type set to 3. To maintain the correct cannam@86: sequence for fragmented packet reception, the timestamp field of fragmented cannam@86: packets MUST be the same as the first packet sent, with the sequence number cannam@86: incremented as normal for the subsequent RTP payloads; this will affect the cannam@86: RTCP jitter measurement. The length field shows the fragment length. cannam@86: cannam@86: cannam@86:
cannam@86: cannam@86: cannam@86: Here is an example of a fragmented Vorbis packet split over three RTP payloads. cannam@86: Each of them contains the standard RTP headers as well as the 4-octet Vorbis cannam@86: headers. cannam@86: cannam@86: cannam@86:
cannam@86: cannam@86:
cannam@86: cannam@86: cannam@86: In this payload, the initial sequence number is 1000 and the timestamp is 12345. The Fragment type is set to 1, the number of packets field is set to 0, and as cannam@86: the payload is raw Vorbis data, the VDT field is set to 0. cannam@86: cannam@86: cannam@86:
cannam@86: cannam@86:
cannam@86: cannam@86: cannam@86: The Fragment type field is set to 2, and the number of packets field is set to 0. cannam@86: For large Vorbis fragments, there can be several of these types of payloads. cannam@86: The maximum packet size SHOULD be no greater than the path MTU, cannam@86: including all RTP and payload headers. The sequence number has been incremented cannam@86: by one, but the timestamp field remains the same as the initial payload. cannam@86: cannam@86: cannam@86:
cannam@86: cannam@86:
cannam@86: cannam@86: cannam@86: This is the last Vorbis fragment payload. The Fragment type is set to 3 and the cannam@86: packet count remains set to 0. As in the previous payloads, the timestamp remains cannam@86: set to the first payload timestamp in the sequence and the sequence number has cannam@86: been incremented. cannam@86: cannam@86:
cannam@86: cannam@86:
cannam@86: cannam@86: cannam@86: As there is no error correction within the Vorbis stream, packet loss will cannam@86: result in a loss of signal. Packet loss is more of an issue for fragmented cannam@86: Vorbis packets as the client will have to cope with the handling of the cannam@86: Fragment Type. In case of loss of fragments, the client MUST discard all the cannam@86: remaining Vorbis fragments and decode the incomplete packet. If we use the cannam@86: fragmented Vorbis packet example above and the first RTP payload is lost, the cannam@86: client MUST detect that the next RTP payload has the packet count field set cannam@86: to 0 and the Fragment type 2 and MUST drop it. cannam@86: The next RTP payload, which is the final fragmented packet, MUST be dropped cannam@86: in the same manner. cannam@86: If the missing RTP payload is the last, the two fragments received will be cannam@86: kept and the incomplete Vorbis packet decoded. cannam@86: cannam@86: cannam@86: cannam@86: Loss of any of the Configuration fragment will result in the loss of the full cannam@86: Configuration packet with the result detailed in the Loss of Configuration Headers section. cannam@86: cannam@86: cannam@86:
cannam@86:
cannam@86:
cannam@86: cannam@86: cannam@86: audio cannam@86: cannam@86: vorbis cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: indicates the RTP timestamp clock rate as described in RTP Profile for Audio and Video Conferences with Minimal Control. cannam@86: cannam@86: cannam@86: indicates the number of audio channels as described in RTP Profile for Audio and Video Conferences with Minimal Control. cannam@86: cannam@86: cannam@86: cannam@86: the base64 representation of the Packed Headers. cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: This media type is framed and contains binary data. cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: See Section 10 of RFC 5215. cannam@86: cannam@86: cannam@86: cannam@86: None cannam@86: cannam@86: cannam@86: cannam@86: RFC 5215 cannam@86: cannam@86: Ogg Vorbis I specification: Codec setup and packet decode. Available from the Xiph website, http://xiph.org/ cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: Audio streaming and conferencing tools cannam@86: cannam@86: cannam@86: cannam@86: None cannam@86: cannam@86: cannam@86: cannam@86: Luca Barbato: <lu_zero@gentoo.org>
cannam@86: cannam@86: IETF Audio/Video Transport Working Group cannam@86: cannam@86:
cannam@86: cannam@86: cannam@86: cannam@86: COMMON cannam@86: cannam@86: cannam@86: cannam@86: This media type depends on RTP framing, hence is only defined for transfer via RTP. cannam@86: cannam@86: cannam@86: Luca Barbato cannam@86: cannam@86: cannam@86: IETF AVT Working Group delegated from the IESG cannam@86:
cannam@86: cannam@86:
cannam@86: cannam@86: cannam@86: The following IANA considerations refers to the split configuration Packed Headers used within RFC 5215. cannam@86: cannam@86: cannam@86: cannam@86: audio cannam@86: cannam@86: vorbis-config cannam@86: cannam@86: cannam@86: cannam@86: None cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: None cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: This media type contains binary data. cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: See Section 10 of RFC 5215. cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: None cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: RFC 5215 cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: Vorbis encoded audio, configuration data cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: None cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: Luca Barbato: <lu_zero@gentoo.org> cannam@86: cannam@86: IETF Audio/Video Transport Working Group cannam@86: cannam@86: cannam@86: cannam@86: COMMON cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: This media type doesn't depend on the transport. cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: Luca Barbato cannam@86: cannam@86: cannam@86: cannam@86: IETF AVT Working Group delegated from the IESG cannam@86: cannam@86: cannam@86:
cannam@86: cannam@86:
cannam@86: cannam@86:
cannam@86: cannam@86: The following paragraphs define the mapping of the parameters described in the IANA considerations section and their usage in the Offer/Answer Model. In order to be forward compatible, the implementation MUST ignore unknown parameters. cannam@86: cannam@86: cannam@86:
cannam@86: cannam@86: cannam@86: The information carried in the Media Type specification has a cannam@86: specific mapping to fields in the Session Description cannam@86: Protocol (SDP), which is commonly used to describe RTP sessions. cannam@86: When SDP is used to specify sessions, the mapping are as follows: cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: The type name ("audio") goes in SDP "m=" as the media name. cannam@86: cannam@86: The subtype name ("vorbis") goes in SDP "a=rtpmap" as the encoding name. cannam@86: cannam@86: The parameter "rate" also goes in "a=rtpmap" as the clock rate. cannam@86: cannam@86: The parameter "channels" also goes in "a=rtpmap" as the channel count. cannam@86: cannam@86: The mandated parameters "configuration" MUST be included in the SDP cannam@86: "a=fmtp" attribute. cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: If the stream comprises chained Vorbis files and all of them are known in cannam@86: advance, the Configuration Packet for each file SHOULD be passed to the client cannam@86: using the configuration attribute. cannam@86: cannam@86: cannam@86: cannam@86: The port value is specified by the server application bound to the address cannam@86: specified in the c= line. The channel count value specified in the rtpmap cannam@86: attribute SHOULD match the current Vorbis stream or should be considered the maximum cannam@86: number of channels to be expected. The timestamp clock rate MUST be a multiple cannam@86: of the sample rate; a different payload number MUST be used if the clock rate cannam@86: changes. The Configuration payload delivers the exact information, thus the cannam@86: SDP information SHOULD be considered a hint. cannam@86: An example is found below. cannam@86: cannam@86: cannam@86:
cannam@86: The following example shows a basic SDP single stream. The first cannam@86: configuration packet is inside the SDP; other configurations could be cannam@86: fetched at any time from the URIs provided. The following cannam@86: base64 configuration string is folded in this cannam@86: example due to RFC line length limitations. cannam@86: cannam@86: cannam@86: cannam@86: c=IN IP4 192.0.2.1 cannam@86: m=audio RTP/AVP 98 cannam@86: a=rtpmap:98 vorbis/44100/2 cannam@86: a=fmtp:98 configuration=AAAAAZ2f4g9NAh4aAXZvcmJpcwA...; cannam@86: cannam@86:
cannam@86: cannam@86: cannam@86: Note that the payload format (encoding) names are commonly shown in uppercase. cannam@86: Media Type subtypes are commonly shown in lowercase. These names are cannam@86: case-insensitive in both places. Similarly, parameter names are cannam@86: case-insensitive both in Media Type types and in the default mapping to the SDP cannam@86: a=fmtp attribute. The a=fmtp line is a single line, even if it is shown as multiple lines in this document for clarity. cannam@86: cannam@86: cannam@86:
cannam@86: cannam@86:
cannam@86: cannam@86: cannam@86: There are no negotiable parameters. All of them are declarative. cannam@86: cannam@86: cannam@86:
cannam@86: cannam@86:
cannam@86:
cannam@86: cannam@86: The general congestion control considerations for transporting RTP cannam@86: data apply to Vorbis audio over RTP as well. See the RTP specification cannam@86: and any applicable RTP profile (e.g., ). cannam@86: Audio data can be encoded using a range of different bit rates, so cannam@86: it is possible to adapt network bandwidth by adjusting the encoder cannam@86: bit rate in real time or by having multiple copies of content encoded cannam@86: at different bit rates. cannam@86: cannam@86:
cannam@86:
cannam@86: cannam@86: cannam@86: The following example shows a common usage pattern that MAY be applied in cannam@86: such a situation. The main scope of this section is to explain better usage cannam@86: of the transmission vectors. cannam@86: cannam@86: cannam@86:
cannam@86: cannam@86: This is one of the most common situations: there is one single server streaming cannam@86: content in multicast, and the clients may start a session at a random time. The cannam@86: content itself could be a mix of a live stream (as the webjockey's voice) cannam@86: and stored streams (as the music she plays). cannam@86: cannam@86: In this situation, we don't know in advance how many codebooks we will use. cannam@86: The clients can join anytime and users expect to start listening to the content cannam@86: in a short time. cannam@86: cannam@86: Upon joining, the client will receive the current Configuration necessary to cannam@86: decode the current stream inside the SDP so that the decoding will start cannam@86: immediately after. cannam@86: cannam@86: When the streamed content changes, the new Configuration is sent in-band cannam@86: before the actual stream, and the Configuration that has to be sent inside cannam@86: the SDP is updated. Since the in-band method is unreliable, an out-of-band cannam@86: fallback is provided. cannam@86: cannam@86: The client may choose to fetch the Configuration from the alternate source cannam@86: as soon as it discovers a Configuration packet got lost in-band, or use cannam@86: selective retransmission if the server supports cannam@86: this feature. cannam@86: cannam@86: A server-side optimization would be to keep a hash list of the cannam@86: Configurations per session, which avoids packing all of them and sending the same cannam@86: Configuration with different Ident tags. cannam@86: cannam@86: A client-side optimization would be to keep a tag list of the Configurations cannam@86: per session and not process configuration packets that are already known. cannam@86: cannam@86:
cannam@86:
cannam@86: cannam@86:
cannam@86: cannam@86: RTP packets using this payload format are subject to the security cannam@86: considerations discussed in the cannam@86: RTP specification, the cannam@86: base64 specification, and the cannam@86: URI Generic syntax specification. cannam@86: Among other considerations, this implies that the confidentiality of the cannam@86: media stream is achieved by using encryption. Because the data compression used cannam@86: with this payload format is applied end-to-end, encryption may be performed on cannam@86: the compressed data. cannam@86: cannam@86: cannam@86:
cannam@86:
cannam@86: The authors agree to grant third parties the irrevocable right to copy, cannam@86: use, and distribute the work, with or without modification, in any medium, cannam@86: without royalty, provided that, unless separate permission is granted, cannam@86: redistributed modified works do not contain misleading author, version, cannam@86: name of work, or endorsement information. cannam@86:
cannam@86:
cannam@86: cannam@86: cannam@86: This document is a continuation of the following documents: cannam@86: cannam@86: Moffitt, J., "RTP Payload Format for Vorbis Encoded Audio", February 2001. cannam@86: cannam@86: Kerr, R., "RTP Payload Format for Vorbis Encoded Audio", December 2004. cannam@86: cannam@86: The Media Type declaration is a continuation of the following cannam@86: document: cannam@86: Short, B., "The audio/rtp-vorbis MIME Type", January 2008. cannam@86: cannam@86: cannam@86: cannam@86: Thanks to the AVT, Vorbis Communities / Xiph.Org Foundation including Steve Casner, cannam@86: Aaron Colwell, Ross Finlayson, Fluendo, Ramon Garcia, Pascal Hennequin, Ralph cannam@86: Giles, Tor-Einar Jarnbjo, Colin Law, John Lazzaro, Jack Moffitt, Christopher cannam@86: Montgomery, Colin Perkins, Barry Short, Mike Smith, Phil Kerr, Michael Sparks, cannam@86: Magnus Westerlund, David Barrett, Silvia Pfeiffer, Stefan Ehmann, Gianni Ceccarelli and Alessandro Salvatori. Thanks to the LScube Group, in particular Federico cannam@86: Ridolfo, Francesco Varano, Giampaolo Mancini, Dario Gallucci, and Juan Carlos De Martin. cannam@86: cannam@86: cannam@86:
cannam@86: cannam@86:
cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: Ogg Vorbis I specification: Codec setup and packet decode. Available from the Xiph website, http://xiph.org/vorbis/doc/Vorbis_I_spec.html cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: libvorbis: Available from the dedicated website, http://vorbis.com/ cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: cannam@86: