14 comments on “WebRTC beyond one-to-one communication (Gustavo Garcia Bernardo)

  1. Hi guys

    you have really good blog! But I have one question about this post

    Is there any opensource solutions for Routing video (I say about media server with command protocol) I’ve researched this issue but my results were very poor

    Sergey G

    • If you are looking for an open source video routing solution (as opposed to traditional MCU/mixing), then I would recommend Jitsi’s Videobridge. Guest webrtcHacks author Emil Ivov runs the project.

  2. In the router solution, how do you handle RTCP packets?
    Does the router acts as a peer and generate RTCP packets of his own with reception reports or does it just foward RTCP packets from the peers?
    If the latter, does it need to modify the packet and replace SSRCs in the header and reception blocks?

    Is there an RFC dealing with this?
    DO Chrome and FF support it?


    • You can implement the RTCP handling in both ways.

      1) Forwarding the RTCP packets without any modification. It works and it is supported by FF and Chrome. It is simpler but less efficient and you can end up wasting bandwidth in RTCP traffic or sending duplicated retransmissions requests.

      2) Generating/Manipulating the RTCP packets in the router. Ideally you can aggregate the RTCP feedback from all the recipients and generate a single RTCP feedback to the source with a single SSRC. You will save some bandwidth and win some flexibilty but it is more complex and you have to be careful to not break algorithms like the congestion control in the browsers.

      Regarding opensource projects, Licode implements forwarding RTCP without any modification, and apparently Janus has code to do a simple modification of the SSRC before forwarding the packets.

      • I was missing the fact that Chrome and FF already support connecting to a translator that forward RTCP packets. With your answer I’ve implemented it and it works.

        Can you estimate for how many users using forwarding RTCP packets without modifications is fine and when it’s essential to generate or manipulate RTCP packets to save bandwidth and improve the performance?

        For 20 users publishing audio and 4 publishing video, is it still OK to forward RTCP packets without modifications?

  3. IMO it is not that Chrome/FF support connecting to a translator but the fact that in most of the cases they ignore the SSRC when they receive the RTCP packets 🙂

    For your use case the RTCP bandwidth is probably not an issue yet but you are going to have issues with retransmissions, keyframe requests and bandwidth estimations. If you just forward those RTCP messages (NACK, PLI, REMB…), the quality is not going to be as good as it could be with a little bit of intelligence in the router.

    • What about ROC synchronization?

      If I have one publisher and one subscriber connected to MCU for an hour, the ROC will be probably 3. When a new client join the call, I need to choose a sequence number between 0 and 2^15 and roc=0. The new client will send RTCP reports with different index than what the sender sent.

      Is there a way to pass the initial ROC so the new client will use the same index as the publisher and old subscribers?

      • You should decrypt and re-encrypt the RTP packets in the MCU so that the ROC is always 0 for the subscribers no matter what value it has for the publisher or other subscribers.

  4. I’m decrypting an re-encrypting the RTP in the MCU and starting with ROC=0 for a new subscriber. I have a question is about the sequence number.
    Can I use the publisher’s sequence number when sending packets to a subscriber that joined late?

    If I’m supposed to use the publisher’s sequence number, isn’t there a possibility that a new subscriber will have ROC out of sync in case he join when the sequence number is close to 2^16 and there are out-of-order packets? (That’s why a sender starts with seq=rand(2^15)).

    If I should generate a new sequence number for the new subscriber, the RTCP reception reports will be wrong because info like the extended highest sequence number received will refer to a different sequence number.

    • Yes, you can use the publisher’s sequence number when sending packets to a subscriber that joined late.

      One subscriber can receive sequence number X with ROC Z and the other subscriber can receive sequence number Y with ROC Z because the ROC is just a SRTP concept and the SRTP context is different per subscriber.

  5. If a client joins when the sender sequence_number=65534 but it misses few packets and the first packet he’ll get is sequence_number=3, the server will advance roc to 1 but the client will still think roc=0.

    In the normal case we solve it by setting the initial sequence_number to rand(2^15) but now we have to use the current sender sequence_number to be able to forward rtcp packets without having to rewrite them.

    Will the WebRTC client be smart enough to try roc=1 if roc=0 fails because of missed packets?

    • I see what you say, sorry. According to the spec it could be handled but it is not clear:
      “In particular, out-of-order RTP packets with sequence numbers close to 2^16 or zero must be properly handled.”

      The other option you have is a bit of a hack but if you detect that case, wait a couple second (50 packets) before starting sending packets.

      If you investigate/test it more keep us updated.

  6. Hello,

    We have an one-to-many broadcast system adtlantida.tv.It works, but we need to allow more listeners/viewers saving bandwidth.Our arquitecture is: node.js, socket.io, STUN server, TURN server.Now we are investigating in MCU (Telepresence,Meddoze, Licode, Kurento)…most of them looks only for multivideoconference, not for one-to-many broadcasting.Which one is your recommendation?

    Thanks in advance for your great work and information,


  7. Hi

    We are working with WebRTC multicast implementation, I have one question

    Is peer to peer distribution works in different network? let’s an example
    One user has started the broadcast and N number of users has join the broadcast from any country or any where.

    so my question is how peer distribution work?
    is peer distribution (multicast) work in different network or it’s only work in private network?

    will peer distribution manage automatically or peer distribution will not work in such case?
    I read googled but I am not able to find perfect answer.

    Gaurav Dhol

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.