My code always freezes on me. I'm testing it on this code.
import cv2
cap = cv2.VideoCapture('/dev/video0') # frozen
ret, frame = cap.read()
print(ret, frame)
My configuration is
raspberry pi
Python 3.9.2
Canon 600D
this command works normally
gphoto2 --stdout --capture-movie | ffmpeg -i - -vcodec rawvideo -pix_fmt yuv420p -threads 0 -f v4l2 /dev/video0
There may be a bug in the Cannon 600D.
it needed to run
sudo modprobe v4l2loopback
and
gphoto2 --stdout --capture-movie | ffmpeg -i - -vcodec rawvideo -pix_fmt yuv420p -threads 0 -f v4l2 /dev/video0
and gphoto2 run