OBS Studio: Difference between revisions

add missing line loading the v4l2loopback kernel module without which is does not work.
Using the Virtual Camera: Adding a note on how to modify your v4l2loopback module config to have additional virtual devices such as you might use to use a DSLR as a webcam with gphoto2
Line 57: Line 57:
It is possible to use [[Droidcam]] as virtual camera.
It is possible to use [[Droidcam]] as virtual camera.


If you use a digital camera as a webcam via [http://gphoto.org/ gphoto2] you will need an additional loopback device to use this camera as a virtual camera. For a setup like this you may wish to change the above v4l2loopback module config to  something like this:<syntaxhighlight lang="nix">
boot.extraModprobeConfig = ''
  options v4l2loopback devices=2 video_nr=1,2 card_label="OBS Cam, Virt Cam" exclusive_caps=1
'';
</syntaxhighlight>For more the [https://wiki.archlinux.org/title/V4l2loopback#Loading_the_kernel_module arch wiki entry on v4l2loopback] is a good reference.
In addition to <code>gphoto2</code> you will need the <code>v4l-utils</code> and <code>ffmpeg</code> packages so that you can use gphoto2 to send the raw feed from your camera to the virtual camera via ffmpeg for example using a command like this<ref>https://austingil.com/dslr-webcam-linux/</ref>:<syntaxhighlight lang="bash">
gphoto2 --stdout autofocusdrive=1 --capture-movie | ffmpeg -i - -vcodec rawvideo -pix_fmt yuv420p -threads 0 -f v4l2 /dev/video2
</syntaxhighlight>
[[Category:Applications]]
[[Category:Applications]]