LoadStreams() frame loss bug fix (#2222)

This commit is contained in:
Glenn Jocher authored and GitHub committed 2021-02-15 11:02:20 -08:00
1 parent 3ff783c18f
commit 7b833e37bf
1 file changed
+2 -1
+2 -1
View File
@@ -300,7 +300,8 @@ class LoadStreams: # multiple IP or RTSP cameras
# _, self.imgs[index] = cap.read()
cap.grab()
if n == 4: # read every 4th frame
_, self.imgs[index] = cap.retrieve()
success, im = cap.retrieve()
self.imgs[index] = im if success else self.imgs[index] * 0
n = 0
time.sleep(0.01) # wait time