2013-07-26 177 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