|
|
@@ -284,8 +284,8 @@ 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[i] = (cap.get(cv2.CAP_PROP_FPS) % 100) or 30.0 # assume 30 FPS if cap gets 0 FPS |
|
|
|
self.frames[i] = int(cap.get(cv2.CAP_PROP_FRAME_COUNT)) or float('inf') # assume infinite stream if 0 len |
|
|
|
self.fps[i] = max(cap.get(cv2.CAP_PROP_FPS) % 100, 0) or 30.0 # 30 FPS fallback |
|
|
|
self.frames[i] = max(int(cap.get(cv2.CAP_PROP_FRAME_COUNT)), 0) or float('inf') # infinite stream fallback |
|
|
|
|
|
|
|
_, self.imgs[i] = cap.read() # guarantee first frame |
|
|
|
self.threads[i] = Thread(target=self.update, args=([i, cap]), daemon=True) |