Video
From Achintya Rao’s Wiki
(Some pages to create to organise my thoughts and notes around video recording and streaming (including videoconferences).)
Using OBS output device with DSLR as input device
Across two separate blog posts, I learnt how to use the v4l2loopback Linux kernel module to use my DSLR as a webcam alternative and the output of OBS / OBS Studio as a fake webcam:
- Using OBS Studio with V4L2 for Google Meet
- The blog post shows how to load the module once, but does not explain how to make sure it loads every time.
- How to Use Your DSLR Camera as a Webcam in Linux
In order to get the kernel module to load every time I reboot, I created the following files:
/etc/modprobe.d/v4l2loopback.confwith the following contents:options v4l2loopback devices=2 video_nr=10,11 card_label="OBS Cam,Canon 60D" exclusive_caps=1 max_buffers=2- The video devices are namely
/dev/video10for the “OBS Cam” output and/dev/video11for the “Canon 60D” input.
- The video devices are namely
/etc/modules-load.d/v4l2loopback.confwith the following contents:v4l2loopback
I also created an alias in my .bash_aliases file to activate the DSLR as an input device:
alias 60D='gphoto2 --stdout --capture-movie | ffmpeg -i - -vcodec rawvideo -pix_fmt yuv420p -threads 0 -f v4l2 /dev/video11'
This way, I need to type 60D in my terminal to accept the camera’s input.
