invisible-college / tawk.space

Social video chats
https://tawk.space
Apache License 2.0
14 stars 1 forks source link

Try out Janus's simulcast or SVC #35

Closed karth295 closed 3 years ago

karth295 commented 6 years ago

From their videoroom demo: https://github.com/meetecho/janus-gateway/blob/master/html/videoroomtest.js#L405

Here's the SVC demo: https://janus.conf.meetecho.com/vp9svctest.html.

For background:

SVC seems waaay more scalable and practical than #15

karth295 commented 6 years ago

I enabled simulcast on tawk.space. High resolution mandates switching to 16:9, apparently, so I've switched to 16:9 instead of 4:3 on tawk.space. PTAL.

toomim commented 6 years ago

SVC looks soooo cool in theory. I want to test it to see how well it works too!

karth295 commented 6 years ago

I've rolled this back because my home internet upload speed is garbage (0.6 Mbps) and can't handle simulcast.

toomim commented 6 years ago

Oh :(. I guess I don't understand how it works.

I thought the advantage of SVC is that it didn't require any additional bandwidth/cpu from the streamer, cause it didn't require simulcast!

Oh well. :( If only we had a way to do all this recompression on the server. We can use tons of cpu and there.

karth295 commented 6 years ago

Oh I was replying to my earlier comment (which said I enabled VP8 simulcast). Simulcast, takes more bandwidth and CPU, particularly because I raised the maximum resolution from 128Kbps to 2Mbps. That's rolled back now.

Janus only has SVC support in VP9, not VP8. Either way, to use VP9 SVC you need to start Chrome with special command line flags -- which is obnoxious. Also, apparently VP9 takes far more CPU because it doesn't have hardware acceleration yet.

But feel free to try it. You can edit /opt/janus/etc/janus/janus.plugin.videoroom.cfg and:

1) Raise the bitrate (see the 2Mbps that's commented out) 2) Switch videocodec to vp9 (it defaults to vp8) 3) Set video_svc to true (see the line that's commented out).

Alternatively to 2), you can set the codec for a particular client using https://github.com/meetecho/janus-gateway/blob/master/html/videoroomtest.js#L410. I believe that will do SVC if you started chrome with the right flags. Subscribers don't need SVC, so it will still work for them.

karth295 commented 3 years ago

We're no longer using Janus, so closing this issue for now. I think the video quality is a bit better now that we're using Agora anyway.