I tried adding my Canon EOS M50 as a webcam using v4l2 loopback like this:
gphoto2 --stdout --capture-movie | ffmpeg -i - -vcodec rawvideo -pix_fmt yuv420p -threads 0 -f v4l2 /dev/video0
It works but the picture is 512x288.
On the other hand SparkoCam on a Windows box can squeeze 1080p liveview out of it with decent fps and full control over ISO etc. The picture is very sharp and does not look upscaled (although I didn't do a pixel by pixel analysis yet). Anyway: how can I achieve the same or similar results with gphoto2?
I am also experiencing this issue. When I use entangle to view my live preview of my Canon M50 it shows a 1024x576 preview image so I know that Ubuntu is capable of streaming a better preview. However, I cannot figure out how to fix the gphoto2 configuration to use it to stream a 1024x576 preview.
EDIT: Well, now it's working for some reason. Try opening entangle and toggling live preview on and off a few times until your resolution is 1024x576. Then run gphoto2 again and see if your resolution has improved to 1024x576. That seemed to work for me.
And now it's not working. I can't figure this out.
EDIT2: I think I have a solution. Run
entangle --debug-entangle
in a terminal. Click the live preview button in entangle a few times until it is displaying a resolution of 1024x576. Then Ctrl+C out of entangle. Now rungphoto2 --stdout --capture-movie | ffmpeg -i - -vcodec rawvideo -pix_fmt yuv420p -threads 0 -f v4l2 /dev/video0
The resolution should be set to 1024x576.Use command
gphoto2 --get-config liveviewsize
to get live view size options. For me, it was: 0 for large, 1 for medium, 2 for small (my case Canon M50). Then you can pass it as parameters. As following:gphoto2 --set-config liveviewsize=0 --capture-movie
. Which giving final command:gphoto2 --stdout --set-config liveviewsize=0 --capture-movie | ffmpeg -i - -vcodec rawvideo -pix_fmt yuv420p -threads 0 -f v4l2 -s:v 1920x1080 -r 25 /dev/video2
. Where/dev/video2
name of my DSLR device.