Skip to content

Instantly share code, notes, and snippets.

@cahna
Last active July 10, 2022 01:20
Show Gist options
  • Save cahna/602711fb6f1ac9931cd135c80682fe00 to your computer and use it in GitHub Desktop.
Save cahna/602711fb6f1ac9931cd135c80682fe00 to your computer and use it in GitHub Desktop.
Linux: Fake webcam device to broadcast custom content

HOWTO: Setup "fake" webcam video device for custom content

  • Once configured, select the new video device (/dev/video2 in this example) as input device for client program.
  • Example use: Broadcast custom video/images to group video chat (ex: Zoom/Skype/etc)
  • Tested working on: Manjaro Linux 5.4
  1. Install OBS and prerequisites for building plugin and kernel module:
pacman -S base-devel cmake obs-studio
  1. Install v4l2loopback kernel module to setup "fake" /dev/video2:
git clone https://github.com/umlaeute/v4l2loopback
cd v4l2loopback
make
sudo make install
sudo depmod -a
sudo modprobe v4l2loopback
  1. Install obs-v4l2sink plugin for OSB:
git clone --recursive https://github.com/obsproject/obs-studio.git  # Get OBS source code (needed to build plugin)
git clone https://github.com/CatxFish/obs-v4l2sink                  # Get plugin source code
cd obs-v4l2sink
mkdir build
cd build
cmake -DLIBOBS_INCLUDE_DIR="../../obs-studio/libobs" -DCMAKE_INSTALL_PREFIX=/usr ..
make -j4
sudo make install
  1. Open OBS: under "Tools" there should now be "V4L2 Video Output" - choose your new /dev/video2 device and click "Start"

  2. Open client program (VLC/Zoom/Skype/whatever) and choose /dev/video2 as input source.

  3. Have fun.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment