Prefer a codec and set maximum bitrate


Is this correct in order to set the maximum outgoing bitrate of a non-simulcast media stream? WebRTC internals says yes, just to make sure. I just have seen this kind of “encoding” setup in simulcast scenarios so far in the available samples:

params.encodings = [
                        { rid: "r0", active: true, maxBitrate: 100000 },

Second part of the question: Is there any way to prefer a particular codec in publisher connections? I would know how to do this with “pure” WebRTC, but I’m not quite sure how to do it with mediasoup-client.

Basically it is just about changing the order of the offered codecs in the OFFER SDP in order to achieve a preference for e.g. H.264 over VP8 or vice versa.


You wouldn’t believe such a feature exists since 2020. Look for codec option here:

Thanks. I was just not finding it. Missing a full text search on the documentation.

Thanks for the quick answer.

Does that mean, the first part of the question is answered with “Yes”

It is, yes

Thanks again.