Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automated subscription simulcast switching based on remb #1

Conversation

JanFellner
Copy link
Owner

@JanFellner JanFellner commented Aug 13, 2021

This PR is a followup from the original one of @sjkummer (meetecho#2735)

Fine tuned the switching and its working smothly but currenty lacks in probing. Therefore as draft PR to discuss where and how to implement probing.

The context and whats currently implemented.

  • Via the api i can provide a simulcast_bitrates array to janus for the publisher. Janus then know the bitrates the different layers of the publisher will consume.
  • When creating a subscription on the publisher those bitrate values are currently copied to the subscription (to not need to mutex lock the publisher for every remb event)
  • On an inbound remb value we determine if the value is fitting the current layer, is below, or above the next higher layer.
  • In case the bitrate continuously does not fit what we need the layer is reduced (the logic does not change what the subscription shall transport, the value is an overlay to what has been requested through the API)
  • In case the bitrate is higher than the next layer this overlay reduction value is increased and therefore a switching to a higher layer is possible when the client did request a higher one before.

Whats open

  • The logic works smoothly if i come from high and the bitrate drops.
  • It does not work if i come from a lower bitrate and the REMB value increases.

The reason for that is that the REMB does not increase to a value that covers the next layer.
if i have layers configured like this: 150/500/1200kbit
REMB does no got above 500 if i am on the lowest layer (max is about 380kbit).
The same happens for the middle layer, REMB does not go above 1200kbit (max is about 950kbit).

Therefore probing would be needed.
The question is therefore:

  • Where would be the best place to implement probing.

@@ -5501,6 +5504,97 @@ void janus_videoroom_incoming_rtp(janus_plugin_session *handle, janus_plugin_rtp
janus_videoroom_publisher_dereference_nodebug(participant);
}

/* Retrieve the current position in the ramp up ramp down process
* Ramp positions:
* Spatial 0 (L) - Temporal 15fps -> 0
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think you'll run into issues with this as only chrome restricts itself to two temporal layers while other browsers will use three (which remains the default of libwebrtc)

@JanFellner JanFellner marked this pull request as ready for review September 16, 2021 12:26
JanFellner and others added 22 commits September 16, 2021 14:30
…n a dedicated sub struct of the simulcast data (just to have it properly separated)
…ntation into a dedicated file to have it loosen from the video room and reusable for the other plugins.
…ramp position than the one we currently send
…n in the last commits.

Have an own flag that tells me wether the last_bitrate value is valid or not (did we already receive a valid remb package or not)
…handle related

- add an option to switch on/off debugging
- added tests that have been done (which browser version and whats the finding)
… janus how to handle the remb adoption from the subscriber side. This is either ignore, ramp_up, or start_high.

ignore - no remb adoption
ramp_up - the adoptoin starts on the lowest simulcast layer with temporal 15fps and ramps up (for ff)
start_high - it starts with what the subscriber wants to have (as chrome and safari delivers a pretty good remb value right from the start)
…into feature/CC-2137-automated-subscription-simulcast-switching-based-on-remb
@JanFellner JanFellner closed this Nov 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants