libgphoto2 icon indicating copy to clipboard operation
libgphoto2 copied to clipboard

how to get low lag using canon eos r as webcam??

Open pootle opened this issue 2 years ago • 4 comments

Running a canon EOS R as a webcam using sudo modprobe v4l2loopback exclusive_caps=1 max_buffers=2

and

gphoto2 --stdout --capture-movie | ffmpeg -i - -vcodec rawvideo -pix_fmt yuv420p -threads 0 -f v4l2 /dev/video0

results in much more lag than using the canon webcam utility on windows.

Its a fairly beastie laptop (Ryzen 7 5800h) so it's not cpu limited.

Is there anything I can do to get nearer the performance of the canon webcam utility?

pootle avatar Jul 21 '21 09:07 pootle

what amount of frames are reported by

gphoto2 --capture-movie=10s

(Just to get a feeling of the FPS we can deliver)

msmeissn avatar Jul 21 '21 09:07 msmeissn

Capturing preview frames as movie to 'movie.mjpg' for 10 seconds. 
Movie capture finished (416 frames)

that seems quite a lot!

pootle avatar Jul 21 '21 10:07 pootle

ok, this gets 40fps... so the lag is from the rest of the pipeline :/

msmeissn avatar Jul 21 '21 11:07 msmeissn

Hi @pootle. Maybe a little late, but if you still haven't managed to find a better way of doing it here's a gist where instead of FFmpeg they use GStreamer. I haven't been able to use it, but that may be related to missing configuration on my system (I use Fedora).

milovangudelj avatar Mar 28 '22 14:03 milovangudelj