rfc-5215

RTP Payload Format for Vorbis Encoded Audio

L. Barbato
date2008-08 streamIETF arearai wgavt statusPROPOSED STANDARD pages26 canonicalhttps://www.rfc-editor.org/rfc/rfc5215 doi10.17487/RFC5215 errataview
This document describes an RTP payload format for transporting Vorbis encoded audio. It details the RTP encapsulation mechanism for raw Vorbis data and the delivery mechanisms for the decoder probability model (referred to as a codebook), as well as other setup information. Also included within this memo are media type registrations and the details necessary for the use of Vorbis with the Session Description Protocol (SDP). [STANDARDS-TRACK]

Extracted elements (25)

design-rationale §1

The Ogg framing layer is stripped for RTP transport because it provides framing and synchronization that is unnecessary when RTP is used. Raw Vorbis packets are used directly in the payload instead.

rtp, realtime

design-rationale §3.2

The recommended configuration delivery vector is the SDP 'configuration' attribute using a reliable transport, because the codebooks must be received before decoding can begin and in-band delivery over RTP (UDP) is unreliable. In-band delivery is retained as a fallback for mid-session configuration changes.

rtp, realtime

design-rationale §3

Unlike other mainstream audio codecs, Vorbis has no statically configured probability model; all entropy decoding configuration (VQ and Huffman models) must be transmitted to the decoder as codebook headers before any audio can be decoded. This necessitates special in-band and out-of-band delivery mechanisms for configuration data in RTP.

rtp, realtime

interoperability-note §7.1

The SDP channel count in the 'a=rtpmap' attribute SHOULD match the current Vorbis stream or be considered the maximum expected channel count. The Configuration payload delivers exact information, so SDP information SHOULD be considered a hint only.

rtp, realtime

normative-requirement §2.2 MUST

An RTP payload MUST contain just one type of Vorbis data at a time; aggregating configuration and comment packets in the same RTP payload is prohibited.

rtp, realtime

normative-requirement §5 MUST

For fragmented packets, consecutive fragments MUST be sent without any other payload between the first and last fragment. The timestamp MUST be the same as the first packet sent across all fragments, while the sequence number increments normally.

rtp, realtime

normative-requirement §7 MUST

Implementations MUST ignore unknown SDP parameters to ensure forward compatibility.

rtp, realtime

normative-requirement §5.2 MUST

In case of fragment loss, the client MUST discard all remaining Vorbis fragments associated with a fragmented packet and decode the incomplete packet. Fragments with continuation type (F=2) or end type (F=3) received without a corresponding start fragment (F=1) MUST be dropped.

rtp, realtime

normative-requirement §2.2 MUST

Packets with a VDT value of 3 (reserved) MUST be ignored by receivers.

rtp, realtime

normative-requirement §2.3 MUST

Payload data packing MUST follow RFC 3551 guidelines, with the oldest Vorbis packet immediately after the RTP header; subsequent Vorbis packets MUST follow in temporal order.

rtp, realtime

normative-requirement §2.1 MUST

The RTP timestamp clock frequency MUST be set to the sample rate of the encoded audio data and is conveyed out-of-band (e.g., as an SDP parameter).

rtp, realtime

normative-requirement §7.1 MUST

The SDP 'configuration' parameter (base64-encoded Packed Headers) MUST be included in the SDP 'a=fmtp' attribute. The timestamp clock rate MUST be a multiple of the sample rate; a different payload number MUST be used if the clock rate changes.

rtp, realtime

normative-requirement §3 MUST

The Vorbis configuration MUST be conveyed via the signalling channel (e.g., SDP) used to set up the session as initial state. Implementations MUST support in-band delivery of updated codebooks and SHOULD support out-of-band codebook update using a new SDP file.

rtp, realtime

normative-requirement §3.3 SHOULD

Upon loss of configuration headers, the baseline reaction SHOULD either reset or end the RTP session. Implementations MAY try to recover by re-requesting the missing Configuration or buffering payloads while waiting for the needed Configuration.

rtp, realtime

normative-requirement §2.3 SHOULD

Vorbis data packet size SHOULD be kept sufficiently small so that after adding RTP and payload headers, the complete RTP packet is smaller than the path MTU, to avoid fragmentation.

rtp, realtime

normative-requirement §3 MUST

When the Ident field changes, indicating a stream configuration change, the client MUST have the correct configuration in advance. If the client detects a changed Ident value for which it lacks the configuration, it MUST NOT decode the associated raw Vorbis data until it fetches the correct Configuration.

rtp, realtime

protocol-element §3.1.1

A Vorbis Packed Configuration (VDT=1) packs the Identification and Setup headers (which MUST be packed as-is) and a Comment header (which MAY be replaced with a dummy). The count and length fields use a variable-length encoding where the MSB of each byte is a continuation flag and the lower 7 bits carry data.

rtp, realtime

protocol-element §2

The RTP payload format for Vorbis consists of a standard RTP header followed by a 4-octet payload header (Ident: 24 bits, Fragment type F: 2 bits, Vorbis Data Type VDT: 2 bits, packet count: 4 bits), then payload data. There are 3 types of Vorbis data and an RTP payload MUST contain just one at a time.

rtp, realtime

registry §6.1

This document registers the 'audio/vorbis-config' media type for the Packed Headers configuration data used in out-of-band delivery. This type has no required or optional parameters and is not transport-dependent.

registry, rtp, realtime

registry §6

This document registers the 'audio/vorbis' media type with required parameters 'rate' (RTP timestamp clock rate), 'channels' (number of audio channels), and 'configuration' (base64-encoded Packed Headers). Transfer is only defined via RTP.

registry, rtp, realtime

security-consideration §10

RTP packets using this payload format are subject to the security considerations of RFC 3550, RFC 4648, and RFC 3986. Confidentiality of the media stream is achieved using encryption, which may be applied to the compressed data end-to-end since compression is applied end-to-end.

security, rtp, realtime

state-machine §5

Fragment reassembly follows a state based on the Fragment type field: a packet with F=1 (Start) begins a fragment sequence; F=2 (Continuation) extends it; F=3 (End) completes it. If any fragment is lost, all remaining fragments for that Vorbis packet must be discarded.

rtp, realtime

wire-format §2.3

Each Vorbis payload packet begins with a 2-octet length header (network byte order) indicating the size in bytes of the following Vorbis data, followed by the raw Vorbis data padded to the nearest byte boundary. The length value excludes the length field itself.

rtp, realtime

wire-format §3.2.1

The out-of-band Packed Headers format starts with a 32-bit (network byte order) count of packed headers, followed by each packed header containing a 24-bit Ident, a variable-length 2-byte length tag, a header count, per-header length fields, and then the Identification, Comment, and Setup headers in order.

rtp, realtime

wire-format §2.2

The Payload Header is 4 octets: a 24-bit Ident field (network byte order) identifying the decoding configuration, a 2-bit Fragment type field (0=not fragmented, 1=start, 2=continuation, 3=end), a 2-bit Vorbis Data Type field (0=raw, 1=packed config, 2=legacy comment, 3=reserved), and a 4-bit packet count field (max 15 packets; set to 0 for fragmented data).

rtp, realtime