用Gstreamer接收音频流会导致原因没有协商出错
我想用Gstreamer从MIC流式传输音频数据。 但是我无法用rx播放MIC音频。 如何从MIC输入播放音频流?
tx:gst-launch-1.0 -v alsasrc device =“hw:0”! 解码器! audioconvert! rtpL16pay! 队列! udpsink host = 239.0.0.1 auto-multicast = true port = 5004
rx:gst-launch-1.0 udpsrc multicast-group = 239.0.0.1 port = 5004 caps =“application / x-rtp”! rtpL16depay! alsasink
rx结果:将管道设置为PAUSED ...管道有效并且不需要PREROLL ...将管道设置为PLAYING ...新时钟:GstSystemClock ERROR:来自元素/ GstPipeline:pipeline0 / GstUDPSrc:udpsrc0:内部数据流错误。 其他调试信息:../../../../gstreamer-1.8.1/libs/gst/base/gstbasesrc.c(2948):gst_base_src_loop():/ GstPipeline:pipeline0 / GstUDPSrc:udpsrc0:串流任务暂停,原因未协商(-4)执行在0:00:00.009364000后结束将管道设置为PAUSED ...将管道设置为READY ...将管道设置为NULL ...释放管道...
tx结果如下。
将管道设置为PAUSED ...管道有效且不需要PREROLL ...将管道设置为PLAYING ...新时钟:GstAudioSrcClock / GstPipeline:pipeline0 / GstAlsaSrc:alsasrc0:actual-buffer-time = 200000 / GstPipeline:pipeline0 / GstAlsaSrc:alsasrc0:actual-latency-time = 10000 /GstPipeline:pipeline0/GstAlsaSrc:alsasrc0.GstPad:src:caps =“audio / x-raw , format =(string)S16LE , layout =(string )interdeved , rate =(int)44100 , channels =(int)2 , channel-mask =(bitmask)0x0000000000000003“/GstPipeline:pipeline0/GstDecodeBin:decodebin0.GstGhostPad:sink.GstProxyPad: proxypad0:caps =“audio / x-raw , format =(string)S16LE , layout =(string)interleaved , rate =(int)44100 , channels =(int)2 , channel-mask =(bitmask)0x0000000000000003“/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstTypeFindElement:typefind.GstPad:src:cap =”audio / x-raw , format =(string)S16LE layout =(string)interleaved , rate =(int)44100 , channels =(int)2 , channel-mask =(bitmask)0x0000000000000003“Red 属性延迟... /GstPipeline:pipeline0/GstAudioConvert:audioconvert0.GstPad:src:cap =“audio / x-raw , layout =(string)interleaved , rate =(int)44100 , format =(string)S16BE , channels =(int)2 , channel-mask =(bitmask)0x0000000000000003“/GstPipeline:pipeline0/GstRtpL16Pay:rtpl16pay0.GstPad:src:caps =”application / x-rtp , media =(string)audio , clock-rate =(int)44100 , encoding-name =(string)L16 , encoding-params =(string)2 =(int)2 , payload =(int)96 , ssrc =(uint)3961155089 , timestamp-offset =(uint)725507323 , seqnum-offset =(uint)20783 “/GstPipeline:pipeline0/GstQueue:queue0.GstPad:src:cap =”application / x-rtp , media =(string)audio , clock-rate =(int)44100 , encoding-name =(string)L16 , encoding-params =(string)2 , channels =(int)2 , payload =(int)96 , ssrc =(uint)3961155089 timestamp-offset =(uint)725507323 , seqnum-offset =(uint)20783“/GstPipeline:pipeline0/GstUDPSink:udpsink0.GstPad:sink:caps =”application / x-rtp , media = (串)AU dio , clock-rate =(int)44100 , encoding-name =(string)L16 , encoding-params =(string)2 , channels =(int)2 有效载荷 =(int)96 , ssrc =(uint)3961155089 , timestamp-offset =(uint)725507323 , seqnum-offset =(uint)20783“/ GstPipeline:pipeline0 / GstQueue:queue0 .GstPad:sink:caps =“application / x-rtp , media =(string)audio , clock-rate =(int)44100 , encoding-name =(string)L16 (uint)3961155089 , timestamp-offset =(uint)=> 725507323 , seqnum-offset =(uint)20783“/GstPipeline:pipeline0/GstRtpL16Pay:rtpl16pay0.GstPad:sink:caps =”audio / x-raw , layout =(string)interleaved , rate =(int)44100 , format =(string)S16BE , channels =(int)2 , channel-mask =(bitmask)0x0000000000000003“/GstPipeline:pipeline0/GstAudioConvert:audioconvert0.GstPad:sink :string =“audio / x-raw , format =(string)S16LE , layout =(string)interleaved , rate =(int)44100 , channel-mask =(bitmask)0x0000000000000003“/ Gst Pipeline:pipeline0 / GstDecodeBin:decodebin0.GstDecodePad:src_0.GstProxyPad:proxypad1:caps =“audio / x-raw , format =(string)S16LE , layout =(string)interleaved , rate = (int)44100 , channels =(int)2 , channel-mask =(bitmask)0x0000000000000003“/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstTypeFindElement:typefind.GstPad:sink:caps =”audio / x -raw , format =(string)S16LE , layout =(string)interleaved , rate =(int)44100 , channels =(int)2 (bitmask)0x0000000000000003“/GstPipeline:pipeline0/GstDecodeBin:decodebin0.GstGhostPad:sink:caps =”audio / x-raw , format =(string)S16LE , layout =(string)interleaved , rate =(int)44100 , channels =(int)2 , channel-mask =(bitmask)0x0000000000000003“/ GstPipeline:pipeline0 / GstRtpL16Pay:rtpl16pay0:timestamp = 725507323 / GstPipeline:pipeline0 / GstRtpL16Pay:rtpl16pay0: seqnum = 20783
我认为rx管道是错误的,但我找不到解决方案。 请告诉我如何制作管道。
PS:我尝试了下面的命令,然后rx播放麦克风音频! 这意味着接收器设备无法播放L16音频?
tx:gst-launch-1.0 -v alsasrc device =“hw:0”! 解码器! audioconvert! audioresample! 阿拉文克! rtppcmapay! 队列! udpsink host = 239.0.0.1 auto-multicast = true port = 5004
rx:gst-launch-1.0 udpsrc multicast-group = 239.0.0.1 port = 5004 caps =“application / x-rtp,media =(string)audio,clock-rate =(int)8000,encoding-name =(string) PCMA,encoding-params =(string)2,channels =(int)1,payload =(int)8“! rtppcmadepay! alawdec! alsasink
您需要在接收中添加上限,请尝试以下管道:
gst-launch-1.0 udpsrc multicast-group = 239.0.0.1 port = 5004 caps ='application / x-rtp,media =(string)audio,clock-rate =(int)44100,encoding-name =(string)L16, encoding-params =(string)2,channels =(int)2,payload =(int)96'! rtpL16depay! audioconvert! alsasink
链接地址: http://www.djcxy.com/p/7649.html上一篇: Recieving audio stream with Gstreamer results in reason not negotiated error