mozilla / standards-positions

https://mozilla.github.io/standards-positions/
Mozilla Public License 2.0
651 stars 72 forks source link

Constant bitrate audio encoding with MediaRecorder #414

Open sizeak opened 4 years ago

sizeak commented 4 years ago

Request for Mozilla Position on an Emerging Web Specification

Other information

A new enumeration (BitrateMode) has been added for specifying either constant or variable bitrate for audio encoding, MediaRecorderOptions has an extra field called audioBitrateMode for requesting a specific bitrate mode from the MediaRecorder and a field was added to MediaRecorder for retrieving the bitrate mode being used for encoding.

hsivonen commented 4 years ago

I note that neither the explainer nor the other linked documents explain a use case. The person who requested said they "need" this, and later comments took it as a given that CBR for audio is common.

However, it was not explained what use cases are enabled by CBR than now fail due to MediaRecorder producing VBR.

annevk commented 4 years ago

cc @jan-ivar

sizeak commented 4 years ago

I note that neither the explainer nor the other linked documents explain a use case. The person who requested said they "need" this, and later comments took it as a given that CBR for audio is common.

However, it was not explained what use cases are enabled by CBR than now fail due to MediaRecorder producing VBR.

I am the person who needed this and CBR audio is common. I have an open task to update the explainer with more information, but in short, CBR gives me predicable packet and file sizes which can be useful in a number of situations, it can also be less resource intensive to encode and can give higher quality. I have use cases which require CBR encoding, without implementing support in MediaRecorder I would be forced to ship a WASM alternative which would have performance implications.

sizeak commented 4 years ago

The explainer has now been updated.