First install the required packages
sudo apt-get install gphoto2 v4l2loopback-utils v4l2loopback-dkms ffmpeg
Check the current / dev / video * after the installation is complete
ll /dev/video*
The hand environment is a notebook PC with a built-in camera and the following display
crw-rw----+ 1 root video 81,0 august 25 15:00 /dev/video0
crw-rw----+ 1 root video 81,1 August 25 15:00 /dev/video1
Then add a dummy video device
sudo modprobe v4l2loopback exclusive_caps=1 max_buffers=2
Check the number of the added device
ll /dev/video*
The following display in the hand environment
crw-rw----+ 1 root video 81,0 august 25 15:00 /dev/video0
crw-rw----+ 1 root video 81,1 August 25 15:00 /dev/video1
crw-rw----+ 1 root video 81,2 August 26 09:45 /dev/video2
Dummy device with / dev / video2
added. Use this later
Check the information of the added device
v4l2-ctl --device=/dev/video2 --info
Such a display at hand
Driver Info:
Driver name : v4l2 loopback
Card type : Dummy video device (0x0000)
Bus info : platform:v4l2loopback-000
Driver version : 5.4.44
Capabilities : 0x85208000
Video Memory-to-Memory
Read/Write
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x85208000
Video Memory-to-Memory
Read/Write
Streaming
Extended Pix Format
Device Capabilities
Connect the X-T3 to your PC via USB and run the following to gphoto2 stream the video to standard output. Write raw video with ffmpeg to / dev / video2 in yuv420p format.
gphoto2 --stdout --capture-movie | ffmpeg -i - -vcodec rawvideo -pix_fmt yuv420p -f v4l2 /dev/video2
Now, if you launch zoom and select dummy device as the video device X-T3 Webcam completed
It is troublesome to type the following command every time, so finish it so that it will be executed automatically
sudo modprobe v4l2loopback exclusive_caps=1 max_buffers=2
Create a module called dslr-webcam and put it in the list you want to load
cat << 'EOS' >> /etc/modprobe.d/dslr-webcam.conf
# Module options for Video4Linux, needed for our DSLR Webcam
alias dslr-webcam v4l2loopback
options v4l2loopback exclusive_caps=1 max_buffers=2
EOS
echo "dslr-webcam" >> /etc/modules
After rebooting, / dev / video0
was a Dummy device.
Check with the following command
v4l2-ctl --device=/dev/video0 --info
I can't remember the command every time I start capturing, so I created a fuji
command.
cat << 'EOS' > ~/bin/fuji
gphoto2 --stdout --capture-movie | ffmpeg -i - -vcodec rawvideo -pix_fmt yuv420p -f v4l2 /dev/video0
EOS
chmod +x ~/bin/fuji
Even after rebooting again, / dev / video0
was a Dummy device, so it seems that dslr-webcam
is loaded before the laptop camera in my environment.
It can be used as a webcam on zoom, but it is black on Skype.
When using with Skype, change the scale referring to the URL below -vf scale = 1024: 567
and it's OK.
gphoto2 --stdout --capture-movie | ffmpeg -i - -vcodec rawvideo -vf scale=1024:567 -pix_fmt yuv420p -f v4l2 /dev/video0
https://answers.microsoft.com/en-us/skype/forum/all/video-feed-from-capture-device-elgato-cam-link-4k/e596fff6-c7df-49b8-8d25-e19b5235aea4
https://medium.com/nerdery/dslr-webcam-setup-for-linux-9b6d1b79ae22
Recommended Posts