Ansible role to install gPhoto so that you can use a DSLR as a webcam.
This role was derived from Ben Chapman's blog post
This was also designed as part of a desktop provisioning playbooks found here https://github.com/billwheatley/provision-desktop
apt
dnf
is coming soon (this role will not fail on dnf but not do anything either)none
- name: My Playbook
hosts: all
roles:
- role: gphoto-dslr-role
With your camera plugged into the USB port and switched on:
# Take a picture and download to current dir
gphoto2 --capture-image-and-download
# Find your correct video device
v4l2-ctl --list-devices |grep v4l2loopback -A 1
# Stream Video
gphoto2 --stdout --capture-movie | ffmpeg -i - -vcodec rawvideo -pix_fmt yuv420p -threads 0 -f v4l2 /dev/video4
# Stream Video with GPU acceleration
gphoto2 --stdout --capture-movie | ffmpeg -hwaccel nvdec -c:v mjpeg_cuvid -i - -vcodec rawvideo -pix_fmt yuv420p -threads 0 -f v4l2 /dev/video4
GPLv2
Contact via Github