Languages
[Edit]
EN

JavaScript - supported Audio/Video MIME Types by MediaRecorder (Chrome, Firefox and Safari)

9 points
Created by:
Mariam-Barron
811

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 TypeGoogle
Chome
(on Windows)
Google
Chome
(on Android)
Mozilla
Firefox

(on Windows)
Mozilla
Firefox

(on Android)

Apple
Safari
(on iOS & macOS)

video/webm;codecs=vp9YesYes   
video/webm;codecs=vp9.0YesYes   
video/webm;codecs=vp8YesYesYesYes 
video/webm;codecs=vp8.0YesYesYesYes 
video/webm;codecs=avc1Yes    
video/webm;codecs=h264Yes    
video/x-matroska;codecs=vp9YesYes   
video/x-matroska;codecs=vp9.0YesYes   
video/x-matroska;codecs=vp8YesYes   
video/x-matroska;codecs=vp8.0YesYes   
video/x-matroska;codecs=avc1Yes    
video/x-matroska;codecs=h264Yes    
video/mp4;codecs=avc1    Yes
Audio MIME TypeGoogle
Chome
(on Windows)
Google
Chome
(on Android)
Mozilla
Firefox

(on Windows)
Mozilla
Firefox

(on Android)
Apple
Safari
(on iOS & macOS)
audio/webm;codecs=opusYesYesYesYes 
audio/webm;codecs=pcmYesYes   
audio/ogg;codecs=opus  YesYes 
audio/mp4;codecs=mp4a    Yes

 

Additional cases 

Video/Audio MIME TypeGoogle
Chome
(on Windows)
Google
Chome
(on Android)
Mozilla
Firefox

(on Windows)
Mozilla
Firefox

(on Android)
Apple
Safari
(on iOS & macOS)
video/webm;codecs=vp9,opusYesYes   
video/webm;codecs=vp9,pcmYesYes   
video/webm;codecs=vp9.0,opusYesYes   
video/webm;codecs=vp9.0,pcmYesYes   
video/webm;codecs=vp8,opusYesYesYesYes 
video/webm;codecs=vp8,pcmYesYes   
video/webm;codecs=vp8.0,opusYesYesYesYes 
video/webm;codecs=vp8.0,pcmYesYes   
video/webm;codecs=avc1,opusYes    
video/webm;codecs=avc1,pcmYes    
video/webm;codecs=h264,opusYes    
video/webm;codecs=h264,pcmYes    
video/x-matroska;codecs=vp9,opusYesYes   
video/x-matroska;codecs=vp9,pcmYesYes   
video/x-matroska;codecs=vp9.0,opusYesYes   
video/x-matroska;codecs=vp9.0,pcmYesYes   
video/x-matroska;codecs=vp8,opusYesYes   
video/x-matroska;codecs=vp8,pcmYesYes   
video/x-matroska;codecs=vp8.0,opusYesYes   
video/x-matroska;codecs=vp8.0,pcmYesYes   
video/x-matroska;codecs=avc1,opusYes    
video/x-matroska;codecs=avc1,pcmYes    
video/x-matroska;codecs=h264,opusYes    
video/x-matroska;codecs=h264,pcmYes    
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');

 

Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join