【问题标题】:Recieving audio stream with Gstreamer results in reason not negotiated error使用 Gstreamer 接收音频流导致原因未协商错误
【发布时间】:2018-06-21 15:11:55
【问题描述】:

我想使用 Gstreamer 从 MIC 流式传输音频数据。 但是我无法使用 rx 播放 MIC 音频。 如何从 MIC 输入播放音频流?

tx: gst-launch-1.0 -v alsasrc device="hw:0" !解码器!音频转换 ! rtpL16pay !队列 ! udpsink 主机=239.0.0.1 自动多播=true 端口=5004

rx: gst-launch-1.0 udpsrc 多播组=239.0.0.1 端口=5004 大写=“应用程序/x-rtp”! rtpL16depay!下水道

rx 结果:将管道设置为 PAUSED ... 管道是活动的 不需要 PREROLL ... 将管道设置为 PLAYING ... 新时钟: GstSystemClock 错误:来自元素 /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 ... 设置 管道准备就绪 ... 将管道设置为 NULL ... 释放管道 ...

tx结果如下。

将管道设置为 PAUSED ... 管道处于活动状态且不需要 PREROLL ... 将管道设置为 PLAYING ... 新时钟: GstAudioSrcClock /GstPipeline:pipeline0/GstAlsaSrc:alsasrc0: 实际缓冲时间 = 200000 /GstPipeline:pipeline0/GstAlsaSrc:alsasrc0: 实际延迟时间 = 10000 /GstPipeline:pipeline0/GstAlsaSrc:alsasrc0.GstPad:src: caps = "音频/x-raw\,\ 格式\=(字符串)S16LE\,\ layout\=(string)interleaved\,\ rate\=(int)44100\,\ 通道\=(int)2\,\通道掩码\=(位掩码)0x0000000000000003“ /GstPipeline:pipeline0/GstDecodeBin:decodebin0.GstGhostPad:sink.GstProxyPad:proxypad0: caps = "audio/x-raw\,\ format\=(string)S16LE\,\ layout\=(string)interleaved\,\ rate\=(int)44100\,\ 通道\=(int)2\,\通道掩码\=(位掩码)0x0000000000000003“ /GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstTypeFindElement:typefind.GstPad:src: caps = "audio/x-raw\,\ format\=(string)S16LE\,\ layout\=(string)interleaved\,\ rate\=(int)44100\,\ 通道\=(int)2\,\通道掩码\=(位掩码)0x0000000000000003“ 重新分配延迟... /GstPipeline:pipeline0/GstAudioConvert:audioconvert0.GstPad:src: 大写 = "audio/x-raw\,\ layout\=(string)interleaved\,\ rate\=(int)44100\,\ format\=(string)S16BE\,\ channels\=(int)2\,\ 通道掩码\=(位掩码)0x0000000000000003" /GstPipeline:pipeline0/GstRtpL16Pay:rtpl16pay0.GstPad:src: caps = “应用程序/x-rtp\,\ 媒体\=(字符串)音频\,\ 时钟速率\=(int)44100\,\ 编码名称\=(字符串)L16\,\ encoding-params\=(string)2\,\ channels\=(int)2\,\ 有效载荷\=(int)96\,\ ssrc\=(uint)3961155089\,\ 时间戳偏移量\=(uint)725507323\,\ seqnum-offset\=(uint)20783" /GstPipeline:pipeline0/GstQueue:queue0.GstPad:src: caps = “应用程序/x-rtp\,\ 媒体\=(字符串)音频\,\ 时钟速率\=(int)44100\,\ 编码名称\=(字符串)L16\,\ encoding-params\=(string)2\,\ channels\=(int)2\,\ 有效载荷\=(int)96\,\ ssrc\=(uint)3961155089\,\ 时间戳偏移量\=(uint)725507323\,\ seqnum-offset\=(uint)20783" /GstPipeline:pipeline0/GstUDPSink:udpsink0.GstPad:sink: caps = “应用程序/x-rtp\,\ 媒体\=(字符串)音频\,\ 时钟速率\=(int)44100\,\ 编码名称\=(字符串)L16\,\ encoding-params\=(string)2\,\ channels\=(int)2\,\ 有效载荷\=(int)96\,\ ssrc\=(uint)3961155089\,\ 时间戳偏移量\=(uint)725507323\,\ seqnum-offset\=(uint)20783" /GstPipeline:pipeline0/GstQueue:queue0.GstPad:sink: caps = “应用程序/x-rtp\,\ 媒体\=(字符串)音频\,\ 时钟速率\=(int)44100\,\ 编码名称\=(字符串)L16\,\ encoding-params\=(string)2\,\ channels\=(int)2\,\ 有效载荷\=(int)96\,\ ssrc\=(uint)3961155089\,\ 时间戳偏移量\=(uint)725507323\,\ seqnum-offset\=(uint)20783" /GstPipeline:pipeline0/GstRtpL16Pay:rtpl16pay0.GstPad:sink: caps = "audio/x-raw\,\ layout\=(string)interleaved\,\ rate\=(int)44100\,\ 格式\=(字符串)S16BE\,\ 通道\=(int)2\,\ 通道掩码\=(位掩码)0x0000000000000003" /GstPipeline:pipeline0/GstAudioConvert:audioconvert0.GstPad:sink: caps = "audio/x-raw\,\ format\=(string)S16LE\,\ layout\=(string)interleaved\,\ rate\=(int)44100\,\ 通道\=(int)2\,\通道掩码\=(位掩码)0x0000000000000003“ /GstPipeline:pipeline0/GstDecodeBin:decodebin0.GstDecodePad:src_0.GstProxyPad:proxypad1: caps = "audio/x-raw\,\ format\=(string)S16LE\,\ layout\=(string)interleaved\,\ rate\=(int)44100\,\ 通道\=(int)2\,\通道掩码\=(位掩码)0x0000000000000003“ /GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstTypeFindElement:typefind.GstPad:sink: caps = "audio/x-raw\,\ format\=(string)S16LE\,\ layout\=(string)interleaved\,\ rate\=(int)44100\,\ 通道\=(int)2\,\通道掩码\=(位掩码)0x0000000000000003“ /GstPipeline:pipeline0/GstDecodeBin:decodebin0.GstGhostPad:sink: caps = "audio/x-raw\,\ format\=(string)S16LE\,\ layout\=(string)interleaved\,\ rate\=(int)44100\,\ 通道\=(int)2\,\通道掩码\=(位掩码)0x0000000000000003“ /GstPipeline:pipeline0/GstRtpL16Pay:rtpl16pay0: 时间戳 = 725507323 /GstPipeline:pipeline0/GstRtpL16Pay:rtpl16pay0: seqnum = 20783

我认为 rx 管道是错误的,但我找不到解决方案。 请告诉我如何制作管道。

PS: 我尝试了以下命令,然后 rx 播放麦克风音频!这意味着接收设备无法播放 L16 音频?

tx: gst-launch-1.0 -v alsasrc device="hw:0" !解码器!音频转换 !音频重采样!阿拉文克! rtppcmapay !队列 ! udpsink 主机=239.0.0.1 自动多播=真端口=5004

rx: gst-launch-1.0 udpsrc 多播组=239.0.0.1 端口=5004 大写=“应用程序/x-rtp,媒体=(字符串)音频,时钟速率=(整数)8000, 编码名称=(字符串)PCMA,编码参数=(字符串)2, 频道=(int)1,有效载荷=(int)8“!rtppcmadepay!alawdec!alsasink

【问题讨论】:

    标签: audio gstreamer multicast gstreamer-1.0


    【解决方案1】:

    您需要在接收中添加大写,尝试以下管道:

    gst-launch-1.0 udpsrc 多播组=239.0.0.1 端口=5004 大写='应用程序/x-rtp,媒体=(字符串)音频,时钟速率=(int)44100, 编码名称=(字符串)L16,编码参数=(字符串)2,通道=(整数)2, 有效载荷=(int)96'! rtpL16depay!音频转换!下水道

    【讨论】:

    • 感谢您的回复。实际上我尝试了相同的命令,但结果并没有改变我的问题......你知道为什么吗?
    • 您可以尝试遵循管道以查看您是否真的获得了一些数据(如果您收到它应该在终端上打印数据)? gst-launch-1.0 udpsrc 多播组=239.0.0.1 端口=5004 caps='application/x-rtp, media=(string)audio, clock-rate=(int)44100, encoding-name=(string)L16,编码参数=(字符串)2,通道=(整数)2,有效载荷=(整数)96'! rtpL16depay! fakesink dump=true
    • 是的,我得到了转储数据。结果如下。将管道设置为 PAUSED ... 管道处于活动状态,不需要 PREROLL ... 将管道设置为 PLAYING ... 新时钟:GstSystemClock 00000000 (0x756170e8): 01 8c 00 05 01 36 00 03 01 2d 00 04 01 52 00 07 .....6...-...R.. 00000010 (0x756170f8): 00 f4 00 03 01 16 00 0c 00 f7 00 03 00 d0 00 05 ...... ...
    • 如果命令“pacmd list-sources”打印出设备,您能否尝试打印输出,然后使用pulsink而不是alsasink
    • 命令显示“没有 PulseAudio 守护进程运行,或者没有作为会话守护进程运行。”实际上我不想使用 PulseAudio,因为接收设备的 CPU 很差。有没有办法让 rx 用 alsasink 播放 L16 音频?
    猜你喜欢
    • 2019-09-28
    • 1970-01-01
    • 2012-09-15
    • 1970-01-01
    • 2014-10-11
    • 2020-10-23
    • 2012-09-15
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多