2010-12-10 36 views
2

我該如何做原始發送和原始接收?這是行不通的,我不能播放我發送的內容:如何播放基本原始的端口音頻

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

Recv/play: 
[[email protected] ~]# 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 ... 
[[email protected] ~]# 

回答

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-推出的詳細輸出其實,我只是複製能力。

+1

這工作,你是天才專家.....但這不工作可能是什麼問題?發送(作品):gst-launch -v pulsesrc! audioconvert! vorbisenc! oggmux! udpsink host = 127.0.0.1 auto-multicast = true port = 4444 Recv(與hte相同,我聽不到任何東西):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 – YumYumYum 2010-12-10 16:24:38

+1

@Stackfan,你聽不到任何聲音,因爲你發送vorbis-compressed流,但是試圖播放x-raw-int。你需要修復功能並使用'oggdemux! vorbisdec「之後。順便說一句,你可以描述你的任務,並嘗試通過[email protected]聯繫我 – 2010-12-10 16:34:41

+1

發送(作品):gst-launch -v pulsesrc! audioconvert! vorbisenc! oggmux! udpsink主機= 127.0.0.1自動多播=真正的端口= 4444,並閱讀-v – YumYumYum 2010-12-10 16:37:02