Sending out stereo: codecOptions vs codec

Hi,

I’m trying to find out what the relationship is between RtpCodecCapability.channels and codecOptions.opusStereo.

In the mediasoup demo it seems the producer options just specifies opusStereo in the codecOptions: https://github.com/versatica/mediasoup-demo/blob/v3/app/lib/RoomClient.js#L803-L814 and doesn’t specify the RtpCodecCapability.

Is this sufficient or do we also need to set the codec and search for a RtpCodecCapabaility on the device that has 2 channels (and vice-versa for mono). Or how do these 2 settings interact?

Opus is always signalled (in the SDP) with /2 (so two channels) so hence its codecCapability.channels will be always 2, no matter you later enable stereo or not.

Thanks, is the same true for DTX?

And while mentioning DTX, the mediasoup demo sets dtx: true for screenshare video producers: https://github.com/versatica/mediasoup-demo/blob/v3/app/lib/RoomClient.js#L36-L39

But I don’t find this mentioned in the spec: https://w3c.github.io/webrtc-pc/#rtcrtpencodingparameters

I do find it on MDN, but there it says it’s only for audio.

So is this something new or deprecated or an error in the demo?

Look for “dtx” in https://mediasoup.org/documentation/v3/mediasoup/rtp-parameters-and-capabilities/

Yes, I saw that, but is it supported by (libwebrtc) browsers if it’s not part of the webRTC spec?

This is something for mediasoup (server), not for clients.

Ah, ok, I was confused since it was being defined on the client side in the demo. Thanks for the quick answers!

It’s defined in client side because it’s later propagated to the server. But you are right. In fact the dtx option in RTCRtpEncodingParameters is not even implemented in libwebrtc.