EN
JavaScript - supported Audio/Video MIME Types by MediaRecorder (Chrome, Firefox and Safari)
9
points
In this short article, we would like to show what audio and video MIME Types are supported by MediaRecorder
class in Google Chrome and Mozilla Firefox based web browsers.
Simple answer:
-
video/webm;codecs=vp8
-
video/webm;codecs=vp8.0
-
audio/webm;codecs=opus
-
video/webm;codecs=vp8,opus
-
video/webm;codecs=vp8.0,opus
Note: presented MIME Types support tests were made in Jan 2023.
Tested environment
- Google Chome v109.0.5414.75 (on Windows 11)
- Google Chome v109.0.5414.85 (on Android 12)
- Mozilla Firefox v109.0 (on Windows 11)
- Mozilla Firefox v109.1.1 (on Android 12)
- Apple Safari [attached] (on iOS v16.3)
- Apple Safari v16.2 (on macOS 12.6.2)
Basic cases
In this section, you can find information what audio and video MIME types are supported by what web browsers.
Video MIME Type | Google Chome (on Windows) | Google Chome (on Android) | Mozilla Firefox (on Windows) | Mozilla Firefox (on Android) |
Apple |
video/webm;codecs=vp9 | Yes | Yes | |||
video/webm;codecs=vp9.0 | Yes | Yes | |||
video/webm;codecs=vp8 | Yes | Yes | Yes | Yes | |
video/webm;codecs=vp8.0 | Yes | Yes | Yes | Yes | |
video/webm;codecs=avc1 | Yes | ||||
video/webm;codecs=h264 | Yes | ||||
video/x-matroska;codecs=vp9 | Yes | Yes | |||
video/x-matroska;codecs=vp9.0 | Yes | Yes | |||
video/x-matroska;codecs=vp8 | Yes | Yes | |||
video/x-matroska;codecs=vp8.0 | Yes | Yes | |||
video/x-matroska;codecs=avc1 | Yes | ||||
video/x-matroska;codecs=h264 | Yes | ||||
video/mp4;codecs=avc1 | Yes |
Audio MIME Type | Google Chome (on Windows) | Google Chome (on Android) | Mozilla Firefox (on Windows) | Mozilla Firefox (on Android) | Apple Safari (on iOS & macOS) |
audio/webm;codecs=opus | Yes | Yes | Yes | Yes | |
audio/webm;codecs=pcm | Yes | Yes | |||
audio/ogg;codecs=opus | Yes | Yes | |||
audio/mp4;codecs=mp4a | Yes |
Additional cases
Video/Audio MIME Type | Google Chome (on Windows) | Google Chome (on Android) | Mozilla Firefox (on Windows) | Mozilla Firefox (on Android) | Apple Safari (on iOS & macOS) |
video/webm;codecs=vp9,opus | Yes | Yes | |||
video/webm;codecs=vp9,pcm | Yes | Yes | |||
video/webm;codecs=vp9.0,opus | Yes | Yes | |||
video/webm;codecs=vp9.0,pcm | Yes | Yes | |||
video/webm;codecs=vp8,opus | Yes | Yes | Yes | Yes | |
video/webm;codecs=vp8,pcm | Yes | Yes | |||
video/webm;codecs=vp8.0,opus | Yes | Yes | Yes | Yes | |
video/webm;codecs=vp8.0,pcm | Yes | Yes | |||
video/webm;codecs=avc1,opus | Yes | ||||
video/webm;codecs=avc1,pcm | Yes | ||||
video/webm;codecs=h264,opus | Yes | ||||
video/webm;codecs=h264,pcm | Yes | ||||
video/x-matroska;codecs=vp9,opus | Yes | Yes | |||
video/x-matroska;codecs=vp9,pcm | Yes | Yes | |||
video/x-matroska;codecs=vp9.0,opus | Yes | Yes | |||
video/x-matroska;codecs=vp9.0,pcm | Yes | Yes | |||
video/x-matroska;codecs=vp8,opus | Yes | Yes | |||
video/x-matroska;codecs=vp8,pcm | Yes | Yes | |||
video/x-matroska;codecs=vp8.0,opus | Yes | Yes | |||
video/x-matroska;codecs=vp8.0,pcm | Yes | Yes | |||
video/x-matroska;codecs=avc1,opus | Yes | ||||
video/x-matroska;codecs=avc1,pcm | Yes | ||||
video/x-matroska;codecs=h264,opus | Yes | ||||
video/x-matroska;codecs=h264,pcm | Yes | ||||
video/mp4;codecs=avc1,mp4a | Yes |
Own test
By running the below script you can check what MIME types are supported by your current web browser.
// ONLINE-RUNNER:browser;
const VIDEO_TYPES = ['webm', 'mp4', 'x-matroska', 'ogg'];
const AUDIO_TYPES = ['webm', 'mp3', 'mp4', 'x-matroska', 'ogg', 'wav'];
const VIDEO_CODECS = ['vp9', 'vp9.0', 'vp8', 'vp8.0', 'avc1', 'av1', 'h265', 'h.265', 'h264', 'h.264', 'mpeg', 'theora'];
const AUDIO_CODECS = ['opus', 'vorbis', 'aac', 'mpeg', 'mp4a', 'pcm'];
const testType = (mimeType) => {
if (MediaRecorder.isTypeSupported(mimeType)) {
console.log(` ${mimeType}`);
}
};
console.log();
console.log('Supported Video MIME Types:');
for (let i = 0; i < VIDEO_TYPES.length; ++i) {
const videoType = VIDEO_TYPES[i];
for (let j = 0; j < VIDEO_CODECS.length; ++j) {
const videoCodec = VIDEO_CODECS[j];
testType(`video/${videoType};codecs=${videoCodec}`);
}
}
console.log();
console.log('Supported Audio MIME Types:');
for (let i = 0; i < AUDIO_TYPES.length; ++i) {
const audioType = AUDIO_TYPES[i];
for (let j = 0; j < AUDIO_CODECS.length; ++j) {
const audioCodec = AUDIO_CODECS[j];
testType(`audio/${audioType};codecs=${audioCodec}`);
}
}
console.log();
console.log('Supported Video/Audio MIME Types:');
for (let i = 0; i < VIDEO_TYPES.length; ++i) {
const videoType = VIDEO_TYPES[i];
for (let j = 0; j < VIDEO_CODECS.length; ++j) {
const videoCodec = VIDEO_CODECS[j];
for (let k = 0; k < AUDIO_CODECS.length; ++k) {
const audioCodec = AUDIO_CODECS[k];
testType(`video/${videoType};codecs=${videoCodec},${audioCodec}`);
}
}
}
console.log();
console.log('Supported Other MIME Types:');
testType('video/webm');
testType('video/x-matroska');
testType('video/webm;codecs=vp8,vp9,opus');
testType('video/webm;codecs=h264,vp9,opus');
testType('audio/webm');