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

问题描述 投票:2回答:3

我正在尝试使用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 ...

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

gstreamer rtp mpeg2-ts
3个回答
0
投票

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

gst-launch-0.10 -v filesrc location=/home/…/miracast_sample.mpeg ! rtpmp2tpay ! udpsink host=localhost port=5000 sync=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

-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
© www.soinside.com 2019 - 2024. All rights reserved.