Why is stream from usb camera frozen?
I ran my example in Raspberry Pi 3 (Raspbian OS). I got frames from 2-3 cams. When running first, my example was ok. Then, sometimes, one of cams could not get frame. I think stream from usb camera freeze. Because it's ok when unplugging and plugging in.
My code:
cam = cv2.VideoCapture(index)
// Set fps, width,height for cam
while True:
ret,frame = cam.read()
or
rt = cam.grab()
ret, frame = cam.retrieve(rt)
cam.release
I used multi-thread for getting image from 2-3 cams. Each thread for each cam.