You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何用GStreamer无转码重新推流RTSP H264流至UDP?

问题:无需转码通过UDP发送RTSP H264音视频流失败,单流发送正常

我希望无需转码,通过UDP发送RTSP的H264音视频流,但以下GStreamer管道无法正常工作:

gst-launch-1.0 -v rtspsrc location=rtsp://127.0.0.1:8554/steam  name=demux demux. ! queue ! rtph264depay ! h264parse ! mux. demux. ! queue ! rtpmp4gdepay ! aacparse ! queue ! mux. mpegtsmux name=mux alignment=7 ! udpsink host=192.168.1.1 port=5002

运行日志如下:

...
/GstPipeline:pipeline0/GstRTSPSrc:demux/GstRtpBin:manager/GstRtpSsrcDemux:rtpssrcdemux1.GstPad:rtcp_src_560534233: caps = application/x-rtcp, ssrc=(uint)560534233
/GstPipeline:pipeline0/GstRTSPSrc:demux/GstRtpBin:manager/GstRtpJitterBuffer:rtpjitterbuffer1.GstPad:sink_rtcp: caps = application/x-rtcp, ssrc=(uint)560534233
/GstPipeline:pipeline0/GstRTSPSrc:demux/GstRtpBin:manager/GstRtpSsrcDemux:rtpssrcdemux0.GstPad:rtcp_src_164951109: caps = application/x-rtcp, ssrc=(uint)164951109
/GstPipeline:pipeline0/GstRTSPSrc:demux/GstRtpBin:manager/GstRtpJitterBuffer:rtpjitterbuffer0.GstPad:sink_rtcp: caps = application/x-rtcp, ssrc=(uint)164951109
/GstPipeline:pipeline0/GstRTSPSrc:demux/GstRtpBin:manager/GstRtpJitterBuffer:rtpjitterbuffer0: ts-offset = 119978681
/GstPipeline:pipeline0/GstRTSPSrc:demux/GstRtpBin:manager/GstRtpJitterBuffer:rtpjitterbuffer0: ts-offset = 80018388
/GstPipeline:pipeline0/GstRTSPSrc:demux/GstRtpBin:manager/GstRtpJitterBuffer:rtpjitterbuffer0: ts-offset = 119978931
/GstPipeline:pipeline0/GstRTSPSrc:demux/GstRtpBin:manager/GstRtpJitterBuffer:rtpjitterbuffer0: ts-offset = 79926621
/GstPipeline:pipeline0/GstRTSPSrc:demux/GstRtpBin:manager/GstRtpJitterBuffer:rtpjitterbuffer0: ts-offset = 119935374
0:00:00.0 / 99:99:99.

不过我成功实现了音视频流分开发送,以下两个管道可以正常工作:

gst-launch-1.0 rtspsrc location=rtsp://127.0.0.1:8554/steam ! rtph264depay ! h264parse  ! mpegtsmux alignment=7 ! queue ! udpsink host=192.168.1.1 port=5002 sync=false
gst-launch-1.0 rtspsrc location=rtsp://127.0.0.1:8554/steam ! rtpmp4gdepay ! aacparse  ! mpegtsmux alignment=7 ! queue ! udpsink host=192.168.1.1 port=5002 sync=false

内容的提问来源于stack exchange,提问作者Mike

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.22 05:22:44