Helper scripts for installing and running USB-enabled DSLR cameras on Debian distros.
-
install dependencies
sudo apt install -y gphoto2 sudo apt install -y v4l2loopback-utils sudo apt install -y ffmpeg
-
plug the cameras' USB cable and unmount/eject the camera (its initially mounted as a drive)
-
enable and determine the virtual video device (ignore errors)
sudo rmmod v4l2loopback
-
list all current video feeds (this will make it simpler to know which feed corresponds to the DSLR after we add it)
ls /dev/video*
-
activate
v3l2loopbacka
(driver responsible for enabling DSLR feed)sudo modprobe v4l2loopback exclusive_caps=1 max_buffers=2
-
list all video feed devices once more identify new DSLR feed
ls /dev/video*
-
detect DSLR feeds' camera make
gphoto2 --auto-detect
-
get video feed and pipe it out for use as a virtual device
gphoto2 --stdout --capture-movie | ffmpeg -i - -vcodec rawvideo -pix_fmt yuv420p -threads 0 -f v4l2
for example:
gphoto2 --stdout --capture-movie | ffmpeg -i - -vcodec rawvideo -pix_fmt yuv420p -threads 0 -f v4l2 /dev/video2
Simply, open app (e.g. OBS studio), and look for the virtually enabled device.
Comming soon!
be sure to checkout original youtube howto post
Handy? Star and follow the repo to keep up with all the updates. If there is a better way around something, or, if I'm just plain wrong about something, please create an issue and contribute to the repo ย ๐๐ป๐ป
Worth a second look? Lets fill all these nooks and crannies together. If you are interested in chatting about day-to-day tools like git and vim, let's get into it on twitter and youtube.