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