Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PCM support in WebM, and Chrome's WebM implementation

Does WebM support PCM for the audio codec?

I didn't think it did, but I see on the WebM documentation page that there is support for a BitDepth field with the following comment:

BitDepth - Bits per sample, mostly used for PCM.

If WebM does support PCM, does Chrome's implementation? And if it does, what is the appropriate content type for use with MediaRecorder? These all return false:

MediaRecorder.isTypeSupported('video/webm;codecs=h264,pcm');
MediaRecorder.isTypeSupported('video/webm;codecs=h264,wav');
MediaRecorder.isTypeSupported('video/webm;codecs=h264,adpcm');
MediaRecorder.isTypeSupported('video/webm;codecs=h264,pcm_s16le');
MediaRecorder.isTypeSupported('audio/wav');
like image 234
Brad Avatar asked Oct 27 '25 16:10

Brad


2 Answers

PCM is now supported in the latest Chromium. Here is a reference for the list of valid mime types for MediaRecorder in Chromium.

As a snapshot, here is the ones currently supported in Google Chrome Version 64.0.3282.167 (Official Build) (64-bit):

MediaRecorder.isTypeSupported("video/webm")
MediaRecorder.isTypeSupported("video/webm;codecs=vp8")
MediaRecorder.isTypeSupported("video/webm;codecs=vp9")
MediaRecorder.isTypeSupported("video/webm;codecs=vp8.0")
MediaRecorder.isTypeSupported("video/webm;codecs=vp9.0")
MediaRecorder.isTypeSupported("video/webm;codecs=h264")
MediaRecorder.isTypeSupported("video/webm;codecs=H264")
MediaRecorder.isTypeSupported("video/webm;codecs=avc1")
MediaRecorder.isTypeSupported("video/webm;codecs=vp8,opus")
MediaRecorder.isTypeSupported("video/webm;codecs=vp8,pcm")
MediaRecorder.isTypeSupported("video/WEBM;codecs=VP8,OPUS")
MediaRecorder.isTypeSupported("video/webm;codecs=vp9,opus")
MediaRecorder.isTypeSupported("video/webm;codecs=vp9,pcm")
MediaRecorder.isTypeSupported("video/webm;codecs=vp8,vp9,opus")
MediaRecorder.isTypeSupported("video/webm;codecs=h264,opus")
MediaRecorder.isTypeSupported("video/webm;codecs=h264,vp9,opus")
MediaRecorder.isTypeSupported("video/x-matroska;codecs=avc1")
MediaRecorder.isTypeSupported("audio/webm")
MediaRecorder.isTypeSupported("audio/webm;codecs=opus")
MediaRecorder.isTypeSupported("audio/webm;codecs=pcm")

Note that if you are running Chromium, you need to have it built with proprietary_codecs support for some of the more exotic ones with h264/avc1 to work.

like image 197
Sepehr Avatar answered Oct 29 '25 07:10

Sepehr


WebM does not support PCM audio.

WebM files consist of video streams compressed with the VP8 or VP9 video codecs and audio streams compressed with the Vorbis or Opus audio codecs.

Source - http://www.webmproject.org/about/

VP8/VP9 video and Vorbis/Opus audio are the only codecs allowed in a valid .webm file. Why did you define WebM so narrowly?

We decided to define WebM files in this way because we wanted to do what’s best for users.

Source - https://www.webmproject.org/about/faq/

Regarding your documentation note:

I didn't think it did, but I see on the WebM documentation page that there is support for a BitDepthfield with the following comment

WebM is a subset of the Matroska format. The page you are quoting is simply a carbon copy of the Matroska specification from its website:

https://www.matroska.org/technical/specs/index.html

The WebM page borrows all the content and notes whether a propery is supported or not. The line 'Bits per sample, mostly used for PCM.' - is the original Matroska specification, just like all the other lines, e.g. 'Table of horizontal angles for each successive channel, see appendix.' - note that there is no appendix given, but on the original Matroska specification page there is a hyperlink to an appendix. Matroska specification has that particular property description because Matroska supports PCM audio.

For PCM support in Chrome, see a great answer by Sepehr.

like image 40
Roman Pletnev Avatar answered Oct 29 '25 06:10

Roman Pletnev



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!