This is extremely Linux only due to the dependency on v4l2loopback and obs-v4l2sink, though, as mentioned below, CatxFish has also written a similar plugin for Windows. I have not tried it, YMMV.
Wanna composite your face (as a video, from your webcam), on top of a video of your choosing, and use that for your conference calls? NOW YOU CAN! (Zoom only supports still-image virtual backgrounds. BOO.)
Note: you will need a greenscreen for this. (You can try all the software-y bits below without one, but it won't look very good at all.) $60 on Amazon, you can probably find one cheaper. (Or make. Or, honestly, it might work if you have a solid-colored wall behind you, which I do not.)
- install obs-studio (https://obsproject.com/download, there's a deb)
- install https://github.com/umlaeute/v4l2loopback (kernel module, build from source)
- install https://github.com/CatxFish/obs-v4l2sink (from source, instructions in README.md)
- You probably want youtube-dl; at time of writing, the youtube-dl in bionic's
apt repo was busted, clone https://github.com/ytdl-org/youtube-dl and run as
python -m youtube_dl
OBS Studio is a ... I guess it's intended for streamers and video production? Then obs-v4l2sink is an OBS Studio plugin (the same author made a Windows equivalent too) that lets OBS Studio send output to a fake video device that apps will see as a webcam. Like Zoom, for instance. It depends on v4l2loopback, a kernel module.
After installing the dependencies, first:
sudo modprobe v4l2loopback exclusive_caps=1
(I am not certain ifexclusive_caps=1
is necessary, but it WFM)
- On the bottom of the obs-studio window, one of the boxes is "Sources". Click the plus;
you want two sources.
- One, "Video Capture Device (V4L2)" is your webcam.
- The other is "Media Source" - this is the video file you want playing behind you. You probably want to check "loop".
- In the Sources list, right click the Video Capture Dev source; add an Effects Filter, "Chroma Key"
- Other relevant actions in the Sources list:
- The eyeball icon will show/hide a layer - this is akin to Photoshop's layers
- Right click has menu items Transform -> {Fit,Stretch} to Screen
- Right click has menu items Order -> Move to {Top,Bottom,Front,Back} - again, this is akin to Photoshop's layers, and is how you decide which is on top
Menu: Tools -> V4L2 Video Output. "Path to V4L2 Device" is most likel /dev/video1. For me, Video Format YUY2 worked; the others may or may not be available, I honestly don't know what the difference is.
Click Start. (There"s an "Auto Start" checkbox, dunno what it's for.)
Now open Zoom. You can test this in settings, or you can click the up arrow next to "Start Video" (or "Stop Video") and select your new video source - it'll be "Dummy video device 0x0000" (or 1, 2, etc).
Now go surprise your colleagues, who will be very jealous that they only have a static virtual background.
If you find that this doesn't quite work and have a tweak to fix it, or can explain the things I mentioned I don't understand, please let me know and I'll update this file!