Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Make OBS output act as a webcam
- There is a bug with v4l2loopback-dkms as of Ubuntu 18.04. Preferably, you should be able to install this from the package manager and not have issues. The problem is described here:
- https://github.com/umlaeute/v4l2loopback/issues/172
- The instructions below attempt to work around this. Use at your own risk. This was tested using OBS from deb, not from snap.
- Install these, if you don’t have them already.
- sudo apt install v4l-utils v4l2loopback-utils ffmpeg obs
- Clone the latest v4l2loopback git repo. Make a directory and cd into it.
- git clone https://github.com/umlaeute/v4l2loopback
- Navigate into this directory.
- Perform a
- make
- then a
- sudo make install
- At this point, it should build, but it won’t install the way we want.
- Navigate to /usr/src and verify there isn’t anything that looks like a v4l2loopback directory. Make one, called v4l2loopback-x.xx.x where the Xs are the version number as it appears in git. Navigate into it.
- Copy all the contents from our git/built directory into here. Once done, do this, substituting the correct version number:
- sudo dkms add -m v4l2loopback -v 0.12.1
- sudo dkms build -m v4l2loopback -v 0.12.1
- sudo dkms install -m v4l2loopback -v 0.12.1
- If you survived up to this point, proceed:
- Create a loopback (the exclusive_caps is for google chrome compatibility, it may be optional):
- sudo modprobe v4l2loopback devices=1 card_label="loopback 1" exclusive_caps=1,1,1,1,1,1,1,1
- identify the dummy device for the loopback:
- v4l2-ctl --list-devices
- In my case, it was /dev/video2. Make note of it, and substitute it in the command below.
- ffmpeg -re -f live_flv -i udp://localhost:12345 -f v4l2 /dev/video2
- This sets up an ffmpeg that takes the loopback and converts it to a udp URL locally on the computer. Leave this open in a terminal.
- Open OBS, go to settings, output, advanced, record. Change to output to URL. Paste in
- udp://localhost:12345
- and change the container to flv
- Apply, close settings, and then Start Recording. If all goes well, the ffmpeg output on the terminal should look like it’s processing frames. If it is, proceed.
- Open Firefox/Chrome and perform a webcam test. When it asks what webcam to choose, it should list one as “loopback 1.” Choose this.
- Warning: At the time of testing, Cheese couldn’t read the loopback properly, but the deb version of VLC was able to work if you specified the /dev/video device found above.
Advertisement
Add Comment
Please, Sign In to add comment