如何在基本原始播放端口音频

时间:2010-12-10 15:43:41

标签: c gstreamer

我如何进行原始发送和原始接收?这不起作用,我不能发挥我的意思:

Send: $ gst-launch -v autoaudiosrc ! udpsink host=127.0.0.1 auto-multicast=true port=4444

Recv/play:
[root@example ~]# gst-launch udpsrc multicast-group=127.0.0.1 port=4444 ! autoaudiosink
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
ERROR: from element /GstPipeline:pipeline0/GstAutoAudioSink:autoaudiosink0/GstPulseSink:autoaudiosink0-actual-sink-pulse: The stream is in the wrong format.
Additional debug info:
gstbaseaudiosink.c(866): gst_base_audio_sink_preroll (): /GstPipeline:pipeline0/GstAutoAudioSink:autoaudiosink0/GstPulseSink:autoaudiosink0-actual-sink-pulse:
sink not negotiated.
Execution ended after 16110169 ns.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
[root@example ~]# 

1 个答案:

答案 0 :(得分:2)

您需要指定源的功能。这实际上是ERROR: from element /GstPipeline:pipeline0/GstAudioConvert:audioconvert0: not negotiated的意思。 (在gst-launch上使用-v标志以查看有关错误的更多详细信息。)

所以,解决方案是:

$ gst-launch -v udpsrc multicast-group=127.0.0.1 port=4444 \
    ! audio/x-raw-int, endianness=1234, signed=true, width=16, depth=16, rate=44100, channels=2 \
    ! autoaudiosink

实际上,我只是从发送gst-launch的详细输出中复制了功能。