Jam*_*ner 3 audio-streaming gstreamer
我需要在两台Linux机器之间移动实时音频,这两台机器都运行在Gstreamer之上的定制软件(我的).(该软件已经通过单独的基于TCP的协议在机器之间进行了其他通信 - 我提到这一点,以防有可靠的带外数据对解决方案产生影响).
音频输入将是发送机器上的麦克风/线路输入,并且正常音频输出将作为目的地上的接收器; alsasrc和alsasink是最有可能的,但是对于测试我一直在使用audiotestsrc而不是真正的麦克风.
GStreamer提供多种方式在网络上传输数据 - RTP,RTSP,GDP支付,UDP和TCP服务器,客户端和套接字等.在音频和视频流媒体网络上也有很多例子 - 但在实践中,它们似乎都不适用于我; 目标管道无法协商上限,或者我听到一个数据包,然后管道停止,或者目标管道立即退出,没有可用的数据.
在所有情况下,我都在命令行上测试gst-launch.不需要压缩音频数据 - 原始音频,或简单的WAV,uLaw或aLaw编码都可以; 更重要的是低延迟.
小智 5
为了调试这种问题,我会尝试:
gst-launch audiotestsrc ! alsasink以检查声音是否有效fakesink或filesink查看我们是否获得任何缓冲区GST_DEBUG,例如检查上限GST_DEBUG=GST_CAPS:4或检查使用*:2以获取所有错误/警告这些管道对我有用:
与RTP:
gst-launch-0.10 -v udpsrc port=5000 ! "application/x-rtp,media=(string)audio, clock-rate=(int)44100, width=16, height=16, encoding-name=(string)L16, encoding-params=(string)1, channels=(int)1, channel-positions=(int)1, payload=(int)96" ! rtpL16depay ! audioconvert ! alsasink sync=false
gst-launch-0.10 audiotestsrc ! audioconvert ! audio/x-raw-int,channels=1,depth=16,width=16,rate=44100 ! rtpL16pay ! udpsink host=localhost port=5000
Run Code Online (Sandbox Code Playgroud)
用TCP ::
gst-launch-0.10 tcpserversrc host=localhost port=3000 ! audio/x-raw-int, endianness="(int)1234", signed="(boolean)true", width="(int)16", depth="(int)16", rate="(int)44100", channels="(int)1" ! alsasink
gst-launch-0.10 audiotestsrc ! tcpclientsink host=localhost port=3000
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
26071 次 |
| 最近记录: |