2013-07-26 191 views
2

我想通過RTP使用gstreamer傳輸mpeg2-ts視頻。我使用下面的管道服務器:使用gstreamer通過RTP流式傳輸mpeg2-ts視頻

gst-launch-0.10 -v filesrc location=/home/…/miracast_sample.mpeg ! rtpmp2tpay ! udpsink host=localhost port=5000 sync=false 

,我現在面臨的問題是,我得到直接EOS事件類似如下:

Setting pipeline to PAUSED ... 
Pipeline is PREROLLING ... 
/GstPipeline:pipeline0/GstRTPMP2TPay:rtpmp2tpay0: timestamp = 3878456990 
/GstPipeline:pipeline0/GstRTPMP2TPay:rtpmp2tpay0: seqnum = 50764 
Pipeline is PREROLLED ... 
Setting pipeline to PLAYING ... 
New clock: GstSystemClock 
Got EOS from element "pipeline0". 
Execution ended after 126835285 ns. 
Setting pipeline to PAUSED ... 
Setting pipeline to READY ... 
Setting pipeline to NULL ... 
Freeing pipeline ... 

我能理解,這是很運行快,但如何解決它?

+0

你有沒有得到任何地方? – Russell

回答

0

您已將sync = FALSE設置爲「不同步時間戳,但儘可能快地處理緩衝區」。試着將其更改爲TRUE,如下所示:

gst-launch-0.10 -v filesrc location=/home/…/miracast_sample.mpeg ! rtpmp2tpay ! udpsink host=localhost port=5000 sync=1 
+0

同步行爲與同步= 1,甚至沒有同步 – abir

-1

您是否嘗試過解複用器,然後混流它...

如:

服務器:

gst-launch-0.10 -v filesrc location=file_to_stream.ts ! tsdemux program-number=811 ! mpegtsmux ! rtpmp2tpay ! udpsink host=localhost port=5000 sync=1 

客戶:

gst-launch-0.10 udpsrc port=5000 caps="application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)MP2T-ES" ! gstrtpbin ! rtpmp2tdepay ! tsdemux ! mpeg2dec ! ffmpegcolorspace ! autovideosink 
0

我有同樣的問題,因爲你和我的同事建議我在filesrc和rtpmp2tpay之間插入一個tsparse set-timestamps=true。它爲我工作,所以嘗試改變你的管道

gst-launch-0.10 -v filesrc location=/home/…/miracast_sample.mpeg ! \ 
    tsparse set-timestamps=true ! rtpmp2tpay ! udpsink host=localhost port=5000 sync=false 
相關問題