使用gstreamer在RTP上流式传输mpeg2-ts视频

时间:2013-07-26 10:39:24

标签: gstreamer rtp 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 ...

我可以理解它运行得非常快但是如何修复它?

3 个答案:

答案 0 :(得分:0)

您已设置sync = FALSE,并且转换为“不在时间戳上同步,但尽可能快地处理缓冲区”。尝试将其更改为TRUE,如下所示:

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

答案 1 :(得分: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

答案 2 :(得分:-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