fix: use ffmpeg rtsp

This commit is contained in:
rendies 2023-01-18 16:54:37 +07:00
parent 62d0e16a89
commit d910d04b79

View File

@ -125,9 +125,7 @@ def PeopleCounter():
if config.Thread: if config.Thread:
vs = thread.ThreadingClass(config.url) vs = thread.ThreadingClass(config.url)
ret, frame = vs.read() ffmpeg_process = open_ffmpeg_stream_process(1920, 1080)
height, width, ch = frame.shape
ffmpeg_process = open_ffmpeg_stream_process(height, width)
# loop over frames from the video stream # loop over frames from the video stream
while True: while True:
# grab the next frame and handle if we are reading from either # grab the next frame and handle if we are reading from either
@ -344,9 +342,9 @@ def PeopleCounter():
writer.write(frame) writer.write(frame)
# show the output frame # show the output frame
with lock:
ffmpeg_process.stdin.write(frame.astype(np.uint8).tobytes())
ffmpeg_process.stdin.write(frame.astype(np.uint8).tobytes())
# with lock:
# outputFrame = frame.copy() # outputFrame = frame.copy()
# cv2.imshow("Real-Time Monitoring/Analysis Window", frame) # cv2.imshow("Real-Time Monitoring/Analysis Window", frame)
key = cv2.waitKey(1) & 0xFF key = cv2.waitKey(1) & 0xFF