w3c / webcodecs

WebCodecs is a flexible web API for encoding and decoding audio and video.
https://w3c.github.io/webcodecs/
Other
941 stars 132 forks source link

Specify AudioEncoderConfig.bitrateMode default #699

Closed tguilbert-google closed 10 months ago

tguilbert-google commented 1 year ago

AudioEncoderConfig.bitrateMode [spec link] does not specify a default value.

Whether a codec uses VBR or CBR varies between codecs, and between encoders. Some default values for various encoders:

Variations in the default behavior for different codecs might make sense, if it was a well known that a codec uses VBR or CBR by default. Such details could be added to the codec registry. However, it is confusing if there are variations in the default behavior when using the same codec, with different encoders under the hood.

Proposal: Set AudioEncoderConfig.bitrateMode = "variable" as default.

This would technically be a breaking change for AAC encoders, which do not default to VBR.

dalecurtis commented 1 year ago

VideoEncoder also defaults to variable, so that seems reasonable to me.

bdrtc commented 1 year ago

The media recorder spec also defaults to variable audio bitrateMode, it seems reasonable, sugguest to add defaulting to "variable" text hint .

Djuffin commented 1 year ago

@tguilbert-google Could you please prepare a PR for this?