Skip to content

Instantly share code, notes, and snippets.

@641i130
Forked from ioquatix/README.md
Last active January 3, 2023 05:34
Show Gist options
  • Save 641i130/8afbd4385fb563d105f1020d3edd9936 to your computer and use it in GitHub Desktop.
Save 641i130/8afbd4385fb563d105f1020d3edd9936 to your computer and use it in GitHub Desktop.
How to setup v4l2 loopback for use with OBS.

https://www.scs.stanford.edu/~dm/blog/hide-webcam.html

UPDATED:

Simple script to run through all the steps:

if [ "$EUID" -ne 0 ]
  then echo "Please run as root"
  exit
fi

# Make v4l2loopback run by default
echo options v4l2loopback nr_devices=2 exclusive_caps=1,1,1,1,1,1,1,1 video_nr=0,1 card_label=v4l2lo0,v4l2lo1 > /etc/modprobe.d/v4l2loopback.conf
echo v4l2loopback > /etc/modules-load.d/v4l2loopback.conf
modprobe v4l2loopback

read -p "Enter username: " username
# updates user to be in the video group
usermod -aG video $username

ls /home/$username/.config/obs-studio/basic/scenes/
echo "Select the correct file above and update the camera source with the following camera device paths:"
ls -alh /dev/obs-only/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment