21

With sudden working from home, video conferencing is all the rage, and many of the more fun features are only built-in to the Windows clients, such as background blur, changing background images, filters, turning yourself into a potato, etc. I realize it's not exactly business critical, but it adds to the camaraderie, and I've been feeling left out.

How can I add some features like this to my Linux system? Note, I don't have the option of changing clients/services. I'm looking for a solution that creates some sort of virtual camera device I can select from any conferencing application.

  • 2
    View people work on changing background, but the setup requires developer skills:

    https://elder.dev/posts/open-source-virtual-background/ https://github.com/fangfufu/Linux-Fake-Background-Webcam and few others.

    – rriemann Apr 15 '20 at 20:25

2 Answers2

15

I have made a Linux package, weffe, for some basic video effects using ffmpeg on Linux webcams here: https://github.com/intermezzio/weffe. You can add a foreground image (like a frame), add top and bottom meme text, or stream a prerecorded video to a webcam, and use a couple of other features. It's very fast because it's written 100% in the shell, without any additional programming languages.

However, if you're looking for something with more features, here are a couple of programs you can consider (including those from rriemann's comment):

  • Avatarify: make yourself talk with a fake image (like Mona Lisa) and words will come out of its mouth (using Python + Tensorflow, can be run on the cloud with CoLab)
  • Pyfakewebcam: Python library for writing videos to a fake webcam device
  • Linux Fake Background Webcam: Use a virtual background on Linux (written in Python + OpenCV)
  • Open Source Virtual Background: Another virtual background program (also written in Python + OpenCV)
  • The script is cool—thanks!—but I wonder if it's possible to add and remove text and images on the fly. I find that when I break out of the script, the image freezes, and then when I rerun it with different parameters, it takes a while to get going again, and I often get a 'Device or resource busy' error. Is this expected?

    An additional feature I'd really love is to be able to enlarge part of what the camera sees, so viewers see more of me and less random background stuff, i.e. to be able to zoom in Zoom. (The Android version of Zoom has pinch zoom, but not the Linux version.)

    – Michael Scheper Jan 27 '21 at 18:18
  • These are good suggestions! Can you create an issue on the repository so we can discuss the features in more detail? – Andrew Mascillaro Jan 28 '21 at 15:10
  • I just added the feature to edit text without rerunning the script. Since the ffmpeg command can't be edited after it's run on loop, it's more complicated to change other features of the webcam in real time. – Andrew Mascillaro Jan 29 '21 at 05:47
3

I found a fairly good solution using OBS Studio, with v4l2loopback and the v4l2-sink obs plugin. This lets me send output from OBS to a virtual webcam, which can be opened from any video conferencing client. Although I haven't figured out background blur yet, OBS has lots of options and plugins, like green screening.

  • This was a great solution for me. I used the obs-backgroundremoval plugin which, in its advanced options, can do background blur instead of background removal if you prefer. – Malvineous Mar 14 '24 at 03:09