Open murillo128 opened 1 year ago
@murillo128 Agree that it would be great to figure out how to leverage new WebCodecs features. In addition to the Opus encoder settings there are Video encoder settings that might be of interest (e.g. hwAcceleration
). We had a discussion at TPAC 2022 that touched on some of these things. I agree that setParameters
may be too limited; we also looked at enhancing Encoded Transform so as to allow WebCodecs to interact with the RtpTransport.
Currently the only way of configure the underlying encoding settings is via
setParameters
and we have been removing attributes from it, so at the end the only themaxBitrate
andscaleResolutionDownBy
are supported.There are several issues with the
setParameters
api, we have this complex get/set mechanism and we need to specify how all the parameters works across all codecs even if they are codec-specific.The webcodecs api in the other hand is easier to use/understand/define: https://www.w3.org/TR/webcodecs/#dom-audioencoder-configure
The interesting piece is that it allows codec-specific configurations to be defined, for example this one is for OPUS:
https://github.com/w3c/webcodecs/pull/594/files
It would be great if we could have the same of fine grained control over the webrtc encoders. Not sure if this could be applicable to
setParameters
api or if it would be better to introduce a new api so we are closer to the WebCodecs specs and expose a newencoder
object with acongigure
methods.