PCM support in WebM, and Chrome's WebM implementation

家住魔仙堡 提交于 2020-07-03 07:30:25

问题


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');

回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/40729039/pcm-support-in-webm-and-chromes-webm-implementation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!