# Handling Transport-Wide-CC Feedback in a Custom Janus Plugin

**URL:** <https://janus.discourse.group/t/handling-transport-wide-cc-feedback-in-a-custom-janus-plugin/360>\
**Category:** General\
**Created:** [June 20, 2023, 7:55am UTC](https://janus.discourse.group/t/handling-transport-wide-cc-feedback-in-a-custom-janus-plugin/360 "2023-06-20T07:55:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jerryctt](https://yyz2.discourse-cdn.com/free1/user_avatar/janus.discourse.group/jerryctt/32/66_2.png) [@jerryctt](https://janus.discourse.group/u/jerryctt)\
**Post date:** [June 20, 2023, 7:55am UTC](https://janus.discourse.group/t/handling-transport-wide-cc-feedback-in-a-custom-janus-plugin/360/1 "2023-06-20T07:55:44Z")

</div>

Hello,

I am currently developing a custom plugin for Janus, similar to the VideoRoom plugin. In my scenario, I have two publishers, A and C, and a subscriber B who subscribes to A’s video stream.

My question is about handling the transport-wide-cc feedback from B. When B sends transport-wide-cc feedback to Janus, should I relay this feedback to the publisher A in my plugin? Or does the Janus server handle this feedback internally?

I understand that in most cases, the publisher (a WebRTC client) would handle congestion control, including adjusting the bitrate of its media stream. However, in my scenario, I am considering whether I need to relay the feedback to the publisher for it to adjust its bitrate accordingly.

Any guidance or advice would be greatly appreciated.

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:** [June 21, 2023, 1:22pm UTC](https://janus.discourse.group/t/handling-transport-wide-cc-feedback-in-a-custom-janus-plugin/360/2 "2023-06-21T13:22:51Z")

</div>

We don’t support TWCC on the subscribers side yet, only publisher. For publishers, this is handled by the core, so plugins are not involved.

---

<div class="post-metadata">

**Author:** ![jerryctt](https://yyz2.discourse-cdn.com/free1/user_avatar/janus.discourse.group/jerryctt/32/66_2.png) [@jerryctt](https://janus.discourse.group/u/jerryctt)\
**Post date:** [June 21, 2023, 3:13pm UTC](https://janus.discourse.group/t/handling-transport-wide-cc-feedback-in-a-custom-janus-plugin/360/3 "2023-06-21T15:13:12Z")

</div>

Thank you for your response. Given that Janus currently does not handle TWCC for subscribers, I am considering alternative approaches for managing network congestion in my custom plugin.

One approach I am considering is to use the slow\_link callback function to detect when the subscriber is experiencing network issues. Once detected, I am thinking of two possible ways to adjust the bitrate:

1. Send a REMB packet to the publisher to request it to lower its bitrate.
2. If I use an SVC (Scalable Video Coding) encoder, dynamically select a lower-quality layer for the stream.

Would these approaches be feasible in the current Janus architecture? Any advice or suggestions would be greatly appreciated.

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:** [June 22, 2023, 1:28pm UTC](https://janus.discourse.group/t/handling-transport-wide-cc-feedback-in-a-custom-janus-plugin/360/4 "2023-06-22T13:28:36Z")

</div>

Yes, using slow\_link or info you get from getStats() can be used as your triggers to react somehow, until we implement bandwidth estimation on that side too.
