mirror of
https://github.com/rendies/People-Counting-in-Real-Time.git
synced 2025-05-14 09:59:29 +07:00
fix: accelerate with gpu
This commit is contained in:
parent
08a9122c3d
commit
4702d6ced1
|
@ -49,7 +49,7 @@ def open_ffmpeg_stream_process(height, width):
|
||||||
# "-f rtsp rtsp://172.23.90.205:8554/stream"
|
# "-f rtsp rtsp://172.23.90.205:8554/stream"
|
||||||
# ).split()
|
# ).split()
|
||||||
args = (
|
args = (
|
||||||
"ffmpeg -re -stream_loop -1 -f rawvideo -vcodec rawvideo -pix_fmt "
|
"ffmpeg -hwaccel cuda -re -stream_loop -1 -f rawvideo -vcodec rawvideo -pix_fmt "
|
||||||
"rgb24 -s " + str(width) + "x" + str(height) + " -i pipe:0 -pix_fmt nv12 "
|
"rgb24 -s " + str(width) + "x" + str(height) + " -i pipe:0 -pix_fmt nv12 "
|
||||||
"-c:v libx264 -preset fast -crf 22 -bf 0 "
|
"-c:v libx264 -preset fast -crf 22 -bf 0 "
|
||||||
"-f rtsp -rtsp_transport tcp rtsp://172.17.2.39/counter"
|
"-f rtsp -rtsp_transport tcp rtsp://172.17.2.39/counter"
|
||||||
|
@ -344,6 +344,7 @@ def PeopleCounter():
|
||||||
|
|
||||||
# show the output frame
|
# show the output frame
|
||||||
# with lock:
|
# with lock:
|
||||||
|
frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
|
||||||
ffmpeg_process.stdin.write(frame.astype(np.uint8).tobytes())
|
ffmpeg_process.stdin.write(frame.astype(np.uint8).tobytes())
|
||||||
|
|
||||||
# outputFrame = frame.copy()
|
# outputFrame = frame.copy()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user