Ffmpeg 创建gstreamer管道以发送H264+;MPEG2-TS和RTP上的AC3

Ffmpeg 创建gstreamer管道以发送H264+;MPEG2-TS和RTP上的AC3,ffmpeg,gstreamer,gstreamer-1.0,Ffmpeg,Gstreamer,Gstreamer 1.0,发送器和接收器管道: .\gst-launch-1.0.exe -v mpegtsmux name=mux ! tsparse set-timestamps=true ! rtpmp2tpay ! udpsink host=127.0.0.1 port=8888 videotestsrc is-live=true ! videoconvert ! x264enc ! mux. audiotestsrc is-live=true ! audioresample ! audioconvert

发送器和接收器管道:

.\gst-launch-1.0.exe -v mpegtsmux name=mux ! tsparse set-timestamps=true ! rtpmp2tpay ! udpsink host=127.0.0.1 port=8888   videotestsrc is-live=true ! videoconvert ! x264enc ! mux.   audiotestsrc is-live=true ! audioresample ! audioconvert ! audio/x-raw,rate=44100,channels=2,depth=16 ! avenc_ac3 ! ac3parse ! mux.
我得到一个延迟链接失败的警告,然后我什么也得不到,只有
0:00:00.455121000 74464 00000219572127C0警告h264解析gsth264解析。c:1492:gst_h264_解析_句柄_帧:损坏/无效的nal类型:1个切片,大小:6121将被删除
Type警告

如果我移除接收器的音频支架,它可以正常播放。如果我只播放音频部分,我会得到:

.\gst-launch-1.0.exe -v udpsrc address=127.0.0.1 port=8888 ! "application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)MP2T" ! rtpmp2tdepay ! tsdemux name=demux    demux. ! queue ! ac3parse ! avdec_ac3 ! autoaudiosink
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)MP2T
0:00:04.773422000 75296 00000287541297C0 WARN                 default gst/parse/grammar.y:544:gst_parse_no_more_pads:<demux> warning: Delayed linking failed.
/GstPipeline:pipeline0/GstRtpMP2TDepay:rtpmp2tdepay0.GstPad:src: caps = video/mpegts, packetsize=(int)188, systemstream=(boolean)true
0:00:04.778044000 75296 00000287541297C0 WARN                 default gst/parse/grammar.y:544:gst_parse_no_more_pads:<demux> warning: failed delayed linking some pad of GstTSDemux named demux to some pad of GstQueue named queue0
/GstPipeline:pipeline0/GstTSDemux:demux.GstPad:sink: caps = video/mpegts, packetsize=(int)188, systemstream=(boolean)true
/GstPipeline:pipeline0/GstRtpMP2TDepay:rtpmp2tdepay0.GstPad:sink: caps = application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)MP2T
WARNING: from element /GstPipeline:pipeline0/GstTSDemux:demux: Delayed linking failed.
Additional debug info:
gst/parse/grammar.y(544): gst_parse_no_more_pads (): /GstPipeline:pipeline0/GstTSDemux:demux:
failed delayed linking some pad of GstTSDemux named demux to some pad of GstQueue named queue0
0:00:04.927067000 75296 00000287541297C0 WARN                 basesrc gstbasesrc.c:3127:gst_base_src_loop:<udpsrc0> error: Internal data stream error.
0:00:04.935063000 75296 00000287541297C0 WARN                 basesrc gstbasesrc.c:3127:gst_base_src_loop:<udpsrc0> error: streaming stopped, reason not-linked (-1)
ERROR: from element /GstPipeline:pipeline0/GstUDPSrc:udpsrc0: Internal data stream error.
Additional debug info:
../libs/gst/base/gstbasesrc.c(3127): gst_base_src_loop (): /GstPipeline:pipeline0/GstUDPSrc:udpsrc0:
streaming stopped, reason not-linked (-1)
Execution ended after 0:00:04.895837000
Setting pipeline to NULL ...
Freeing pipeline ...
\gst-launch-1.0.exe-v udpsrc address=127.0.0.1 port=8888!“应用程序/x-rtp,媒体=(字符串)视频,时钟速率=(int)90000,编码名称=(字符串)MP2T”!rtpmp2tdepay!tsdemux name=demux demux!队列ac3parse!avdec_ac3!自动音频接收器
正在将管道设置为暂停。。。
管道是带电的,不需要预滚。。。
管道已预卷。。。
正在将管道设置为播放。。。
新时钟:GstSystemClock
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src:caps=application/x-rtp,媒体=(字符串)视频,时钟速率=(int)90000,编码名称=(字符串)MP2T
0:00:04.773422000 75296 00000 287541297C0警告默认gst/parse/grammar。y:544:gst\u parse\u no\u more\u pads:警告:延迟链接失败。
/GstPipeline:pipeline0/GstRtpMP2TDepay:rtpmp2tdepay0.GstPad:src:caps=video/mpegts,packetsize=(int)188,systemstream=(boolean)true
0:00:04.778044000 75296 00000 287541297C0警告默认gst/parse/grammar.y:544:gst_parse_no_more_pads:警告:将名为demux的GstTSDemux的某些pad链接到名为queue0的GstQueue的某些pad失败延迟
/GstPipeline:pipeline0/GstTSDemux:demux.GstPad:sink:caps=video/mpegts,packetsize=(int)188,systemstream=(boolean)true
/GstPipeline:pipeline0/GstRtpMP2TDepay:rtpmp2tdepay0.GstPad:sink:caps=application/x-rtp,媒体=(字符串)视频,时钟速率=(int)90000,编码名称=(字符串)MP2T
警告:从元素/GstPipeline:pipeline0/GstTSDemux:demux:延迟链接失败。
其他调试信息:
gst/parse/grammar.y(544):gst\u parse\u no\u more\u pads():/GstPipeline:pipeline0/GstTSDemux:demux:
将名为demux的GstTSDemux的某个pad链接到名为queue0的GstQueue的某个pad失败
0:00:04.927067000 75296 00000287541297C0 WARN basesrc gstbasesrc.c:3127:gst_base_src_循环:错误:内部数据流错误。
0:00:04.93506300075296 00000287541297C0 WARN basesrc gstbasesrc.c:3127:gst_base_src_循环:错误:流停止,原因未链接(-1)
错误:来自元素/GstPipeline:pipeline0/GstUDPSrc:udpsrc0:内部数据流错误。
其他调试信息:
../libs/gst/base/gstbasesrc.c(3127):gst_base_src_loop():/GstPipeline:pipeline0/GstUDPSrc:udpsrc0:
流停止,原因未链接(-1)
执行于0:00:04.895837000后结束
正在将管道设置为空。。。
释放管道。。。
我不确定这有什么不对。退一步说,我真正想要实现的是在OBS中从FFMPEG接收H264+AAC(而不是AC3)。这是行不通的,因为我已经隔离了问题的一部分,这似乎取决于我是如何发送音频的。我现在只在gstreamer中工作,以便在返回FFMPEG土地之前让它在接收端工作

.\gst-launch-1.0.exe -v udpsrc address=127.0.0.1 port=8888 ! "application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)MP2T" ! rtpmp2tdepay ! tsdemux name=demux    demux. ! queue ! ac3parse ! avdec_ac3 ! autoaudiosink
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)MP2T
0:00:04.773422000 75296 00000287541297C0 WARN                 default gst/parse/grammar.y:544:gst_parse_no_more_pads:<demux> warning: Delayed linking failed.
/GstPipeline:pipeline0/GstRtpMP2TDepay:rtpmp2tdepay0.GstPad:src: caps = video/mpegts, packetsize=(int)188, systemstream=(boolean)true
0:00:04.778044000 75296 00000287541297C0 WARN                 default gst/parse/grammar.y:544:gst_parse_no_more_pads:<demux> warning: failed delayed linking some pad of GstTSDemux named demux to some pad of GstQueue named queue0
/GstPipeline:pipeline0/GstTSDemux:demux.GstPad:sink: caps = video/mpegts, packetsize=(int)188, systemstream=(boolean)true
/GstPipeline:pipeline0/GstRtpMP2TDepay:rtpmp2tdepay0.GstPad:sink: caps = application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)MP2T
WARNING: from element /GstPipeline:pipeline0/GstTSDemux:demux: Delayed linking failed.
Additional debug info:
gst/parse/grammar.y(544): gst_parse_no_more_pads (): /GstPipeline:pipeline0/GstTSDemux:demux:
failed delayed linking some pad of GstTSDemux named demux to some pad of GstQueue named queue0
0:00:04.927067000 75296 00000287541297C0 WARN                 basesrc gstbasesrc.c:3127:gst_base_src_loop:<udpsrc0> error: Internal data stream error.
0:00:04.935063000 75296 00000287541297C0 WARN                 basesrc gstbasesrc.c:3127:gst_base_src_loop:<udpsrc0> error: streaming stopped, reason not-linked (-1)
ERROR: from element /GstPipeline:pipeline0/GstUDPSrc:udpsrc0: Internal data stream error.
Additional debug info:
../libs/gst/base/gstbasesrc.c(3127): gst_base_src_loop (): /GstPipeline:pipeline0/GstUDPSrc:udpsrc0:
streaming stopped, reason not-linked (-1)
Execution ended after 0:00:04.895837000
Setting pipeline to NULL ...
Freeing pipeline ...