Give different bit rates to different produces

I have a webinar application that allows the sender to share screen and open camera at the same time. I created two producers, one for sharing screen and other for camera. I modified the initialAvailableOutgoingBitrate and maxIncomingBitrate but I noticed that these values are distributed over the both produces.
Can I set these values for each produces or fix a bitrate for share screen and camera.

In mediasoup-client you can set the maxBitrate of each Producer’s encoding, and also change it later via producer.sender.setSettings(), but that’s WebRTC 1.0 API since producer.sender returns the RTCRtpSender.

I’m using SVC. I tried it on chrome and watch webrtc internals I noticed that it has no effect. this is my code:
screenStream = await getUserMedia(producerLocalTransport, ‘screen’);
const track = screenStream.getVideoTracks()[0];
const params = { track, appData : { mediaType : ‘screen’ }};

	      params.encodings = [
	        { maxBitrate: 100000 }

	    screenProducer = await producerLocalTransport.produce(params);

Try calling producer.sender.setSettings() later as I said.

1 Like

I used this and it worked setRtpEncodingParameters({ maxBitrate: 100000 })

I had an error with setRtpEncodingParameters on firefox. Where can I call producer.sender.setSettings() on client or server? I didn’t find’t this function.

Please read the official WebRTC 1.0 API and the methods of RTCRtpSender: