Open Starbuck5 opened 12 months ago
Reported: https://stackoverflow.com/questions/77107362/float-division-by-zero-python-webcam-pygame-camera
Source: https://github.com/pygame-community/pygame-ce/blob/681f5b5e4e91f813f806c13b1183a7a1e18450d6/src_py/_camera_opencv.py#L74
It makes sense that this could return 0 if unknown, and then crash. The solution is likely to rewrite the OpenCV camera backend to use threading so it can convert the blocking OpenCV API into our non blocking API.
Stack Overflow page redirects to a 404.
Ok, stack overflow question got removed. The possibility of OpenCV returning 0 as webcam FPS and leading to a divide by zero error is still there.
Reported: https://stackoverflow.com/questions/77107362/float-division-by-zero-python-webcam-pygame-camera
Source: https://github.com/pygame-community/pygame-ce/blob/681f5b5e4e91f813f806c13b1183a7a1e18450d6/src_py/_camera_opencv.py#L74
It makes sense that this could return 0 if unknown, and then crash. The solution is likely to rewrite the OpenCV camera backend to use threading so it can convert the blocking OpenCV API into our non blocking API.