# Mediasoup as multiple broadcasting endpoint

**URL:** <https://mediasoup.discourse.group/t/mediasoup-as-multiple-broadcasting-endpoint/1116>\
**Category:** Integration\
**Created:** [May 29, 2020, 1:48pm UTC](https://mediasoup.discourse.group/t/mediasoup-as-multiple-broadcasting-endpoint/1116 "2020-05-29T13:48:21Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![valerymagadeeva](https://avatars.discourse-cdn.com/v4/letter/v/13edae/32.png) [@valerymagadeeva](https://mediasoup.discourse.group/u/valerymagadeeva)\
**Post date:** [May 29, 2020, 1:48pm UTC](https://mediasoup.discourse.group/t/mediasoup-as-multiple-broadcasting-endpoint/1116/1 "2020-05-29T13:48:21Z")

</div>

I’m using mediasoup and mediasoup-client to broadcast video from GStreamer to a browser. Mediasoup works as an endpoint for multiple GStreamer streams ( now I have one worker, one router, few plain transports and few producers with its consumers). Everything works fine, except for one thing: when I start more than one stream, the first one works fine (in 95% of cases) and the following have “black screen” for few seconds and then go fine, or crashes with the following error:

> RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:3821358884, payloadType:96]

I was researching the issue but found no errors or problems with GStreamer. I guess, the issue might be connected with wrong RtpEncodingParameters, defined in my solution.  
The RtpParameters for my producer:

```auto
{
    kind: 'video',
    rtpParameters: {
      codecs: [{
        mimeType: 'video/H264',
        clockRate: 90000,
        payloadType: 96,
        parameters: { 'packetization-mode': 1, 'level-asymmetry-allowed': 1 },
        rtcpFeedback: [
          { type: 'nack' },
          { type: 'nack', parameter: 'pli' },
          { type: 'ccm', parameter: 'fir' },
          { type: 'goog-remb' },
          { type: 'transport-cc' },
        ],
      }],
      encodings: [{ ssrc: 111110 }],
    }

```

I wonder if the ssrc value should be different for every producer?

Could you advise me smth? Let me know if you need more additional info.

---

<div class="post-metadata">

**Author:** ![ibc](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/ibc/32/1540_2.png) [@ibc](https://mediasoup.discourse.group/u/ibc)\
**Post date:** [May 29, 2020, 2:35pm UTC](https://mediasoup.discourse.group/t/mediasoup-as-multiple-broadcasting-endpoint/1116/2 "2020-05-29T14:35:43Z")

</div>

May I know why you chose “mediasoup libraries” category instead of “integration”?

---

<div class="post-metadata">

**Author:** ![valerymagadeeva](https://avatars.discourse-cdn.com/v4/letter/v/13edae/32.png) [@valerymagadeeva](https://mediasoup.discourse.group/u/valerymagadeeva)\
**Post date:** [June 1, 2020, 5:09am UTC](https://mediasoup.discourse.group/t/mediasoup-as-multiple-broadcasting-endpoint/1116/3 "2020-06-01T05:09:01Z")

</div>

I’m sorry, probably It was a mistake. I read carefully the “integration” topic and it fits me more. Thanks!

But actually any thoughts about my issue?

---

<div class="post-metadata">

**Author:** ![ibc](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/ibc/32/1540_2.png) [@ibc](https://mediasoup.discourse.group/u/ibc)\
**Post date:** [June 1, 2020, 8:27am UTC](https://mediasoup.discourse.group/t/mediasoup-as-multiple-broadcasting-endpoint/1116/4 "2020-06-01T08:27:24Z")

</div>

I hope people in this forum with more expertise in GStreamer than me can help.

---

<div class="post-metadata">

**Author:** ![valerymagadeeva](https://avatars.discourse-cdn.com/v4/letter/v/13edae/32.png) [@valerymagadeeva](https://mediasoup.discourse.group/u/valerymagadeeva)\
**Post date:** [June 1, 2020, 8:43am UTC](https://mediasoup.discourse.group/t/mediasoup-as-multiple-broadcasting-endpoint/1116/5 "2020-06-01T08:43:49Z")

</div>

As I Mentioned before, I guess the problem is not with GStreamer. I think the problem is with RTPparameters from my producers. Should the ssrc value be different for every producer?

---

<div class="post-metadata">

**Author:** ![ibc](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/ibc/32/1540_2.png) [@ibc](https://mediasoup.discourse.group/u/ibc)\
**Post date:** [June 1, 2020, 8:47am UTC](https://mediasoup.discourse.group/t/mediasoup-as-multiple-broadcasting-endpoint/1116/6 "2020-06-01T08:47:13Z")

</div>

> [@valerymagadeeva](#):
>
> Should the ssrc value be different for every producer?

The `rtpParameters` given to `transport.produce()` in serveer side must represent what the real endpoint (GStreamer in your case) will send to mediasoup.

SSRC must be different for each `Producer` if you create many `Producers` on top of the same `Plain/WebRtcTransport`. The thing is: are you telling your GStreamer to really send RTP using that SSRC?

---

<div class="post-metadata">

**Author:** ![nazar-pc](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/nazar-pc/32/369_2.png) [@nazar-pc](https://mediasoup.discourse.group/u/nazar-pc)\
**Post date:** [June 1, 2020, 8:57am UTC](https://mediasoup.discourse.group/t/mediasoup-as-multiple-broadcasting-endpoint/1116/7 "2020-06-01T08:57:01Z")

</div>

```auto
          { type: 'goog-remb' },
          { type: 'transport-cc' },

```

These ^ are currently not supported by GStreamer, even master branch.

UPD: transport-cc is present in master branch, but only for RTP and I’m not sure how usable it is.

---

<div class="post-metadata">

**Author:** ![valerymagadeeva](https://avatars.discourse-cdn.com/v4/letter/v/13edae/32.png) [@valerymagadeeva](https://mediasoup.discourse.group/u/valerymagadeeva)\
**Post date:** [June 1, 2020, 10:16am UTC](https://mediasoup.discourse.group/t/mediasoup-as-multiple-broadcasting-endpoint/1116/8 "2020-06-01T10:16:21Z")

</div>

I have different plain transports with single producer on top of each transport. And these producers have the same ssrc value.

> The thing is: are you telling your GStreamer to really send RTP using that SSRC?

yes, sure. I instruct GStreamer to send rtp using ssrc and payload, used in producer options.

---

<div class="post-metadata">

**Author:** ![valerymagadeeva](https://avatars.discourse-cdn.com/v4/letter/v/13edae/32.png) [@valerymagadeeva](https://mediasoup.discourse.group/u/valerymagadeeva)\
**Post date:** [June 1, 2020, 10:16am UTC](https://mediasoup.discourse.group/t/mediasoup-as-multiple-broadcasting-endpoint/1116/9 "2020-06-01T10:16:59Z")

</div>

May it be the reason of mentioned issue?

---

<div class="post-metadata">

**Author:** ![ibc](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/ibc/32/1540_2.png) [@ibc](https://mediasoup.discourse.group/u/ibc)\
**Post date:** [June 1, 2020, 10:45am UTC](https://mediasoup.discourse.group/t/mediasoup-as-multiple-broadcasting-endpoint/1116/10 "2020-06-01T10:45:56Z")

</div>

> [@valerymagadeeva](#):
>
> I have different plain transports with single producer on top of each transport. And these producers have the same ssrc value.

Then that’s not a problem.

---

<div class="post-metadata">

**Author:** ![valerymagadeeva](https://avatars.discourse-cdn.com/v4/letter/v/13edae/32.png) [@valerymagadeeva](https://mediasoup.discourse.group/u/valerymagadeeva)\
**Post date:** [June 1, 2020, 10:59am UTC](https://mediasoup.discourse.group/t/mediasoup-as-multiple-broadcasting-endpoint/1116/11 "2020-06-01T10:59:05Z")

</div>

So the issue is probably not connected to mediasoup? 🤔

---

<div class="post-metadata">

**Author:** ![ibc](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/ibc/32/1540_2.png) [@ibc](https://mediasoup.discourse.group/u/ibc)\
**Post date:** [June 1, 2020, 11:04am UTC](https://mediasoup.discourse.group/t/mediasoup-as-multiple-broadcasting-endpoint/1116/12 "2020-06-01T11:04:36Z")

</div>

It’s usually never connected to mediasoup but to external libs usage or wrong API usage.

---

<div class="post-metadata">

**Author:** ![valerymagadeeva](https://avatars.discourse-cdn.com/v4/letter/v/13edae/32.png) [@valerymagadeeva](https://mediasoup.discourse.group/u/valerymagadeeva)\
**Post date:** [June 1, 2020, 11:10am UTC](https://mediasoup.discourse.group/t/mediasoup-as-multiple-broadcasting-endpoint/1116/13 "2020-06-01T11:10:46Z")

</div>

Okay, so I’m gonna share my GStreamer pipeline, so may be somebody from this forum could help me

```auto
'--gst-debug=queue:5,*src*:3',
    'rtpbin', 'name=rtpbin', 'rtp-profile=avpf',
    'fdsrc', 'fd=0', 'blocksize=276480',
    '!', 'queue', 'max-size-bytes=0', 'max-size-buffers=0', 'max-size-time=0', 'min-threshold-buffers=1',
    '!', 'image/x-portable-pixmap,width=1280,height=720,framerate=20/1',
    '!', 'pnmdec',
    '!', 'videoconvert',
    '!', 'queue', 'max-size-bytes=0', 'max-size-buffers=0', 'max-size-time=0', 'min-threshold-buffers=1',
    '!', 'x264enc', 'tune=zerolatency', 'speed-preset=1', 'dct8x8=true', 'quantizer=23', 'pass=qual',
    '!', 'video/x-h264, profile=baseline',
    '!', 'rtph264pay', `ssrc=${ssrc}`, 'pt=96',
    '!', 'rtprtxqueue', 'max-size-time=2000', 'max-size-packets=0',
    '!', 'rtpbin.send_rtp_sink_0',
    'rtpbin.send_rtp_src_0',
    '!', 'udpsink', 'bind-address=127.0.0.1', 'host=127.0.0.1', 'bind-port=5004', `port=${videoRtpPort}`,
    'rtpbin.send_rtcp_src_0',
    '!', 'udpsink', 'bind-address=127.0.0.1', 'host=127.0.0.1', `port=${videoRtcpPort}`, 'sync=false', 'async=false', 'udpsrc', 'port=5005',
    '!', 'rtpbin.recv_rtcp_sink_0',

```

---

<div class="post-metadata">

**Author:** ![valerymagadeeva](https://avatars.discourse-cdn.com/v4/letter/v/13edae/32.png) [@valerymagadeeva](https://mediasoup.discourse.group/u/valerymagadeeva)\
**Post date:** [June 1, 2020, 12:52pm UTC](https://mediasoup.discourse.group/t/mediasoup-as-multiple-broadcasting-endpoint/1116/14 "2020-06-01T12:52:01Z")

</div>

@ibc there are a lot of debug logs from mediasoup:

```auto
[pid:10604] RTC::Transport::HandleRtcpPacket() | no Consumer found for received PLI Feedback packet [sender ssrc:1234, media ssrc:1234]
[pid:10604] RTC::Transport::HandleRtcpPacket() | no Consumer found for received Receiver Report [ssrc:309484411]
[pid:10604] RTC::PlainTransport::OnRtcpDataReceived() | ignoring RTCP packet from unknown IP:port
[pid:10604] RTC::TransportCongestionControlClient::MayEmitAvailableBitrateEvent() | high BWE value decrease detected, notifying the listener [now:1040000, before:1768093]

```

May it cause the issue?

---

<div class="post-metadata">

**Author:** ![ibc](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/ibc/32/1540_2.png) [@ibc](https://mediasoup.discourse.group/u/ibc)\
**Post date:** [June 1, 2020, 1:29pm UTC](https://mediasoup.discourse.group/t/mediasoup-as-multiple-broadcasting-endpoint/1116/15 "2020-06-01T13:29:55Z")

</div>

No. That’s just that gstreamer send unsolicited RTCP PLI feedbacks.

---

<div class="post-metadata">

**Author:** ![ibc](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/ibc/32/1540_2.png) [@ibc](https://mediasoup.discourse.group/u/ibc)\
**Post date:** [June 1, 2020, 1:31pm UTC](https://mediasoup.discourse.group/t/mediasoup-as-multiple-broadcasting-endpoint/1116/16 "2020-06-01T13:31:22Z")

</div>

> [@valerymagadeeva](#):
>
> > RTC::Transport::ReceiveRtpPacket() | no suitable Producer for received RTP packet [ssrc:3821358884, payloadType:96]
> 
> I was researching the issue but found no errors or problems with GStreamer. I guess, the issue might be connected with wrong RtpEncodingParameters, defined in my solution.  
> The RtpParameters for my producer:
> 
> ```auto
> {
> kind: 'video',
> rtpParameters: {
> codecs: [{
> mimeType: 'video/H264',
> clockRate: 90000,
> payloadType: 96,
> parameters: { 'packetization-mode': 1, 'level-asymmetry-allowed': 1 },
> rtcpFeedback: [
> { type: 'nack' },
> { type: 'nack', parameter: 'pli' },
> { type: 'ccm', parameter: 'fir' },
> { type: 'goog-remb' },
> { type: 'transport-cc' },
> ],
> }],
> encodings: [{ ssrc: 111110 }],
> }
> 
> ```

You are telling the mediasoup `Producer` that it will receive RTP packets with SSRC `111110`, but packets arrive with SSRC `3821358884 `. That’s the problem.

Why? No idea. I don’t know if the way you are telling Gstreamer to send packets with SSRC `111110` is correct or not.

---

<div class="post-metadata">

**Author:** ![valerymagadeeva](https://avatars.discourse-cdn.com/v4/letter/v/13edae/32.png) [@valerymagadeeva](https://mediasoup.discourse.group/u/valerymagadeeva)\
**Post date:** [June 1, 2020, 1:51pm UTC](https://mediasoup.discourse.group/t/mediasoup-as-multiple-broadcasting-endpoint/1116/17 "2020-06-01T13:51:16Z")

</div>

Hm, yes, probably that’s the reason. But i wonder should the SSRC value of Producer be the same as the one of Consumer? For example, consumer and producer stats:

```auto
{ bitrate: 1822285,
    byteCount: 28147645,
    firCount: 0,
    fractionLost: 0,
    kind: 'video',
    mimeType: 'video/H264',
    nackCount: 3234,
    nackPacketCount: 10022,
    packetCount: 64762,
    packetsDiscarded: 0,
    packetsLost: 848,
    packetsRepaired: 9856,
    packetsRetransmitted: 9996,
    pliCount: 71,
    roundTripTime: 82.6263427734375,
    rtxSsrc: 115972259,
    score: 9,
    ssrc: 332489534,
    timestamp: 1137999595,
    type: 'outbound-rtp' },
  { bitrate: 1773005,
    byteCount: 28024089,
    firCount: 0,
    fractionLost: 0,
    jitter: 0,
    kind: 'video',
    mimeType: 'video/H264',
    nackCount: 0,
    nackPacketCount: 0,
    packetCount: 67597,
    packetsDiscarded: 0,
    packetsLost: 0,
    packetsRepaired: 0,
    packetsRetransmitted: 0,
    pliCount: 18,
    score: 10,
    ssrc: 111110,
    timestamp: 1137999595,
    type: 'inbound-rtp' }

```

is it ok?

---

<div class="post-metadata">

**Author:** ![jmillan](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/jmillan/32/9_2.png) [@jmillan](https://mediasoup.discourse.group/u/jmillan)\
**Post date:** [June 1, 2020, 1:57pm UTC](https://mediasoup.discourse.group/t/mediasoup-as-multiple-broadcasting-endpoint/1116/18 "2020-06-01T13:57:50Z")

</div>

> [@valerymagadeeva](#):
>
> But i wonder should the SSRC value of Producer be the same as the one of Consumer?

No, SSRC of Producer and Consumer don’t have the same value.

---

<div class="post-metadata">

**Author:** ![ibc](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/ibc/32/1540_2.png) [@ibc](https://mediasoup.discourse.group/u/ibc)\
**Post date:** [June 1, 2020, 2:01pm UTC](https://mediasoup.discourse.group/t/mediasoup-as-multiple-broadcasting-endpoint/1116/19 "2020-06-01T14:01:25Z")

</div>

> [@valerymagadeeva](#):
>
> Hm, yes, probably that’s the reason. But i wonder should the SSRC value of Producer be the same as the one of Consumer?

No. Please, focus on the producer side error. No Consumer involved here. No need for a Consumer to have the issue. Make your GStreamer send RTP packets with the same SSRC than then one you signal into `transport.produce()`, that’s all (for now).

---

<div class="post-metadata">

**Author:** ![valerymagadeeva](https://avatars.discourse-cdn.com/v4/letter/v/13edae/32.png) [@valerymagadeeva](https://mediasoup.discourse.group/u/valerymagadeeva)\
**Post date:** [June 2, 2020, 11:35am UTC](https://mediasoup.discourse.group/t/mediasoup-as-multiple-broadcasting-endpoint/1116/20 "2020-06-02T11:35:51Z")

</div>

Well, I instructed my GStreamer to send RTP packets with specific SSRC. It works fine i guess. The first video goes perfect, the problem is with another one. I looked at gstreamer logs and i noticed a warnings

```auto
0:05:23.307114113 14353 0x558ec5ba0120 DEBUG rtpsession rtpsession.c:2817:rtp_session_process_rtcp: received RTCP packet
0:05:23.307128497 14353 0x558ec5ba0120 DEBUG rtpsession rtpsession.c:2317:rtp_session_process_rr: got RR packet: SSRC 00000000
0:05:23.307135949 14353 0x558ec5ba0120 DEBUG rtpsession rtpsession.c:2227:rtp_session_process_rb: RB 0: SSRC 0001b206, jitter 0
0:05:23.307142200 14353 0x558ec5ba0120 WARN rtpsession rtpsession.c:2859:rtp_session_process_rtcp: got unknown RTCP packet
0:05:23.307145672 14353 0x558ec5ba0120 DEBUG rtpsession rtpsession.c:2878:rtp_session_process_rtcp: 0x558ec5b9e440, received RTCP packet, avg size 80, 80

```

That means that GStreamer gets wrong RTCP packet from mediasoup or not? I see strange SSRC with zeros. What does it mean?

[Next page](https://mediasoup.discourse.group/t/mediasoup-as-multiple-broadcasting-endpoint/1116.md?page=2)
