updates
This commit is contained in:
parent
004afa50fc
commit
f9241f8861
|
@ -216,9 +216,15 @@ class LoadStreams: # multiple IP or RTSP cameras
|
||||||
|
|
||||||
def update(self, index, cap):
|
def update(self, index, cap):
|
||||||
# Read next stream frame in a daemon thread
|
# Read next stream frame in a daemon thread
|
||||||
|
n = 0
|
||||||
while cap.isOpened():
|
while cap.isOpened():
|
||||||
_, self.imgs[index] = cap.read()
|
n += 1
|
||||||
time.sleep(0.01) # 33.3 FPS to keep buffer empty
|
# _, self.imgs[index] = cap.read()
|
||||||
|
cap.grab()
|
||||||
|
if n == 4: # read every 4th frame
|
||||||
|
_, self.imgs[index] = cap.retrieve()
|
||||||
|
n = 0
|
||||||
|
time.sleep(0.01) # wait time
|
||||||
|
|
||||||
def __iter__(self):
|
def __iter__(self):
|
||||||
self.count = -1
|
self.count = -1
|
||||||
|
|
Loading…
Reference in New Issue