@@ -284,7 +284,7 @@ class LoadStreams: # multiple IP or RTSP cameras | |||
assert cap.isOpened(), f'Failed to open {s}' | |||
w = int(cap.get(cv2.CAP_PROP_FRAME_WIDTH)) | |||
h = int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT)) | |||
self.fps = cap.get(cv2.CAP_PROP_FPS) % 100 | |||
self.fps = (cap.get(cv2.CAP_PROP_FPS) % 100) or 30.0 # assume 30 FPS if cap gets 0 FPS | |||
self.frames = int(cap.get(cv2.CAP_PROP_FRAME_COUNT)) | |||
_, self.imgs[i] = cap.read() # guarantee first frame |