gpt4 book ai didi

gstreamer - Gstreamer管道的CPU使用率和内存

转载 作者:行者123 更新时间:2023-12-02 23:58:03 29 4
gpt4 key购买 nike

我使用 gstreamer 从网络摄像头捕获视频,使用 x264 对其进行编码,并使用 gstrtpbin 对其进行流式传输。效果很好。然而,它使用了我所有四个核心的大约 50% 以及大量内存。有什么办法可以降低 CPU 和内存使用率吗?这是管道。

pipeline_description = "gstrtpbin latency=0 max-latency=100 drop-on-latency=true use-pipeline-clock=true ntp-sync=true name=rtpbin " \
"autovideosrc ! video/x-raw-yuv,width=640,height=480,framerate=30/1 ! " \
"tee name=t_vid ! queue ! fpsdisplaysink name=fpssink text-overlay=false video-sink=xvimagesink signal-fps-measurements=true t_vid. ! " \
"queue ! videorate ! ffmpegcolorspace ! x264enc pass=qual tune=zerolatency quantizer=40 ! queue ! rtph264pay ! rtpbin.send_rtp_sink_0 " \
"rtpbin.send_rtp_src_0 ! udpsink port=%d host=%s sync=false async=false rtpbin.send_rtcp_src_0 ! " \
"udpsink port=%d host=%s sync=false async=false name=vrtcpsink udpsrc port=%d ! " \
"rtpbin.recv_rtcp_sink_0 autoaudiosrc ! queue ! audioresample ! audioconvert ! alawenc ! rtppcmapay ! rtpbin.send_rtp_sink_1 " \
"rtpbin.send_rtp_src_1 ! udpsink port=%d host=%s sync=false async=false rtpbin.send_rtcp_src_1 ! " \
"udpsink port=%d host=%s sync=false async=false udpsrc port=%d ! rtpbin.recv_rtcp_sink_1" % (VRTP_SEND_PORT, DEST,
VRTCP_SEND_PORT, DEST, VRTCP_RECV_PORT, ARTP_SEND_PORT, DEST, ARTCP_SEND_PORT, DEST, ARTCP_RECV_PORT)

最佳答案

我也见过这个问题 - 使用sync=false 似乎会触发 100% CPU。还有另一个线程Streaming RTP/RTSP: sync/timestamp problems就是讲这个的。 HTH

关于gstreamer - Gstreamer管道的CPU使用率和内存,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5530074/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com