Skip to content

Instantly share code, notes, and snippets.

@data-henrik
Last active January 22, 2021 12:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save data-henrik/6b9fe138cb349fa43f86e023f310c88b to your computer and use it in GitHub Desktop.
Save data-henrik/6b9fe138cb349fa43f86e023f310c88b to your computer and use it in GitHub Desktop.
# this is not a script, but you may turn it into such
# it assumes that you already installed OBS Studio (sudo dnf install obs-studio)
# you could start by creating a project directory "obs"
# make obs
# cd obs
# clone the source for loopback device
git clone https://github.com/umlaeute/v4l2loopback
cd v4l2loopback
# The following steps needs to be repeated after kernel upgrades
# compile the sources and install them
# if recompiling after a new kernel has been installed:
# make clean
make
sudo make install
sudo depmod -a
# if updating after a new kernel has been installed:
# sudo rmmod v4l2loopback
# create the virtual device as /dev/video10
sudo modprobe -v v4l2loopback devices=1 video_nr=10 card_label="OBS Cam" exclusive_caps=1
# this is not a script, but you may turn it into such
# if you started with "obs", change into it:
# cd ..
# clone the required development sources for OBS and the V4L2 sink (output)
git clone --recursive https://github.com/obsproject/obs-studio.git
git clone https://github.com/CatxFish/obs-v4l2sink.git
cd obs-v4l2sink
sudo dnf install obs-devel
echo "patch file, see comments"
# patch the make file
# outcomment or delete in line 98 of external/FindLibObs.cmake:
# include(${LIBOBS_INCLUDE_DIR}/../cmake/external/ObsPluginHelpers.cmake)
# add this line instead:
# include(${LIBOBS_INCLUDE_DIR}/ObsPluginHelpers.cmake)
# now build the files
mkdir build && cd build
# you might need to adjust the path depending on how you installed OBS
cmake -D LIBOBS_INCLUDE_DIR=/usr/lib64/cmake/LibObs -D CMAKE_INSTALL_PREFIX=/usr ..
make -j4
# once done, install it
sudo make install
sudo mv /usr/lib/obs-plugins/v4l2sink.so /usr/lib64/obs-plugins/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment