【发布时间】: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