当前位置: 首页 > 知识库问答 >
问题:

使用Gstreamer接收音频流导致原因未协商错误

解修然
2023-03-14

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

tx:gst-launch-1.0-v alsasrc device=“硬件:0”!decodebin!音频转换!RTPL16支付!队列udpsink主机=239.0.0.1自动多播=真实端口=5004

rx: gst-Launst-1.0 udpsrc multicast-group=239.0.0.1port=5004 caps="Application/x-rtp"! rtpL16Depay! alsasink

接收结果:正在将管道设置为暂停。。。管道处于活动状态,不需要预滚。。。正在将管道设置为播放。。。新时钟:GstSystemClock错误:来自元素/GstPipeline:pipeline0/GstUDPSrc:udpsrc0:内部数据流错误。其他调试信息:../..//gstreamer-1.8.1/libs/gst/base/gstbasesrc。c(2948):gst\u base\u src\u loop():/GstPipeline:pipeline0/GstUDPSrc:udpsrc0:流式处理任务已暂停,原因未协商(-4)执行在0:00:00.009364000将管道设置为暂停后结束。。。正在将管道设置为就绪。。。正在将管道设置为NULL。。。正在释放管道。。。

TX结果如下。

正在将管道设置为暂停。。。管道处于活动状态,不需要预滚。。。正在将管道设置为播放。。。新时钟:gstaudiosrccock/GstPipeline:pipeline0/GstAlsaSrc:alsasrc0:实际缓冲时间=200000/GstPipeline:pipeline0/GstAlsaSrc:alsasrc0:实际延迟时间=10000/GstPipeline:pipeline0/GstAlsaSrc:alsasrc0。GstPad:src:caps=“音频/x-raw”,\格式\=(字符串)S16LE \、\布局\=(字符串)交错\、\速率\=(int)44100 \、\通道\=(int)2 \、\通道掩码\=(位掩码)0x0000000000000003”/GstPipeline:pipeline0/GstDecodeBin:decodebin0。GstGhostPad:接收器。gstproxyPad0:proxypad0:caps=“音频/x-raw”,\format\=(字符串)S16LE\,\layout\=(字符串)交错\,\rate\=(int)44100\,\channels\=(int)2\,\channel mask\=(位掩码)0x0000000000000003”/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstTypeFindElement:typefind。GstPad:src:caps=“音频/x-raw”,\格式\=(字符串)S16LE \、\布局\=(字符串)交错\、\速率\=(int)44100 \、\通道\=(int)2 \、\通道掩码\=(位掩码)0x0000000000000003”重新分配延迟/GST管道:管道0/GST音频转换器:音频转换器0。GstPad:src:caps=“音频/x-raw”,\layout\=(字符串)交错\、\rate\=(int)44100 \、\format\=(字符串)S16BE \、\channels\=(int)2 \、\channel mask\=(位掩码)0x0000000000000003“/GstPipeline:pipeline0/GstRtpL16Pay:rtpl16pay0。GstPad:src:caps=“应用程序/x-rtp\,\media\=(字符串)音频\,\clock rate\=(int)44100\,\encoding name\=(字符串)L16\,\encoding params\=(字符串)2\,\channels\=(int)2\,\payload\=(int)96\,\ssrc\=(uint)3961155089\,\timestamp offset\(uint)725507323\,\seqnum offset\(uint)20783“/GstPipeline:pipeline0/GstQueue:0。GstPad:src:caps=“应用程序/x-rtp\,\media\=(字符串)音频\,\clock rate\=(int)44100\,\encoding name\=(字符串)L16\,\encoding params\=(字符串)2\,\channels\=(int)2\,\payload\=(int)96\,\ssrc\=(uint)3961155089\,\timestamp offset\(uint)725507323\,\seqnum offset\(uint)20783“/GstPipeline:pipeline0/GstUDPSink:udpsink0。GstPad:接收器:caps=“应用程序/x-rtp”,\媒体\=(字符串)音频\、\时钟速率\=(int)44100 \、\编码名称\=(字符串)L16 \、\编码参数\=(字符串)2 \、\通道\=(int)2 \、\有效负载\=(int)96 \、\ ssrc \=(uint)3961155089 \、\时间戳偏移\=(uint)725507323 \、\ seqnum偏移\=(uint)20783”/GstPipeline:pipeline0/GstQueue:0。GstPad:接收器:caps=“应用程序/x-rtp”,\媒体\=(字符串)音频\、\时钟速率\=(int)44100 \、\编码名称\=(字符串)L16 \、\编码参数\=(字符串)2 \、\通道\=(int)2 \、\有效负载\=(int)96 \、\ ssrc \=(uint)3961155089 \、\时间戳偏移\=(uint)725507323 \、\ seqnum偏移\=(uint)20783”/GstPipeline:pipeline0/GstRtpL16Pay:rtpl16pay0。GstPad:sink:caps=“音频/x-raw”,\layout \=(字符串)交错\、\rate \=(int)44100 \、\format \=(字符串)S16BE \、\channels \=(int)2 \、\channel mask \=(位掩码)0x0000000000000003”/GstPipeline:pipeline0/GstAudioConvert:audioconvert0。GstPad:sink:caps=“音频/x-raw”,\format\=(字符串)S16LE\,\layout\=(字符串)interleaved\,\rate\=(int)44100\,\channels\=(int)2\,\channel mask\=(位掩码)0x0000000000000003“/GstPipeline:pipeline0/GstDecodeBin:decodebin0。GstDecodePad:src\u 0。GstProxyPad:proxypad1:caps=“音频/x-raw”,\format\=(字符串)S16LE\,\layout\=(字符串)交错\,\rate\=(int)44100\,\channels\=(int)2\,\channel mask\=(位掩码)0x0000000000000003”/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstTypeFindElement:typefind。GstPad:sink:caps=“音频/x-raw”,\format\=(字符串)S16LE\,\layout\=(字符串)interleaved\,\rate\=(int)44100\,\channels\=(int)2\,\channel mask\=(位掩码)0x0000000000000003“/GstPipeline:pipeline0/GstDecodeBin:decodebin0。GstGhostPad:sink:caps=“音频/x-raw”,\format\=(字符串)S16LE\,\layout\=(字符串)interleaved\,\rate\=(int)44100\,\channels\=(int)2\,\channel mask\=(位掩码)0x0000000000000003”/GstPipeline:pipeline0/GstRtpL16Pay:rtpl16pay0:时间戳=725507323/GstPipeline:pipeline0/GstRtpL16Pay:rtpl16pay0:seqnum=20783

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

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

tx: gst-Launit-1.0-v alsasrc设备="hw: 0"!解码器!audio转换!audireample!alawenc!rtppcmapay!队列!udpink主机=239.0.0.1自动多播=真实端口=5004

rx: gst-Launst-1.0 udpsrc multicast-group=239.0.0.1port=5004 caps="应用程序/x-rtp, media=(string)音频,时钟速率=(int)8000,编码名称=(string)PCMA,编码参数=(string)2,通道=(int)1,有效负载=(int)8"!rtppcmadepay!alawdec!alsasink

共有1个答案

隆睿
2023-03-14

您需要在receive中添加caps,请尝试以下管道:

gst-launch-1.0 udpsrc多播组=239.0.0.1端口=5004 caps=(应用程序/x-rtp,媒体=(字符串)音频,时钟速率=(int)44100,编码名称=(字符串)L16,编码参数=(字符串)2,通道=(int)2,有效负载=(int)96’!rtpL16depay!音频转换!阿尔萨斯银行

 类似资料:
  • 摄像机工作很好,所以gstreamer将只是我的音频来源。 所以我到目前为止的进展: 我已经想好了如何使用以下方法将音频从USB麦克风播放到扬声器: 所以我希望通过测试,我可以到我的Windows机器上启动VLC,并尝试用类似于rtsp://192.168.0.123的东西连接到Raspberry PI,但这是所有事情都变得模糊的地方,特别是当我甚至不能让gstreamer连接到同一个盒子上自己的

  • 问题内容: 我找到了客户端/服务器代码,但出现此错误: java.net.SocketException:软件导致连接中止:recv失败 服务器代码: 客户代码: 服务器代码提供以下输出: 客户端代码给出以下输出: 问题答案: 服务器不等待来自客户端的任何数据,并且当服务器退出时,连接将关闭。 将这样的代码添加到服务器代码中:

  • 问题内容: 简介:我有一个Servlet,它接收一个我无法读取的请求(getContentType()= audio / x-wav)。我需要阅读此wave并将其保存在服务器端。 详细的故事:我对Flex,javascript,PHP和Python一无所知,我想记录(从客户端“浏览器”中获取)wave文件并将其发送到服务器以进行保存(以进行进一步的ASR处理)。 经过一番搜索后,我发现了一个我已经

  • 问题内容: 我写了一个控制台应用程序就跑,然后。这很好。 然后,我创建了一个包,并将helloworld.java移入其中(包导入语句正确生成为)。然后我运行了它,效果也很好,并正确生成了类。 但是,当我从控制台运行时,它引发了“找不到类”错误。 请谁能告诉我这是什么问题? 问题答案: 尝试跑步 其中ABSOLUTE_PATH指向类文件以及程序包所在的目录。说它是生成类文件的目录,以及与源文件相同

  • 我使用以下代码使用gstream er进行直播,但我不知道如何在接收器端保存视频/图像。有人请帮帮我。提前谢谢。 发送方代码:“raspivid-t 999999-h 720-w 1080-fps 25-b 2000000-o-| gst-launch-0.10-v fdsrc fd=0!H264解析!RTPH264支付!udpsink主机=192.168.2.1端口=5000” 接收器代码:“u

  • 我试图为管道开发一个应用程序: gst-launch-1.0 rtspsrc位置=”rtsp://192.168.3.30:8554/rajvi“延迟=0 name=demux demux。!queue!rtpmp4gdepay!aacparse!avdec\u aac!audioconvert!audioresample!autoaudiosink demux。!queue!rtph264dep