Open norayr opened 2 years ago
solved:
# v4l2-ctl --list-devices
Dummy video device (0x0000) (platform:v4l2loopback-000):
/dev/video2
Laptop Camera: Laptop Camera (usb-0000:00:14.0-7):
/dev/video0
/dev/video1
/dev/media0
found out that dummy video device is /dev/video2
so, changed command to:
gphoto2 --stdout --capture-movie | ffmpeg -i - -vcodec rawvideo -pix_fmt yuv420p -s 1024x683 -threads 2 -f v4l2 /dev/video2
and it worked!
if you see this: [video4linux2,v4l2 @ 0x55790ffc25e0] Unable to open V4L2 device '/dev/video4'
you need check which device your video4linux loopback driver is on, it might be another one like /dev/video3 or so. Use: v4l2-ctl --list-devices
to see which one is the v4l2loopback device.
I have a similar issue with Canon Poweshot G7 Max Mark iii. I made sure my v4l2l is on and, I could able to capture video running this command gphoto2 --stdout --capture-movie | ffmpeg -i - -vcodec rawvideo -pix_fmt yuv420p -s 1024x683 -threads 2 -f v4l2 /dev/video2
My device is video2 which I found out via v4l2-ctl --list-devices .
Second time when I tried the same I get below error
Error
Canon EOS M Full-Press failed (0x2019: PTP Device Busy)
ERROR: Could not capture image.
ERROR: Could not capture.
Error (-110: 'I/O in progress')
Also, I am able to capture movies at irregular instances. It doesn't work always if I reboot the camera. Let me know if I need to provide any other information.
solved:
# v4l2-ctl --list-devices Dummy video device (0x0000) (platform:v4l2loopback-000): /dev/video2 Laptop Camera: Laptop Camera (usb-0000:00:14.0-7): /dev/video0 /dev/video1 /dev/media0
found out that dummy video device is /dev/video2
so, changed command to:
gphoto2 --stdout --capture-movie | ffmpeg -i - -vcodec rawvideo -pix_fmt yuv420p -s 1024x683 -threads 2 -f v4l2 /dev/video2
and it worked!
Thanks man :1st_place_medal:
not sure it is a bug, or it is a gphoto2 bug.
i used to use my canon 6d dslr as a webcam with ffmpeg and gphoto2.
i was loading v4lloopabck module
modprobe v4l2loopback exclusive_caps=1 max_buffers=2
now it doesn't work i also tried to load module without any arguments but it doesn't help.
then i was doing:
gphoto2 --stdout --capture-movie | ffmpeg -i - -vcodec rawvideo -pix_fmt yuv420p -s 1024x683 -threads 2 -f v4l2 /dev/video4
or
gphoto2 --stdout --capture-movie | ffmpeg -i - -vcodec rawvideo -pix_fmt yuv420p -s 1368x912 -threads 2 -f v4l2 /dev/video4
in order to create a /dev/video4 device and start using it as a webcam. i specifically calculated the resolutions, because with those there is no distortion.
then i remember i had different problems with the setup last half of a year 2021.
right now i made new tests, and here are my problems now:
i tried to remove the pixel format, or to use
yuvj422p
like i see in the output. tried to remove the resolution from the commandline, nothing helped.so my two main problems might be:
Format mjpeg detected only with low score of 25, misdetection possible!
and
deprecated pixel format used, make sure you did set range correctly
.tried to list pixel formats and set a couple randomly and it did not help.
some more tests for you, those are successful:
actually gets the jpeg file.
and the following actually captures movie:
here, i can play it:
Name the camera camera is detected:
libgphoto2 and gphoto2 version output of: gphoto2 --version
i use gentoo, and i only compiled ptp2, canon, fuji backends. it always worked for me.
To Reproduce please see the above
If its a camera misbehavior, attach debug output using --debug --debug-logfile=debug.log (if considered useful).