Hello everyone.
I'm working with a USB camera that sometimes fails with the infamous select timeout issue. I'm working on fixing that but for now I just want to manually shutdown and restart the camera port whenever this happens.
So here is my question: how can I catch a select timeout error? I'm thinking something along these lines:
cap = cv2.VideoCapture(0)
while(True):
try:
success, frame = cap.read()
except SelectTimeoutException:
restart_port()
...
The problem is that either OpenCV is not actually raising a Python error but rather printing directly or there is already a Try/Except block somewhere in the cv2 source catching the exception.
I'd appreciate any help.