GStreamer 音频操作方法?

GStreamer audio how-to?

几天来我一直在努力弄清楚 "audio only" 的 GStreamer,但是 1.0 和 0.10 之间有不同的指令,而且大多数指令都与视频有关,我遇到了困难了解它们如何组合在一起并通过网络(相同的子网范围)进行对话。大多数示例似乎也想将音频发送到目的地,而不是等待连接到它的东西,我认为这不是我需要的。

基本上,我使用的是与 IP 摄像机通信的 BlueIris 摄像机记录系统。不幸的是,我的相机没有麦克风,所以我想使用带有 USB 麦克风的备用 RaspberryPI 来提供音频,BlueIris 将连接到它以获取音频。显然我可以使用 rtsp 或其他流媒体源指定备用音频源。

摄像头工作得很好,所以 gstreamer 将只是我的音频源。

到目前为止我的进步:

我已经弄清楚如何使用 USB 麦克风向扬声器播放音频:

gst-launch-1.0 alsasrc device=hw:1 ! audioconvert ! autoaudiosink

效果很好。

然后我尝试设置一个 TCP 服务器会话以等待连接到它:

gst-launch-1.0 alsasrc device=hw:1 ! audioconvert ! audioresample ! speexenc ! rtpspeexpay ! tcpserversink
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstAudioSrcClock
Redistribute latency...
Redistribute latency...

(服务器启动似乎没有问题。)

然后让客户端连接:

gst-launch-1.0 tcpclientsrc ! speexdec ! autoaudiosink
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
ERROR: from element /GstPipeline:pipeline0/GstTCPClientSrc:tcpclientsrc0: Internal data flow error.
Additional debug info:
gstbasesrc.c(2948): gst_base_src_loop (): /GstPipeline:pipeline0/GstTCPClientSrc:tcpclientsrc0:
streaming task paused, reason error (-5)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...

...这是一个很大的 NOPE!

所以我希望测试我可以去我的 Windows 机器并启动 VLC 并尝试使用 rtsp://192.168.0.123 之类的东西连接到 Raspberry PI 但是这就是一切变得模糊的地方,尤其是当我什至无法让 gstreamer 在同一个盒子上连接到自身时。

有人可以帮忙吗?

这是为我做的:

gst-launch-1.0 alsasrc device=hw:1,0 ! mulawenc ! rtppcmupay ! udpsink host=224.1.1.1 auto-multicast=true port=5000

现在 VLC 可以工作 rtp://224.1.1.1:5000 并且具有我想要的正确编解码器。

进入下一个问题...