Search code examples
kurento

application base on kurento takes much net bandwidth


Recently,i have written a small application,like a chat room. So, i just do little change in the many to many(group call) demo of the kurento. But when i deploy it on the ubuntu server, i found that when a room has more than 2 participants, the net bandwidth is almost reach the top range of the server. i use the nload tool to observe the incoming and outgoing flow. The result is that when 2 client connect to the kerunto server, the incoming flow is over 1Mbit/s and outgoing is over 5Mbit/s.Besides, i have try to change the media constraint parameters to modify the width,height,framerate of the video, but it didn't work effectly. In addition, i also run the broadcast demo that given in the github, it met the same condition above.So my question is that is there any configuration that i ignore to control the media transfer, or is it a bug? Thank you


Solution

  • I'm afraid that streaming media is not cheap. In a one-to-many scenario, you will see, from the media server's perspective, that the incoming bandwidth is much lower than the outgoing bandwidth. That's because you are receiving only one media stream (the one from the presenter), while sending many media streams.

    For instance, if your presenter is sending video at 1Mbit/s, and 5 viewers connected, you will get the figures you pointed out. This is no bug, is just how Kurento or any other media servers work.

    The default bandwidth range of the WebRtcEndpoint is 100kbps-500kbps, but it can be changed separately for input/output directions and for audio/video streams.

    • Input bandwidth control mechanism: Configuration interval used to inform remote peer the range of bitrates that can be pushed into this WebRtcEndpoint object.

      • setMin/MaxVideoRecvBandwidth: sets Min/Max bitrate limits expected for received video stream.

      • setMin/MaxAudioRecvBandwidth: sets Min/Max bitrate limits expected for received audio stream. Max values are announced in the SDP, while min values are set to limit the lower value of REMB packages. It follows that min values will only have effect in peers that support this control mechanism, such as Chrome.

    • Output bandwidth control mechanism: Configuration interval used to control bitrate of the output video stream sent to remote peer. It is important to keep in mind that pushed bitrate depends on network and remote peer capabilities. Remote peers can announce bandwidth limitation in their SDPs (through the b=: tag). Kurento will not send at a higher bitrate as specified by the remote peer, if such tag is present.

      • setMin/MaxVideoSendBandwidth: sets Min/Max bitrate limits for video sent to remote peer
      • setMin/MaxAudioSendBandwidth: sets Min/Max bitrate limits for audio sent to remote peer.

    All bandwidth control parameters must be changed before the SDP negotiation takes place, and can't be changed afterwards.

    tl;dr If you plan on having a media server for a one-to-many scenario, be prepared to get a very good upload bandwidth connection.