Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR makes quite a few SVC related changes, since SVC was so far only limited to a custom VideoRoom demo that needed a specific room configuration too. Following the discussion in #3169, I decided to turn SVC more into a "first class citizen" instead, in order to allow it to be used pretty much as we do with simulcast today.
The first thing this PR does is add new helper functions for SVC processing, which work pretty much like the simulcast ones do: this way, we can use them independently in differenty plugins, rather than have a custom hardcoded behaviour as we did before. At the moment, it assumes VP9-SVC (since AV1 SVC is pretty much unusable right now), but we could extend it later on. These helper functions have then been integrated in both the EchoTest and VideoRoom plugins.
Another thing the PR does, now, is assume that the
jsep
property you send to a plugin can be extended with an array calledsvc
, formatted like this:This is needed because when you use SVC, the SDP doesn't reflect that, so if we want Janus (and the plugins) to know you're sending SVC, we need to say it out of band. Using custom messages in plugins was a possibility, but that would have forced each plugin to implement its own way, which I didn't like: better to have a core way to signal this, especially considering the
jsep
object does get to plugins, and so they can all process it the same way. This newsvc
array is quite basic, since it can contain a list of objects that say which stream being published is SVC, and treat it accordingly: at the time of writing, if you usejanus.js
, this property is set automatically (we iterate on transceivers before sending the SDP to Janus), but if you use your own stack or SDK you'll have to add it manually yourself instead.To test all this in the EchoTest, just add a query string argument like
?vcodec=vp9&svc=L3T3
: this will telljanus.js
to use SVC for the video stream, enrich thejsep
object accordingly, and allow you to change spatial/temporal layers exactly as the simulcast flavour of the demo currently does. Notice that this only works if you use the "regular" EchoTest demo: the Lua and Duktape versions don't support SVC yet.For what concerns the VideoRoom, I got rid of the
video_svc
property you can set in rooms, which means now regular, simulcast and SVC streams can all coexist in the same room, without any prerequisite other than "the related codec must be supported in the room". As a consequence, I also got rid of thevp9svctest.html/.js
demo, since it's useless now: you can publish SVC in the regular VideoRoom demos instead, using the same query string argument shown for the EchoTest (make surevp9
is a supported video codec in your room, of course).An example of simulcast and SVC publishers coexisting in the same room can be seen in the screenshot below:
As you can see, both the publishers we supported too gave us options (we have buttons to select things), but one is using simulcast, and the other is using SVC, as the labels next to their current video resolution tells us.
Please do test this, especially if you're interested in testing SVC support, as I'd like to merge soon. Notice that, due to the amount of changes, this will remain a multistream only PR, as I don't plan to backport the same changes to
0.x
too.