fix: use ffmpeg rtsp

This commit is contained in:
rendies 2023-01-18 16:58:49 +07:00
parent 556f2f3c70
commit cd7a2cdc57

View File

@ -34,13 +34,13 @@ def counter():
global people_count global people_count
return jsonify([ 1000, 980, 700, 500, 670, 567, people_count ]) return jsonify([ 1000, 980, 700, 500, 670, 567, people_count ])
@app.route("/video") # @app.route("/video")
@cross_origin() # @cross_origin()
def video_feed(): # def video_feed():
# return the response generated along with the specific media # # return the response generated along with the specific media
# type (mime type) # # type (mime type)
return Response(generate(), # return Response(generate(),
mimetype = "multipart/x-mixed-replace; boundary=frame") # mimetype = "multipart/x-mixed-replace; boundary=frame")
def open_ffmpeg_stream_process(height, width): def open_ffmpeg_stream_process(height, width):
# args = ( # args = (
@ -343,8 +343,8 @@ def PeopleCounter():
writer.write(frame) writer.write(frame)
# show the output frame # show the output frame
with lock: # with lock:
ffmpeg_process.stdin.write(frame.astype(np.uint8).tobytes()) ffmpeg_process.stdin.write(frame.astype(np.uint8).tobytes())
# outputFrame = frame.copy() # outputFrame = frame.copy()
# cv2.imshow("Real-Time Monitoring/Analysis Window", frame) # cv2.imshow("Real-Time Monitoring/Analysis Window", frame)