Dynamic Bitrate Adjustments


I am currently working on dynamically adjusting the stream quality based on the network conditions of each client in a MediaSoup application. My goal is to optimize the client experience by altering the bitrate of the media streams in real time, using the setMaxOutgoingBitrate(newBitrate) method on the transport.

Setup Details:

  • Transports: I have set up two types of transports for each client: sendTransport for handling outgoing streams to the server, and receiveTransport for managing streams that are sent from the server to the client.
  • Bitrate Management: I’m attempting to control the stream’s bitrate by calling setMaxOutgoingBitrate(newBitrate) on the receiveTransport, as I understand that this should limit the bitrate of the streams being sent to clients.


Despite implementing this, I’ve noticed that changes made via setMaxOutgoingBitrate(newBitrate) are not reflected in the bitrate statistics obtained from producer.getStats()[0].bitrate. The stats do not show any change in the bitrate after adjusting the setMaxOutgoingBitrate.


  1. Is there something I might be overlooking in how setMaxOutgoingBitrate should be implemented to effectively control the bitrate?
  2. Should modifications to bitrate settings immediately reflect in producer.getStats() or is there an expected delay?
  3. Are there additional settings or configurations in MediaSoup that could impact how bitrate adjustments are handled and reported?

I am looking to understand the best practices for dynamically managing stream quality based on real-time network assessments and ensuring these changes are accurately monitored through MediaSoup’s statistics.

Thank you in advance for your insights and assistance!

What about transport.setMaxIncomingBitrate(bitrate)?

calling “Transport.setMaxIncomingBitrate(bitrate)” does not make any difference on the value of “producer.getStats()[0].bitrate”