emptythevoid

OBS-webcam-ubuntu1804

Apr 9th, 2019
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.46 KB | None | 0 0
  1. Make OBS output act as a webcam
  2. 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:
  3. https://github.com/umlaeute/v4l2loopback/issues/172
  4. The instructions below attempt to work around this. Use at your own risk. This was tested using OBS from deb, not from snap.
  5.  
  6. Install these, if you don’t have them already.
  7. sudo apt install v4l-utils v4l2loopback-utils ffmpeg obs
  8.  
  9. Clone the latest v4l2loopback git repo. Make a directory and cd into it.
  10. git clone https://github.com/umlaeute/v4l2loopback
  11. Navigate into this directory.
  12.  
  13. Perform a
  14. make
  15. then a
  16. sudo make install
  17.  
  18. At this point, it should build, but it won’t install the way we want.
  19.  
  20. 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.
  21.  
  22. Copy all the contents from our git/built directory into here. Once done, do this, substituting the correct version number:
  23.  
  24. sudo dkms add -m v4l2loopback -v 0.12.1
  25. sudo dkms build -m v4l2loopback -v 0.12.1
  26. sudo dkms install -m v4l2loopback -v 0.12.1
  27.  
  28. If you survived up to this point, proceed:
  29. Create a loopback (the exclusive_caps is for google chrome compatibility, it may be optional):
  30. sudo modprobe v4l2loopback devices=1 card_label="loopback 1" exclusive_caps=1,1,1,1,1,1,1,1
  31.  
  32. identify the dummy device for the loopback:
  33. v4l2-ctl --list-devices
  34.  
  35. In my case, it was /dev/video2. Make note of it, and substitute it in the command below.
  36.  
  37. ffmpeg -re -f live_flv -i udp://localhost:12345 -f v4l2 /dev/video2
  38. 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.
  39.  
  40. Open OBS, go to settings, output, advanced, record. Change to output to URL. Paste in
  41. udp://localhost:12345
  42. and change the container to flv
  43.  
  44. 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.
  45.  
  46. Open Firefox/Chrome and perform a webcam test. When it asks what webcam to choose, it should list one as “loopback 1.” Choose this.
  47.  
  48. 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