This commit is contained in:
Glenn Jocher 2019-09-25 00:38:26 +02:00
parent ccb971aa3c
commit 6daebd3979
1 changed files with 2 additions and 3 deletions

View File

@ -208,12 +208,11 @@ class LoadStreams: # multiple IP or RTSP cameras
w = int(cap.get(cv2.CAP_PROP_FRAME_WIDTH)) w = int(cap.get(cv2.CAP_PROP_FRAME_WIDTH))
h = int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT)) h = int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT))
fps = cap.get(cv2.CAP_PROP_FPS) % 100 fps = cap.get(cv2.CAP_PROP_FPS) % 100
print(' success (%gx%g at %.2f FPS).' % (w, h, fps)) _, self.imgs[i] = cap.read() # guarantee first frame
thread = Thread(target=self.update, args=([i, cap]), daemon=True) thread = Thread(target=self.update, args=([i, cap]), daemon=True)
print(' success (%gx%g at %.2f FPS).' % (w, h, fps))
thread.start() thread.start()
print('') # newline print('') # newline
time.sleep(0.5) # allow connections to start
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