Skip to content

Commit cfb1c54

Browse files
committed
Fixed broken VP9-SVC demo (fixes #3169)
1 parent b43666d commit cfb1c54

File tree

4 files changed

+13
-9
lines changed

4 files changed

+13
-9
lines changed

conf/janus.plugin.videoroom.jcfg.sample

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ room-5678: {
8888
description = "VP9-SVC Demo Room"
8989
secret = "adminpwd"
9090
publishers = 6
91-
bitrate = 512000
91+
bitrate = 0 # No limit, to give room for all layers
9292
fir_freq = 10
9393
videocodec = "vp9"
9494
video_svc = true

html/vp9svctest.html

+5-7
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,11 @@ <h3>Demo details</h3>
6161
you have a single stream with multiple layers, which makes it more efficient,
6262
especially because it consumes much less bandwidth.</p>
6363
<p>Notice that this only works if the publishers joining the room will use a recent
64-
Chrome version that has been started either with the following flag:</p>
65-
<p><div class="alert alert-info"><code>--force-fieldtrials=WebRTC-SupportVP9SVC/EnabledByFlag_2SL3TL/</code></div></p>
66-
<p>to configure VP9 SVC to only use two spatial layers, or:</p>
67-
<p><div class="alert alert-info"><code>--force-fieldtrials=WebRTC-SupportVP9SVC/EnabledByFlag_3SL3TL/</code></div></p>
68-
<p>to test three spatial layers instead.
69-
If you join with a Chrome that doesn't have one of those options set, or with
70-
another browser, you'll be able to select a layer, but all request to set
64+
browser that supports the <code>scalabilityMode</code> property in <code>sendEncodings</code>,
65+
e.g., recent Chrome versions (please refer to the
66+
<a target="_blank" href="https://www.w3.org/TR/webrtc-svc/">SVC Extension for WebRTC</a>
67+
documentation for more details). If you join with a browser that doesn't support
68+
those properties, or with you'll be able to select a layer, but all request to set
7169
a custom layer on your video will fail, meaning you'll act as a plain VP9 client.
7270
If you ask for a layer from a publisher that doesn't support VP9 SVC either,
7371
then your request will be ignored as well.</p>

html/vp9svctest.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,9 @@ function publishOwnFeed(useAudio) {
434434
let tracks = [];
435435
if(useAudio)
436436
tracks.push({ type: 'audio', capture: true, recv: false });
437-
tracks.push({ type: 'video', capture: true, recv: false, simulcast: false});
437+
// For video, we add the 'svc' property to set the related scalabilityMode:
438+
// since we'll force VP9, this will enable SVC mode in the VP9 encoder
439+
tracks.push({ type: 'video', capture: true, recv: false, svc: 'S3T3' });
438440
//~ tracks.push({ type: 'data' });
439441

440442
sfutest.createOffer(

src/plugins/janus_videoroom.c

+4
Original file line numberDiff line numberDiff line change
@@ -3138,6 +3138,8 @@ static void janus_videoroom_create_dummy_publisher(janus_videoroom *room, GHashT
31383138
ps->h264_profile = g_strdup(room->h264_profile);
31393139
else if(ps->vcodec == JANUS_VIDEOCODEC_VP9 && ps->vp9_profile == NULL && room->vp9_profile != NULL)
31403140
ps->vp9_profile = g_strdup(room->vp9_profile);
3141+
if(ps->vcodec == JANUS_VIDEOCODEC_VP9 && room->do_svc)
3142+
ps->svc = TRUE; /* FIXME */
31413143
ps->min_delay = -1;
31423144
ps->max_delay = -1;
31433145
g_atomic_int_set(&ps->destroyed, 0);
@@ -12162,6 +12164,8 @@ static void *janus_videoroom_handler(void *data) {
1216212164
janus_mutex_unlock(&ps->rid_mutex);
1216312165
}
1216412166
}
12167+
if(ps->vcodec == JANUS_VIDEOCODEC_VP9 && videoroom->do_svc)
12168+
ps->svc = TRUE; /* FIXME */
1216512169
mdir = (ps->vcodec != JANUS_VIDEOCODEC_NONE ? JANUS_SDP_RECVONLY : JANUS_SDP_INACTIVE);
1216612170
} else if(m->type == JANUS_SDP_APPLICATION) {
1216712171
mdir = JANUS_SDP_RECVONLY;

0 commit comments

Comments
 (0)