Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow codec-specific encoder configuration #122

Open
murillo128 opened this issue Oct 24, 2022 · 1 comment
Open

Allow codec-specific encoder configuration #122

murillo128 opened this issue Oct 24, 2022 · 1 comment
Assignees

Comments

@murillo128
Copy link

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 the maxBitrate and scaleResolutionDownBy 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

dictionary OpusEncoderConfig {
  OpusBitstreamFormat format = "opus";
  [EnforceRange] unsigned long frameDuration = 20;
  [EnforceRange] unsigned long complexity;
  [EnforceRange] unsigned long packetlossperc = 0;
  boolean useinbandfec = false;
  boolean usedtx = false;
};

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 new encoder object with a congigure methods.

transcevier.sender.encoder.configure({usedtx:true})
@aboba
Copy link
Contributor

aboba commented Oct 24, 2022

@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.

@aboba aboba self-assigned this Oct 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants