What does HackerNews think of v4l2loopback?

v4l2-loopback device

Language: C

On Linux there are techniques involving a loopback, such as here: https://github.com/umlaeute/v4l2loopback

Effectively these let an app (eg some VToonify tool) generate content that from the perspective of your live streaming app look like they are from a webcam

If you're using a wlroots compositor, then a workaround for sharing the whole screen is to use wf-recorder [1], which supports capturing the whole screen, and feeding its output to a virtual V4L2 device using v4l2loopback [2]. Software that is able to capture from a V4L2-compatible webcam (i.e. most) can them capture from the virtual device without knowing anything about Wayland. It's not exactly the most CPU-efficient way of doing things, but if you can afford the cycles it works very well!

[1] https://github.com/ammen99/wf-recorder

[2] https://github.com/umlaeute/v4l2loopback

On Linux it works with the latest v4l2loopback.

https://github.com/umlaeute/v4l2loopback

Zoom has to be > 5.0.? though. (I have 5.0.4)

This project seems like its the farthest along in this endeavor on linux:

https://github.com/umlaeute/v4l2loopback

Has anyone got any ideas how to achieve this?

Yes. Thanks for giving me a reason to write this up.

1. Download and install OBS. OBS will be your video processor; among other things it's super easy to make it capture the whole screen or individual windows.

2. Install the v4l2 loopback kernel module[1]. This makes it possible to have a virtual webcam. On Ubuntu 19.10, this was as easy as apt install v4l2loopback-dkms and then modprobe v4l2loopback.

3. Install the OBS plugin obs-v4l2sink[5]. This exports the OBS output to the new virtual webcam device. I just installed the deb file provided by the project[2]. In OBS, under Tools, select v4l2sink and Start.

That's all I had to do. Surprisingly straightforward. At least Chrome and Firefox[3] will now pick up a "Dummy Video Device" webcam that streams the window, or whatever scene I set up in OBS.

In my case, the primary advantage was that this virtual webcam is streamed in Jitsi Meet at a higher quality/framerate than the regular desktop share feature. It's also much lower latency than both Twitch and Youtube Live streaming (Jitsi Meet/WebRTC: <1s, Twitch: 5s, Youtube: 15s[4]; YMMV).

You also get to enjoy the rich feature set OBS provides for Twitch streams; for one thing, you can include the real webcam video.

Bonus: Desktop audio "just worked" in Firefox, which offers the pulseaudio monitor (loopback) device as an input. Chrome doesn't -- probably the intended behaviour. I'm sure there's a workaround.

[1] https://github.com/umlaeute/v4l2loopback

[2] https://github.com/CatxFish/obs-v4l2sink/releases

[3] For some reason, Gnome's Cheese won't

[4] Microsoft's Mixer allegedly has super-low-latency streaming (FTL protocol), but new account are cleared manually and I haven't had the chance to try

[5] For Windows, you can use OBS Virtualcam https://obsproject.com/forum/resources/obs-virtualcam.539/

It's possible to create a virtual V4L device (https://github.com/umlaeute/v4l2loopback). The app I chose, provides a script to set this up.

There's also a windows driver, but I haven't used that yet