The Codecs Parameter for "Bucket" Media Types
obsoleted by
- rfc-6381 — The 'Codecs' and 'Profiles' Parameters for "Bucket" Media Types
Extracted elements (19)
The 'codecs' parameter was introduced because several MIME type/subtype combinations ('bucket' types such as audio/3gpp, video/3gpp2) can contain any of several different codecs, making it impossible to determine rendering requirements from the Content-Type alone without parsing the media body. This is especially costly for MMS servers and constrained devices.
For ISO file formats where the namespace defined here is insufficient, a new document MAY update this one by specifying additional namespace detail. For non-ISO formats, a new document MAY update this one by specifying the name space for those media types.
Not all codecs listed in the Codecs parameter are necessarily required to render the content (e.g., alternative audio tracks, optional timed text). Receivers that lack support for a listed codec MAY need to examine the media elements to determine if the unsupported codec is actually required.
If a receiver encounters a body part whose Codecs parameter does not contain all codecs indicated by the media elements, the receiver MAY process the body part by discarding the Codecs parameter information.
Implementations MUST NOT add CFWS (comment/folding whitespace) between tokens in the Codecs parameter value except after a comma separator.
Systems MUST NOT rely on the Codecs parameter being complete in 'depth'; although it must report all four-character codes used in all tracks (breadth), a server implemented before hierarchical rules for a given code were written will not know what sub-elements to include.
The Codecs parameter MAY be specified for use with additional MIME media types beyond the four listed. For existing media types the parameter is generally advisable to be optional; for new media types it MAY be optional or required as appropriate.
The Codecs parameter MUST NOT include any codecs that are not indicated by any media elements in the body part.
When the Codecs parameter is used, it MUST contain all codecs indicated by the content present in the body part.
For 'mp4a' with OTI value 40 (MPEG-4 audio), a third element identifies the audio ObjectTypeIndication as a decimal number per ISO 14496-3; for example, AAC-LC is encoded as 'mp4a.40.2'.
For 'mp4v' with OTI value 20 (MPEG-4 part-2 video), a third element identifies the video ProfileLevelIndication as a decimal number per ISO 14496-2; for example, MPEG-4 Visual Simple Profile Level 0 is 'mp4v.20.9'.
For the ISO Base Media File Format family, the first element of a Codecs parameter value is a four-character sample description entry code as registered by the MP4 Registration Authority. Values are case sensitive.
In the encoded (fancy) form, the parameter name becomes 'codecs*' with an asterisk suffix, the value typically begins with two single-quote characters indicating no charset or language, and octets requiring encoding are percent-encoded. The percent sign, asterisk, and single quote themselves must be percent-encoded.
The 'codecs' parameter is defined as optional for audio/3gpp, audio/3gpp2, video/3gpp, and video/3gpp2 MIME types. Its value is a single codec identifier or a comma-separated list of dot-hierarchical codec identifiers indicating all codecs required to render the body part.
When the first element is 'mp4a' (MPEG-4 audio) or 'mp4v' (MPEG-4 part-2 video), the second element is the two-hex-digit MP4 Registration Authority ObjectTypeIndication (OTI) without a leading '0x' prefix.
IANA added 'codecs' as an optional parameter to audio/3gpp, audio/3gpp2, video/3gpp, and video/3gpp2 media type registrations, with a reference to RFC 4281.
The Codecs parameter does not alter the inherent security considerations of the media types it annotates; each media type retains its own security properties. An incorrect Codecs parameter can cause content to be delivered to incapable devices or withheld from capable ones, enabling limited denial-of-service; however, an attacker with the ability to alter the parameter could cause greater harm by modifying the media content or Content-Type header directly.
ISO syntax: 'cpid' is exactly 4 octet-simple or octet-fancy characters (the four-character code); 'oti' is exactly 2 hex digits (A-F uppercase); 'aud-oti' and 'vid-pli' are one or more decimal digits. The BNF grammar in Section 3.3 refines the generic grammar for ISO file formats.
The Codecs parameter takes two forms: 'cod-simple' (codecs=unencodedv) for values without octets requiring encoding, and 'cod-fancy' (codecs*=encodedv) using RFC 2231 MIME parameter encoding. A dot ('.') is reserved as a hierarchy delimiter within element values.