# Videoroom subscribers and simulcast relay

**URL:** <https://janus.discourse.group/t/videoroom-subscribers-and-simulcast-relay/1205>\
**Category:** General\
**Created:** [August 5, 2024, 2:32pm UTC](https://janus.discourse.group/t/videoroom-subscribers-and-simulcast-relay/1205 "2024-08-05T14:32:02Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![spscream](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@spscream](https://janus.discourse.group/u/spscream)\
**Post date:** [August 5, 2024, 2:32pm UTC](https://janus.discourse.group/t/videoroom-subscribers-and-simulcast-relay/1205/1 "2024-08-05T14:32:02Z")

</div>

Is it theoretically possible to relay all substreams to videoroom webrtc subscribers?

We had implemented our server/server publishing schema with republishing subscriber webrtc to remote janus server before remote publishers were added to janus, so it is very hard now to switch to the new schema. But we have a problem with simulcast between servers isn’t working now and we use client-side configure calls to switch between mids of publishers from other servers to obtain desired quality on layout changes.  
We also integrated with some external systems, which accepts simulcast publishing via webrtc, which isn’t compatible with remote publishers of janus now afaik.

I looked into code and rtp relay bases on current simulcast context of subscriber in `janus_rtp_simulcasting_context_process_rtp` function. What if I’ll add relay\_all flag on subscriber and always relay all packets to subscriber? I also see magic with payload descriptors happens in janus\_vp8\_simulcast\_descriptor\_update before relay(this might be a problem with relay\_all approach? I need to set it for each subscriber and substream individually or relay it as i?).

Is it my idea with `relay_all` flag would work or not? Any hidden complexities in such approach?

I appreciate any advices. Thank you

---

<div class="post-metadata">

**Author:** ![lorenzo](https://yyz2.discourse-cdn.com/free1/user_avatar/janus.discourse.group/lorenzo/32/425_2.png) [@lorenzo](https://janus.discourse.group/u/lorenzo)\
**Post date:** [August 26, 2024, 8:22am UTC](https://janus.discourse.group/t/videoroom-subscribers-and-simulcast-relay/1205/2 "2024-08-26T08:22:19Z")

</div>

RTP forwarders already support relaying all substreams, rather than a single one. If you mean sending all substreams to a regular subscriber, that would completely break browsers, so we’re not going to do that.

---

<div class="post-metadata">

**Author:** ![spscream](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@spscream](https://janus.discourse.group/u/spscream)\
**Post date:** [August 26, 2024, 8:58am UTC](https://janus.discourse.group/t/videoroom-subscribers-and-simulcast-relay/1205/3 "2024-08-26T08:58:21Z")

</div>

I mean to send all substreams to subscriber which set some flag “relay\_all” on subscribe request. So we won’t send all substreams to regular subscriber, only to subscriber with this flag.  
Is it possible to set rtp forwarder as a regular publisher to janus?

---

<div class="post-metadata">

**Author:** ![lorenzo](https://yyz2.discourse-cdn.com/free1/user_avatar/janus.discourse.group/lorenzo/32/425_2.png) [@lorenzo](https://janus.discourse.group/u/lorenzo)\
**Post date:** [August 26, 2024, 9:10am UTC](https://janus.discourse.group/t/videoroom-subscribers-and-simulcast-relay/1205/4 "2024-08-26T09:10:39Z")

</div>

> [@spscream](#):
>
> Is it possible to set rtp forwarder as a regular publisher to janus?

That’s what the new remote publishers functionality in the VideoRoom does, so I encourage you to start looking into that instead.

---

<div class="post-metadata">

**Author:** ![spscream](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@spscream](https://janus.discourse.group/u/spscream)\
**Post date:** [September 24, 2024, 7:57am UTC](https://janus.discourse.group/t/videoroom-subscribers-and-simulcast-relay/1205/5 "2024-09-24T07:57:52Z")

</div>

@lorenzo does the remote publishers support encryption?

---

<div class="post-metadata">

**Author:** ![lorenzo](https://yyz2.discourse-cdn.com/free1/user_avatar/janus.discourse.group/lorenzo/32/425_2.png) [@lorenzo](https://janus.discourse.group/u/lorenzo)\
**Post date:** [September 24, 2024, 8:06am UTC](https://janus.discourse.group/t/videoroom-subscribers-and-simulcast-relay/1205/6 "2024-09-24T08:06:35Z")

</div>

> [@spscream](#):
>
> @lorenzo does the remote publishers support encryption?

Not at the moment, no.

---

<div class="post-metadata">

**Author:** ![spscream](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@spscream](https://janus.discourse.group/u/spscream)\
**Post date:** [September 27, 2024, 6:32pm UTC](https://janus.discourse.group/t/videoroom-subscribers-and-simulcast-relay/1205/7 "2024-09-27T18:32:07Z")

</div>

do you have any plans to support it? In our case januses are not in the same network and route of rtp lies through internet - different customers with their own infrastructures and server2server webrtc calls

---

<div class="post-metadata">

**Author:** ![spscream](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@spscream](https://janus.discourse.group/u/spscream)\
**Post date:** [September 28, 2024, 7:31pm UTC](https://janus.discourse.group/t/videoroom-subscribers-and-simulcast-relay/1205/8 "2024-09-28T19:31:34Z")

</div>

I implemented it myself, I’ll test it on our environment and later make a pull request with it.

> <https://github.com/spscream/janus-gateway/pull/1/files>

---

<div class="post-metadata">

**Author:** ![spscream](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@spscream](https://janus.discourse.group/u/spscream)\
**Post date:** [September 29, 2024, 5:23pm UTC](https://janus.discourse.group/t/videoroom-subscribers-and-simulcast-relay/1205/10 "2024-09-29T17:23:47Z")

</div>

I’m not sure this implementation would work at all ☹

---

<div class="post-metadata">

**Author:** ![spscream](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@spscream](https://janus.discourse.group/u/spscream)\
**Post date:** [September 29, 2024, 5:49pm UTC](https://janus.discourse.group/t/videoroom-subscribers-and-simulcast-relay/1205/11 "2024-09-29T17:49:47Z")

</div>

[SRTP for remote publishers in video rooms - #3 by architt](https://janus.discourse.group/t/srtp-for-remote-publishers-in-video-rooms/1047/3) found this one, so srtp wouldn’t work in my implementation since all rtp streams multiplexed on the same port.

---

<div class="post-metadata">

**Author:** ![spscream](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@spscream](https://janus.discourse.group/u/spscream)\
**Post date:** [September 29, 2024, 6:01pm UTC](https://janus.discourse.group/t/videoroom-subscribers-and-simulcast-relay/1205/12 "2024-09-29T18:01:42Z")

</div>

Remote publishers doesn’t fit in our scenario since it doesn’t support SRTP. So question in first post is actual. Couldn’t we just support subscribers with special flag ‘relay\_all’ set, to send all substreams? As browser does when publishes simulcast?

---

<div class="post-metadata">

**Author:** ![lorenzo](https://yyz2.discourse-cdn.com/free1/user_avatar/janus.discourse.group/lorenzo/32/425_2.png) [@lorenzo](https://janus.discourse.group/u/lorenzo)\
**Post date:** [September 30, 2024, 5:49am UTC](https://janus.discourse.group/t/videoroom-subscribers-and-simulcast-relay/1205/13 "2024-09-30T05:49:19Z")

</div>

That’s already how simulcast works when using remote publishers. We relay all substreams as separate SSRCs, using a custom math to map them to the related m-line. I think you should be able to have a single SRTP context per remote publisher/recipient, since all streams go on the same port but have different SSRCs.
