2016-07-22 112 views
1

我想獲得一個運行在Ubuntu 14.04上的Gstreamer視頻流,但接收端無法正常顯示視頻。我有一個發送器管道發送MJPEG圖像我這樣開始:Ubuntu 14.04 Gstreamer autovideosink

gst-launch-1.0 -v videotestsrc ! jpegenc ! rtpjpegpay ! udpsink host=127.0.0.1 port=5200 

的輸出是:

Setting pipeline to PAUSED ... 
Pipeline is PREROLLING ... 
/GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0.GstPad:src: caps = video/x-raw, width=(int)320, height=(int)240, framerate=(fraction)30/1, format=(string)I420, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive 
/GstPipeline:pipeline0/GstJpegEnc:jpegenc0.GstPad:sink: caps = video/x-raw, width=(int)320, height=(int)240, framerate=(fraction)30/1, format=(string)I420, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive 
/GstPipeline:pipeline0/GstJpegEnc:jpegenc0.GstPad:src: caps = image/jpeg, sof-marker=(int)0, width=(int)320, height=(int)240, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1 
/GstPipeline:pipeline0/GstRtpJPEGPay:rtpjpegpay0.GstPad:src: caps = application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)JPEG, a-framerate=(string)30.000000, a-framesize=(string)320-240, payload=(int)96, ssrc=(uint)1970481773, timestamp-offset=(uint)1012832172, seqnum-offset=(uint)21614 
/GstPipeline:pipeline0/GstUDPSink:udpsink0.GstPad:sink: caps = application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)JPEG, a-framerate=(string)30.000000, a-framesize=(string)320-240, payload=(int)96, ssrc=(uint)1970481773, timestamp-offset=(uint)1012832172, seqnum-offset=(uint)21614 
/GstPipeline:pipeline0/GstRtpJPEGPay:rtpjpegpay0.GstPad:sink: caps = image/jpeg, sof-marker=(int)0, width=(int)320, height=(int)240, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1 
/GstPipeline:pipeline0/GstRtpJPEGPay:rtpjpegpay0: timestamp = 1012832172 
/GstPipeline:pipeline0/GstRtpJPEGPay:rtpjpegpay0: seqnum = 21614 
Pipeline is PREROLLED ... 
Setting pipeline to PLAYING ... 
New clock: GstSystemClock 

接收管道是:

gst-launch-1.0 udpsrc port=5200 caps="application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)JPEG, a-framerate=(string)30.000000, a-framesize=(string)320-240, payload=(int)96" ! rtpjpegdepay ! jpegdec ! xvimagesink 

通知我抄帽來自發件人信息。

但是,我不斷收到「無法發送粘滯事件」錯誤,並且接收器立即終止。我可能做錯了什麼?我的輸出如下:

Setting pipeline to PAUSED ... 
Pipeline is live and does not need PREROLL ... 
Setting pipeline to PLAYING ... 
New clock: GstSystemClock 
0:00:00.016961467 12229  0x266a400 WARN    GST_PADS gstpad.c:3669:gst_pad_peer_query:<jpegdec0:src> could not send sticky events 
0:00:00.017297845 12229  0x266a400 WARN     basesrc gstbasesrc.c:2865:gst_base_src_loop:<udpsrc0> error: Internal data flow error. 
0:00:00.017306308 12229  0x266a400 WARN     basesrc gstbasesrc.c:2865:gst_base_src_loop:<udpsrc0> error: streaming task paused, reason not-negotiated (-4) 
ERROR: from element /GstPipeline:pipeline0/GstUDPSrc:udpsrc0: Internal data flow error. 
Additional debug info: 
gstbasesrc.c(2865): gst_base_src_loop(): /GstPipeline:pipeline0/GstUDPSrc:udpsrc0: 
streaming task paused, reason not-negotiated (-4) 
Execution ended after 0:00:00.000651039 
Setting pipeline to PAUSED ... 
Setting pipeline to READY ... 
Setting pipeline to NULL ... 
Freeing pipeline ... 

我已經嘗試autovideosink,ximagesink,具有相同的結果。

謝謝。

+0

幾乎所有的時間我都得到粘性事件..忽略它..真正的問題是 - 沒有談判......它意味着元素不完全連接在一起,因爲他們不相互理解,我會檢查我的機器 – nayana

回答

0

歐凱你只需要添加videoconvert - 在JPEGDEC生成視頻當中xvimagesink不明白:

gst-launch-1.0 udpsrc port=5200 ! application/x-rtp\,\ media\=\(string\)video\,\ clock-rate\=\(int\)90000\,\ encoding-name\=\(string\)JPEG\,\ a-framerate\=\(string\)\"30\\\,000000\"\,\ payload\=\(int\)26\,\ ssrc\=\(uint\)2512101225\,\ timestamp-offset\=\(uint\)1627080146\,\ seqnum-offset\=\(uint\)4727 ! rtpjpegdepay ! jpegdec ! videoconvert ! xvimagesink 

如何我想通了這一點?通過使用fakesink這樣:

udpsrc ! fakesink -v 

工作,然後

udpsrc ! rptjpegdepay ! fakesink 

再工作..所以我繼續這樣,找出這個問題是真的xvimagesink。它的怪異,我們不得到更明確的錯誤信息..

您也可以與調試應用程序:

GST_DEBUG=4 gst-launch-1.0 udpsrc ..... 

您可以滾動到未經過協商的部分,然後環視四周。

+0

那工作,謝謝! –

+0

@wireless_freedom很高興聽到這個:)如果它解決了你的問題,你可以通過在投票號碼下使用tick來接受這個答案 – nayana