OBS Studio: My monkey enjoys the beach |
OBS Studio and Video4Linux
The main ingredients to the virtual camera are OBS Studio (or just OBS) and Video4Linux (V4L / V4L2). The former is a powerful tool for video recording and live streaming. It allows to combine multiple sources, add effects and either record or stream the result to various platforms and formats. The latter, V4L2 - version 2 of V4L, is a set of drivers and utilities for video capturing and processing. I am using a so-called virtual loopback device provided by v4l2loopback to make my output stream available as new input device. Thus, my output from OBS can be made accessed as a webcam in tools like Webex, Teams, Alfaview, Slack, Zoom and others.
For OBS to write to the virtual device, it needs to have the plugin obs-v4l2sink (V4L2 Video Output) installed. Once installed, it is available in OBS under Tools.
Webcam with green screen
With the virtual loopback device and the OBS plugin in place, it is fairly simple to create the virtual camera. I even bought an inexpensive ("cheap") green screen to improve my virtual backgrounds.
In OBS, I have set up multiple scenes. Typically, they have my webcam on top and use a static image, a specific other window (Firefox / Chrome / Iridium browsers) or parts of my workspace as background. For the webcam I have added two (2) effect filters. One is the Crop/Pad to select only parts of the webcam image. The second is the Chroma Key to use the green screen and tune it to the current lighting and more. See the screenshot below with the stacked effects on the left and the Chroma Key settings on the right.
Chroma Key effect to work with green screen |
Conclusions
To touch up video conferencing, even on Linux, is fairly simple and only requires few steps. Of course, the green screen can also be used in recorded videos. To produce a video like the one shown at the top I simply ran a YouTube or Vimeo video in fullscreen mode and configured that window as backdrop.
If you have feedback, suggestions, or questions about this post, please reach out to me on Twitter (@data_henrik) or LinkedIn.