Embedding Video natively into HTML is a dream come true, finally, with HTML5. But the video tag has it's own quirks. While Firefox mostly asks for ogg/theora video+audio and "just works", serving the right video to Apple+Safari users or users with Opera, IE, etc. on all sorts of hardware/devices gives us cause for new headaches - well, currently. [Fingers crossed for the future.]
For example, a tag like
serves Apple devices well [via]. The iPhone 3 pulls Baseline content, iPad grabs the Main version. Nice. A mixed Firefox/everyone-else tag looks like this:
Here we got a mute video file, thus codecs only "theora", no "vorbis", contained in an .ogg file, named .ogv [ogg video]. For devices/browsers/platforms not understanding .ogg, we offer .mp4 video here. But wait, what's this "avc.4D401F" string? Well, it tells browsers what Profile the mp4 file is in. How do you get that right? Well, the cypher seems to be "The video codec for H.264 is: avc1.YYYYXX where YYYY represents the profile, while XX is the level [multiplied by 10 and turned into HEX]:" [via]
Profile Value Baseline 42E0 Main 4D40 High 6400 Extended 58A0 Level Hex Value 3.0 1E 3.1 1F 4.1 29 5.1 33
But what is the Profile and Level? Head over to get an understanding, and then to . And use avconv / ffmpeg to find out about the type of video. So here, we have "avc1" video, which is for "H.264/MPEG-4 Part 10 or AVC [Advanced Video Coding]" in Main Profile [= 4D40] with Level 3.1 [=1F] -> "avc1.4D401F", nothing else, as this is a mute video, no audio, nothing like the second codec hint "mp4a.40.2" in the first tag above.
At a fundamental level, you can specify the type of a media file using a simple MIME type, such asvideo/mp4
oraudio/mpeg
. However, many media types—especially those that support video tracks—can benefit from the ability to more precisely describe the format of the data within them. For instance, just describing a video in an file with the MIME typevideo/mp4
doesn't say anything about what format the actual media within takes. For that reason, thecodecs
parameter can be added to the MIME type describing media content. With it, container-specific information can be provided. This information may include things like the profile of the video codec, the type used for the audio tracks, and so forth. This guide briefly examines the syntax of the media typecodecs
parameter and how it's used with the MIME type string to provide details about the contents of audio or video media beyond indicating the container type. The MIME type for a container format is expressed by stating the type of media [audio
,video
, etc.], then a slash character [mp4a.oo[.A]
0], then the format used to contain the media:
An audio file using the file type, such as an MP3.
A video file using the file type.
A video file using the file type.
A video file in Apple's format. As noted elsewhere, this format was once commonly used on the web but no longer is, since it required a plugin to use.
However, each of these MIME types is vague. All of these file types support a variety of codecs, and those codecs may have any number of profiles, levels, and other configuration factors. For this reason, you may want to include thecodecs
parameter along with the media type. You can add thecodecs
parameter to the media type. To do so, append a semicolon [mp4a.oo[.A]
- followed by
mp4a.oo[.A]
8 and then the string describing the format of the contents of the file. Some media types only let you specify the names of the codecs to use, while others allow you to specify various constraints on those codecs as well. You can specify multiple codecs by separating them with commas.
An file containing a audio track.
A file containing video and/or audio.
An file containing [H.264] video, Main Profile, Level 4.2.
As is the case with any MIME type parameter,codecs
must be changed tocccc.PP.LL.DD cccc.PP.LL.DD.CC.cp.tc.mc.FF
3 [note the asterisk character,
cccc.PP.LL.DD cccc.PP.LL.DD.CC.cp.tc.mc.FF
- if any of the properties of the codec use special characters which must be percent-encoded per . You can use the JavaScript
cccc.PP.LL.DD cccc.PP.LL.DD.CC.cp.tc.mc.FF
5 function to encode the parameter list; similarly, you can use
cccc.PP.LL.DD cccc.PP.LL.DD.CC.cp.tc.mc.FF
6 to decode a previously encoded parameter list.
Note: When thecodecs
parameter is used, the specified list of codecs must include every codec used for the contents of the file. The list may also contain codecs not present in the file. The containers below support extended codec options in theircodecs
parameters:Several of the links above go to the same section; that's because those media types are all based on ISO Base Media File Format [ISO BMFF], so they share the same syntax.
The syntax of thecodecs
parameter for AV1 is defined the AV1 Codec ISO Media File Format Binding specification, section 5: .av01.P.LLT.DD[.M.CCC.cp.tc.mc.F]
Note: Chromium-based browsers will accept any subset of the optional parameters [rather than all or none, as required by the specification].
This codec parameter string's components are described in more detail in the table below. Each component is a fixed number of characters long; if the value is less than that length, it must be padded with leading zeros.
AV1 codec parameter string components Component Details`video/mp4`0
The one-digit profile number:
AV1 profile numbers Profile number Description 0 "Main" profile; supports YUV 4:2:0 or monochrome bitstreams with bit depth of 8 or 10 bits per component. 1 "High" profile adds support for 4:4:4 chroma subsampling. 2 "Professional" profile adds support for 4:2:2 chroma subsampling and 12-bit per component color.video/mp4`1 The two-digit level number, which is converted to the X.Y format level format, where `video/mp4`2 and `video/mp4`3. See in the AV1 Specification for details.`video/mp4`4 The one-character tier indicator. For the Main tier [`video/mp4`5 equals 0], this character is the letter `video/mp4`6. For the High tier [`video/mp4`5 is 1], this character is the letter `video/mp4`8. The High tier is only available for level 4.0 and up.`video/mp4`9 The two-digit component bit depth. This value must be one of 8, 10, or 12; which values are valid varies depending on the profile and other properties.`video/mp4`6 The one-digit monochrome flag; if this is 0, the video includes the U and V planes in addition to the Y plane. Otherwise, the video data is entirely in the Y plane and is therefore monochromatic. See [YUV][/en-US/docs/Web/Media/Formats/Video_concepts
parameter. These media types include [and, in fact, the file format upon which MPEG-4 is based] as well as . Both video and audio tracks can be described using theyuv] for details on how the YUV color system works. The default value is 0 [not monochrome].`audio/mpeg`1
`audio/mpeg`1 indicates the chroma subsampling as three digits. The first digit is `audio/mpeg`3, the second is `audio/mpeg`4. If both of those are 1, the third is the value of `audio/mpeg`5; otherwise, the third digit is always 0. This, combined with the `video/mp4`6 component, can be used to construct the chroma subsampling format:
Determining the chroma subsampling format subsampling_x subsampling_y Monochrome flag Chroma subsampling format 0 0 0 YUV 4:4:4 1 0 0 YUV 4:2:2 1 1 0 YUV 4:2:0 1 1 1 YUV 4:0:0 [Monochrome]
The third digit in `audio/mpeg`1 indicates the chroma sample position, with a value of 0 indicating that the position is unknown and must be separately provided during decoding; a value of 1 indicating that the sample position is horizontally collocated with the [0, 0] luma sample; and a value of 2 indicating that the sample position is collocated with [0, 0] luma.
The default value is `audio/mpeg`8 [4:2:0 chroma subsampling].
`audio/mpeg`9 The two-digit `video/mp4`0 value indicates the color system used by the media. For example, BT.2020/BT.2100 color, as used for HDR video, is `video/mp4`1. The information for this—and for each of the remaining components—is found in the of the AV1 specification. The default value is `video/mp4`2 [ITU-R BT.709].`video/mp4`3 The two-digit `video/mp4`4 value. This value defines the function used to map the gamma [delightfully called the "opto-electrical transfer function" in technical parlance] from the source to the display. For example, 10-bit BT.2020 is `video/mp4`5. The default value is `video/mp4`2 [ITU-R BT.709].`video/mp4`7 The two-digit `video/mp4`8 constant selects the matrix coefficients used to convert the red, blue, and green channels into luma and chroma signals. For example, the standard coefficients used for BT.709 are indicated using the value `video/mp4`2. The default value is `video/mp4`2 [ITU-R BT.709].`codecs`1 A one-digit flag indicating whether the color should be allowed to use the full range of possible values [`codecs`2], or should be constrained to those values considered legal for the specified color configuration [that is, the studio swing representation]. The default is 0 [use the studio swing representation].
All fields from `video/mp4`6 [monochrome flag] onward are optional; you may stop including fields at any point [but can't arbitrarily leave out fields]. The default values are included in the table above. Some example AV1 codec strings:
AV1 Professional Profile, level 5.3, Main tier, 10 bits per color component, 4:2:2 chroma subsampling using ITU-R BT.2100 color primaries, transfer characteristics, and YCbCr color matrix. The studio swing representation is indicated.
AV1 Main Profile, level 5.3, Main tier, 10 bits per color component. The remaining properties are taken from the defaults: 4:2:0 chroma subsampling, BT.709 color primaries, transfer characteristics, and matrix coefficients. Studio swing representation.
All media types based upon the ISO Base Media File Format [ISO BMFF] share the same syntax for the `codecscodecs
parameter with the following MIME types: MIME type Description`codecs`8 3GP audio [RFC 3839: MIME Type Registrations for 3rd generation Partnership Project [3GP] Multimedia files]codecs`9 3GP video [RFC 3839: MIME Type Registrations for 3rd generation Partnership Project [3GP] Multimedia files]`codecs`0 3GP2 audio [RFC 4393: MIME Type Registrations for 3GPP2 Multimedia files]`codecs`1 3GP2 video [RFC 4393: MIME Type Registrations for 3GPP2 Multimedia files]`codecs`2 MP4 audio [RFC 4337: MIME Type Registration for MPEG-4]`video/mp4
MP4 video [RFC 4337: MIME Type Registration for MPEG-4]codecs`4 Non-audiovisual media encapsulated in MPEG-4 Each codec described by the `codecs
parameter can be specified either as the container's name [codecs`6, `codecs`7, `codecs`8, etc.] or as the container name plus additional parameters to specify the codec and its configuration. Each entry in the codec list may contain some number of components, separated by periods [`codecs`9]. The syntax for the value of `codecs
varies by codec; however, it always starts with the codec's four-character identifier, a period separator [codecs`9], followed by the Object Type Indication [OTI] value for the specific data format. For most codecs, the OTI is a two-digit hexadecimal number; however, it's six hexadecimal digits for .
parameter, as well as the value to specify for the constraints component,Thus, the syntaxes for each of the supported codecs look like this:
[Generic ISO BMFF]
Where `audio`3 is the four-character ID for the codec and `audio`4 is where zero or more two-character encoded property values go.
[MPEG-4 audio]
Where `audio`6 is the Object Type Indication value describing the contents of the media more precisely and `audio`7 is the one-digit audio OTI. The possible values for the OTI can be found on the MP4 Registration Authority website's . For example, Opus audio in an MP4 file is `audio`8. For further details, see .
[MPEG-4 video]
Here, `audio`6 is again the OTI describing the contents more precisely, while `video`1 is the one-digit video OTI.
[AVC video]
`video`3 are six hexadecimal digits specifying the profile number [`video`4], constraint set flags [`video`5], and level [`video/mp4`1]. See for the possible values of `video`4.
The constraint set flags byte is comprised of one-bit Boolean flags, with the most significant bit being referred to as flag 0 [or `video`8, in some resources], and each successive bit being numbered one higher. Currently, only flags 0 through 2 are used; the other five bits must be zero. The meanings of the flags vary depending on the profile being used.
The level is a fixed-point number, so a value of `video/mp4`5 [decimal 20] means level 2.0 while a value of
mp4a.oo[.A]
00 [decimal 61] means level 6.1. Generally speaking, the higher the level number, the more bandwidth the stream will use and the higher the maximum video dimensions are supported.
AVC profiles
The following are the AVC profiles and their profile numbers for use in the `codecsvideo`5.
list begins withProfile Number [Hex] Constraints byte Constrained Baseline Profile [CBP] CBP is primarily a solution for scenarios in which resources are constrained, or resource use needs to be controlled to minimize the odds of the media performing poorly.
mp4a.oo[.A]
03
mp4a.oo[.A]
04 Baseline Profile [BP] Similar to CBP but with more data loss protections and recovery capabilities. This is not as widely used as it was before CBP was introduced. All CBP streams are considered to also be BP streams.
mp4a.oo[.A]
03
mp4a.oo[.A]
06 Extended Profile [XP] Designed for streaming video over the network, with high compression capability and further improvements to data robustness and stream switching.
mp4a.oo[.A]
07
mp4a.oo[.A]
06 Main Profile [MP] The profile used for standard-definition digital television being broadcast in MPEG-4 format. Not used for high-definition television broadcasts. This profile's importance has faded since the introduction of the High Profile—which was added for HDTV use—in 2004.
mp4a.oo[.A]
09
mp4a.oo[.A]
06 High Profile [HiP] Currently, HiP is the primary profile used for broadcast and disc-based HD video; it's used both for HD TV broadcasts and for Blu-Ray video.
mp4a.oo[.A]
11
mp4a.oo[.A]
06 Progressive High Profile [PHiP] Essentially High Profile without support for field coding.
mp4a.oo[.A]
11
mp4a.oo[.A]
14 Constrained High Profile PHiP, but without support for bi-predictive slices ["B-slices"].
mp4a.oo[.A]
11
mp4a.oo[.A]
16 High 10 Profile [Hi10P] High Profile, but with support for up to 10 bits per color component.
mp4a.oo[.A]
17
mp4a.oo[.A]
06 High 4:2:2 Profile [Hi422P] Expands upon Hi10P by adding support for 4:2:2 chroma subsampling along with up to10 bits per color component.
mp4a.oo[.A]
19
mp4a.oo[.A]
06 High 4:4:4 Predictive Profile [Hi444PP] In addition to the capabilities included in Hi422P, Hi444PP adds support for 4:4:4 chroma subsampling [in which no color information is discarded]. Also includes support for up to 14 bits per color sample and efficient lossless region coding. The option to encode each frame as three separate color planes [that is, each color's data is stored as if it were a single monochrome frame].
mp4a.oo[.A]
21
mp4a.oo[.A]
06 High 10 Intra Profile High 10 constrained to all-intra-frame use. Primarily used for professional apps.
mp4a.oo[.A]
17
mp4a.oo[.A]
24 High 4:2:2 Intra Profile The Hi422 Profile with all-intra-frame use.
mp4a.oo[.A]
19
mp4a.oo[.A]
24 High 4:4:4 Intra Profile The High 4:4:4 Profile constrained to use only intra frames.
mp4a.oo[.A]
21
mp4a.oo[.A]
24 CAVLC 4:4:4 Intra Profile The High 4:4:4 Profile constrained to all-intra use, and to using only CAVLC entropy coding.
mp4a.oo[.A]
29
mp4a.oo[.A]
06 Scalable Baseline Profile Intended for use with video conferencing as well as surveillance and mobile uses, the SVC Baseline Profile is based on AVC's Constrained Baseline profile. The base layer within the stream is provided at a high quality level, with some number of secondary substreams that offer alternative forms of the same video for use in various constrained environments. These may include any combination of reduced resolution, reduced frame rate, or increased compression levels.
mp4a.oo[.A]
31
mp4a.oo[.A]
06 Scalable Constrained Baseline Profile Primarily used for real-time communication applications. Not yet supported by WebRTC, but an extension to the WebRTC API to allow SVC is in development.
mp4a.oo[.A]
31
mp4a.oo[.A]
34 Scalable High Profile Meant mostly for use in broadcast and streaming applications. The base [or highest quality] layer must conform to the AVC High Profile.
mp4a.oo[.A]
35
mp4a.oo[.A]
06 Scalable Constrained High Profile A subset of the Scalable High Profile designed mainly for real-time communication.
mp4a.oo[.A]
35
mp4a.oo[.A]
34 Scalable High Intra Profile Primarily useful only for production applications, this profile supports only all-intra usage.
mp4a.oo[.A]
35
mp4a.oo[.A]
40 Stereo High Profile The Stereo High Profile provides stereoscopic video using two renderings of the scene [left eye and right eye]. Otherwise, provides the same features as the High profile.
mp4a.oo[.A]
41
mp4a.oo[.A]
06 Multiview High Profile Supports two or more views using both temporal and MVC inter-view prediction. Does not support field pictures or macroblock-adaptive frame-field coding.
mp4a.oo[.A]
43
mp4a.oo[.A]
06 Multiview Depth High Profile Based on the High Profile, to which the main substream must adhere. The remaining substreams must match the Stereo High Profile.
mp4a.oo[.A]
45
mp4a.oo[.A]
06
MPEG-4 audio
When the value of an entry in the `codecsmp4a.oo[.A]
48, the syntax of the value should be:
mp4a.oo[.A]
Here,audio`6 is the two-digit hexadecimal Object Type Indication which specifies the codec class being used for the media. The OTIs are assigned by the MP4 Registration Authority, which maintains a . A special value is
parameter, which use hexadecimal]. For example, MPEG-4's AAC-LC has an audio object type number ofmp4a.oo[.A]
04; this indicates that the media is MPEG-4 audio [ISO/IEC 14496 Part 3]. In order to be more specific still, a third component—the Audio Object Type—is added for OTI
mp4a.oo[.A]
04 to narrow the type down to a specific subtype of MPEG-4.
The Audio Object Type is specified as a one or two digit decimal value [unlike most other values in the `codecsmp4a.oo[.A]
53, so the fullcodecs
value representing AAC-LC ismp4a.oo[.A]
55.
Thus, ER AAC LC, whose Audio Object Type is 17, can be represented using the fullcodecs
valuemp4a.oo[.A]
57. Single digit values can be given either as one digit [which is the best choice, since it will be the most broadly compatible] or with a leading zero padding it to two digits, such as
mp4a.oo[.A]
58.
Note: The specification originally mandated that the Audio Object Type number in the third component be only one decimal digit. However, amendments to the specification over time extended the range of these values well beyond one decimal digit, so now the third parameter may be either one or two digits. Padding values below 10 with a leading
mp4a.oo[.A]
59 is optional. Older implementations of MPEG-4 codecs may not support two-digit values, however, so using a single digit when possible will maximize compatibility.
The Audio Object Types are defined in ISO/IEC 14496-3 subpart 1, section 1.5.1. The table below provides a basic list of the Audio Object Types and in the case of the more common object types provides a list of the profiles supporting it, but you should refer to the specification for details if you need to know more about the inner workings of any given MPEG-4 audio type.
MPEG-4 audio object types ID Audio Object Type Profile support
mp4a.oo[.A]
59 NULL`codecs`2 AAC Main Main
mp4a.oo[.A]
53 AAC LC [Low Complexity] Main, Scalable, HQ, LD v2, AAC, HE-AAC, HE-AAC v2
mp4a.oo[.A]
63 AAC SSR [Scalable Sampling Rate] Main
mp4a.oo[.A]
64 AAC LTP [Long Term Prediction] Main, Scalable, HQ
mp4a.oo[.A]
65 SBR [Spectral Band Replication] HE-AAC, HE-AAC v2
mp4a.oo[.A]
66 AAC Scalable Main, Scalable, HQ
mp4a.oo[.A]
67 TwinVQ [Coding for ultra-low bit rates] Main, Scalable
mp4a.oo[.A]
68 CELP [Code-Excited Linear Prediction] Main, Scalable, Speech, HQ, LD
mp4a.oo[.A]
69 HVXC [Harmonic Vector Excitation Coding] Main, Scalable, Speech, LD
mp4a.oo[.A]
24 –
mp4a.oo[.A]
71 Reserved
mp4a.oo[.A]
72 TTSI [Text to Speech Interface] Main, Scalable, Speech, Synthetic, LD
mp4a.oo[.A]
73 Main Synthetic Main, Synthetic`video/mp4`5 Wavetable Synthesis
mp4a.oo[.A]
75 General MIDI
mp4a.oo[.A]
76 Algorithmic Synthesis and Audio Effects
mp4a.oo[.A]
77 ER AAC LC [Error Resilient AAC Low-Complexity] HQ, Mobile Internetworking
mp4a.oo[.A]
78 Reserved
mp4a.oo[.A]
79 ER AAC LTP [Error Resilient AAC Long Term Prediction] HQ
mp4a.oo[.A]
40 ER AAC Scalable [Error Resilient AAC Scalable] Mobile Internetworking
mp4a.oo[.A]
81 ER TwinVQ [Error Resilient TwinVQ] Mobile Internetworking
mp4a.oo[.A]
82 ER BSAC [Error Resilient Bit-Sliced Arithmetic Coding] Mobile Internetworking
mp4a.oo[.A]
83 ER AAC LD [Error Resilient AAC Low-Delay; used for two-way communication] LD, Mobile Internetworking
mp4a.oo[.A]
84 ER CELP [Error Resilient Code-Excited Linear Prediction] HQ, LD
mp4a.oo[.A]
85 ER HVXC [Error Resilient Harmonic Vector Excitation Coding] LD
mp4a.oo[.A]
86 ER HILN [Error Resilient Harmonic and Individual Line plus Noise]
mp4a.oo[.A]
87 ER Parametric [Error Resilient Parametric]
mp4a.oo[.A]
88 SSC [Sinusoidal Coding]
mp4a.oo[.A]
89 PS [Parametric Stereo] HE-AAC v2
mp4a.oo[.A]
90 MPEG Surround
mp4a.oo[.A]
91 Escape
mp4a.oo[.A]
92 MPEG-1 Layer-1
mp4a.oo[.A]
93 MPEG-1 Layer-2 [MP2]
mp4a.oo[.A]
94 MPEG-1 Layer-3 [MP3]
mp4a.oo[.A]
95 DST [Direct Stream Transfer]
mp4a.oo[.A]
96 ALS [Audio Lossless]
mp4a.oo[.A]
97 SLS [Scalable Lossless]
mp4a.oo[.A]
98 SLS Non-core [Scalable Lossless Non-core]
mp4a.oo[.A]
99 ER AAC ELD [Error Resilient AAC Enhanced Low Delay]
mp4a.oo[.A]
04 SMR Simple [Symbolic Music Representation Simple]
cccc.PP.LL.DD cccc.PP.LL.DD.CC.cp.tc.mc.FF
01 SMR Main [Symbolic Music Representation Main]
mp4a.oo[.A]
03 Reserved
cccc.PP.LL.DD cccc.PP.LL.DD.CC.cp.tc.mc.FF
03
SAOC [Spatial Audio Object Coding]
Defined in ISO/IEC 14496-3:2009/Amd.2:2010[E].
mp4a.oo[.A]
29
LD MPEG Surround [Low Delay MPEG Surround]
Defined in ISO/IEC 14496-3:2009/Amd.2:2010[E].
cccc.PP.LL.DD cccc.PP.LL.DD.CC.cp.tc.mc.FF
05 and up Reserved
The basic form for a WebMcodecs
parameter is to list one or more of the four WebM codecs by name, separated by commas. The table below shows some examples:MIME type Description
cccc.PP.LL.DD cccc.PP.LL.DD.CC.cp.tc.mc.FF
07 A WebM video with VP8 video in it; no audio is specified.
cccc.PP.LL.DD cccc.PP.LL.DD.CC.cp.tc.mc.FF
08 A WebM video with VP9 video in it.
cccc.PP.LL.DD cccc.PP.LL.DD.CC.cp.tc.mc.FF
09 Vorbis audio in a WebM container.
cccc.PP.LL.DD cccc.PP.LL.DD.CC.cp.tc.mc.FF
10 Opus audio in a WebM container.
cccc.PP.LL.DD cccc.PP.LL.DD.CC.cp.tc.mc.FF
11 A WebM container with VP8 video and Vorbis audio.
cccc.PP.LL.DD cccc.PP.LL.DD.CC.cp.tc.mc.FF
12 A WebM container with VP9 video and Opus audio.
The strings
cccc.PP.LL.DD cccc.PP.LL.DD.CC.cp.tc.mc.FF
13 and
cccc.PP.LL.DD cccc.PP.LL.DD.CC.cp.tc.mc.FF
14 also work, but are not recommended.
ISO Base Media File Format syntax
As part of a move toward a standardized and powerful format for thecodecs
parameter, WebM is moving toward describing video content using a syntax based on that defined by the . This syntax is defined in VP Codec ISO Media File Format Binding, in the section . The audio codec continues to be indicated as eithercccc.PP.LL.DD cccc.PP.LL.DD.CC.cp.tc.mc.FF
16 or
cccc.PP.LL.DD cccc.PP.LL.DD.CC.cp.tc.mc.FF
17.
In this format, thecodecs
parameter's value begins with a four-character code identifying the codec being used in the container, which is then followed by a series of period [codecs`9] separated two-digit values.
parameter in a few situations. Firstly, you can use it with thecccc.PP.LL.DD cccc.PP.LL.DD.CC.cp.tc.mc.FF
The first four components are required; everything from `video`5 [chroma subsampling] onward is optional, but all or nothing. Each of these components is described in the following table. Following the table are some examples.
WebM codecs parameter components Component Details`audio`3
A four-character code indicating which indicates which of the possible codecs is being described. Potential values are:
Four-character codes for WebM-supported codecs Four-character code Codec
cccc.PP.LL.DD cccc.PP.LL.DD.CC.cp.tc.mc.FF
22 VP8
cccc.PP.LL.DD cccc.PP.LL.DD.CC.cp.tc.mc.FF
23 VP9
cccc.PP.LL.DD cccc.PP.LL.DD.CC.cp.tc.mc.FF
24 VP10`video`4
The two-digit profile number, padded with leading zeroes if necessary to be exactly two digits.
WebM profile numbers Profile Description
mp4a.oo[.A]
06 Only 4:2:0 [chroma subsampled both horizontally and vertically]. Allows only 8 bits per color component.`video/mp4`2 All chroma subsampling formats are allowed. Allows only 8 bits per color component.
cccc.PP.LL.DD cccc.PP.LL.DD.CC.cp.tc.mc.FF
28 Only 4:2:0 [chroma subsampled both horizontally and vertically]. Supports 8, 10, or 12 bits per color sample component.
cccc.PP.LL.DD cccc.PP.LL.DD.CC.cp.tc.mc.FF
29 All chroma subsampling formats are allowed. Supports 8, 10, or 12 bits per color sample component.`video/mp4`1 The two-digit level number. The level number is a fixed-point notation, where the first digit is the ones digit, and the second digit represents tenths. For example, level 3 is
mp4a.oo[.A]
90 and level 6.1 is
cccc.PP.LL.DD cccc.PP.LL.DD.CC.cp.tc.mc.FF
32.`video/mp4`9 The bit depth of the luma and color component values; permitted values are 8, 10, and 12.`video`5
A two-digit value indicating which chroma subsampling format to use. The following table lists permitted values; see [Chroma subsampling][/en-US/docs/Web/Media/Formats/Video_concepts
chroma_subsampling] in our "Digital video concepts" guide for additional information about this topic and others.
WebM chroma subsampling identifiers Value Chroma subsampling format
mp4a.oo[.A]
06 4:2:0 with the chroma samples sited interstitially between the pixels`video/mp4`2 4:2:0 chroma subsampling with the samples collocated with luma [0, 0]
cccc.PP.LL.DD cccc.PP.LL.DD.CC.cp.tc.mc.FF
28 4:2:2 chroma subsampling [4 out of each 4 horizontal pixels' luminance are used]
cccc.PP.LL.DD cccc.PP.LL.DD.CC.cp.tc.mc.FF
29 4:4:4 chroma subsampling [every pixel's luminance and chrominance are both retained]
mp4a.oo[.A]
34 Reserved`audio/mpeg`9
A two-digit integer specifying which of the color primaries from Section 8.1 of the ISO/IEC 23001-8:2016 standard. This component, and every component after it, is optional.
The possible values of the color primaries component are:
ISO/IEC Color primary identifiers Value Details
mp4a.oo[.A]
06 Reserved for future use by ITU or ISO/IEC`video/mp4`2 BT.709, sRGB, sYCC. BT.709 is the standard for high definition [HD] television; sRGB is the most common color space used for computer displays. Broadcast BT.709 uses 8-bit color depth with the legal range being from 16 [black] to 235 [white].
cccc.PP.LL.DD cccc.PP.LL.DD.CC.cp.tc.mc.FF
28 Image characteristics are unknown, or are to be determined by the application
cccc.PP.LL.DD cccc.PP.LL.DD.CC.cp.tc.mc.FF
29 Reserved for future use by ITU or ISO/IEC
mp4a.oo[.A]
34 BT.470 System M, NTSC [standard definition television in the United States]
cccc.PP.LL.DD cccc.PP.LL.DD.CC.cp.tc.mc.FF
46 BT.470 System B, G; BT.601; BT.1358 625; BT.1700 625 PAL and 625 SECAM
cccc.PP.LL.DD cccc.PP.LL.DD.CC.cp.tc.mc.FF
47 BT.601 525; BT.1358 525 or 625; BT.1700 NTSC; SMPTE 170M. Functionally identical to
mp4a.oo[.A]
67.
cccc.PP.LL.DD cccc.PP.LL.DD.CC.cp.tc.mc.FF
49 SMPTE 240M [historical]. Functionally identical to
mp4a.oo[.A]
66.
mp4a.oo[.A]
14 Generic film`video/mp4`1 BT.2020; BT.2100. Used for ultra-high definition [4K] High Dynamic Range [HDR] video, these have a very wide color gamut and support 10-bit and 12-bit color component depths.
mp4a.oo[.A]
24 SMPTE ST 428 [D-Cinema Distribution Master: Image characteristics]. Defines the uncompressed image characteristics for DCDM.
mp4a.oo[.A]
71 SMPTE RP 431 [D-Cinema Quality: Reference projector and environment]. Describes the reference projector and environment conditions that provide a consistent film presentation experience.
mp4a.oo[.A]
72 SMPTE EG 432 [Digital Source Processing: Color Processing for D-Cinema]. Engineering guideline making color signal decoding recommendations for digital movies.
mp4a.oo[.A]
73 –
mp4a.oo[.A]
81 Reserved for future use by ITU-T or ISO/IEC
mp4a.oo[.A]
82 EBU Tech 3213-E
mp4a.oo[.A]
83 –
cccc.PP.LL.DD cccc.PP.LL.DD.CC.cp.tc.mc.FF
60 Reserved for future use by ITU-T or ISO/IEC`video/mp4`3 A two-digit integer indicating the
cccc.PP.LL.DD cccc.PP.LL.DD.CC.cp.tc.mc.FF
62 for the video. This value is from Section 8.2 of ISO/IEC 23001-8:2016, and indicates the transfer characteristics to be used when adapting the decoded color to the render target.`video/mp4`7 The two-digit value for the
cccc.PP.LL.DD cccc.PP.LL.DD.CC.cp.tc.mc.FF
64 property. This value comes from the table in Section 8.3 of the ISO/IEC 23001-8:2016 specification. This value indicates which set of coefficients to use when mapping from the native red, blue, and green primaries to the luma and chroma signals. These coefficients are in turn used with the equations found in that same section.
cccc.PP.LL.DD cccc.PP.LL.DD.CC.cp.tc.mc.FF
65 Indicates whether to restrict the black level and color range of each color component to the legal range. For 8-bit color samples, the legal range is 16-235. A value of
mp4a.oo[.A]
06 indicates that these limitations should be enforced, while a value of `video/mp4`2 allows the full range of possible values for each component, even if the resulting color is out of bounds for the color system.
WebM media type examples
VP8 video, profile 0 level 4.1, using 8-bit YUV with 4:2:0 chroma subsampling, using BT.709 color primaries, transfer function, and matrix coefficients, with the luminance and chroma values encoded within the legal ["studio"] range. The audio is in Vorbis format.
VP9 video, profile 2 level 1.0, with 10-bit YUV content using 4:2:0 chroma subsampling, BT.2020 primaries, ST 2084 EOTF [HDR SMPTE], BT.2020 non-constant luminance color matrix, and full-range chroma and luma encoding. The audio is in Opus format.
You can use the `codecscccc.PP.LL.DD cccc.PP.LL.DD.CC.cp.tc.mc.FF
71 element when creating an
cccc.PP.LL.DD cccc.PP.LL.DD.CC.cp.tc.mc.FF
72 or
cccc.PP.LL.DD cccc.PP.LL.DD.CC.cp.tc.mc.FF
73 element, in order to establish a group of options for the browser to choose from when selecting the format of the media to present to the user in the element.
You can also use the codecs parameter when specifying a MIME media type to the
cccc.PP.LL.DD cccc.PP.LL.DD.CC.cp.tc.mc.FF
74 method; this method returns a Boolean which indicates whether or not the media is likely to work on the current device.