4

I am trying to stream an mpeg2-ts video over RTP using gstreamer. I am using the following pipeline for the server:

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

The problem that I am facing is that I get directly an EOS event like described below:

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 ...

I can understand that it is running very fast but how to fix it?

abir
  • 285
  • 2
  • 4
  • 6

3 Answers3

0

You have set sync=FALSE, and that translates to "do not sync on timestamps, but process the buffer as fast as possible." Try and change it to TRUE, like so:

gst-launch-0.10 -v filesrc location=/home/…/miracast_sample.mpeg ! rtpmp2tpay ! udpsink host=localhost port=5000 sync=1
Havard Graff
  • 2,805
  • 1
  • 15
  • 16
0

I had the same problem as you and my coworker suggested I insert a tsparse set-timestamps=true between the filesrc and rtpmp2tpay. It worked for me, so try changing your pipeline to

gst-launch-0.10 -v filesrc location=/home/…/miracast_sample.mpeg ! \
  tsparse set-timestamps=true ! rtpmp2tpay ! udpsink host=localhost port=5000 sync=false
Mutant Bob
  • 3,121
  • 2
  • 27
  • 52
-1

Have you tried to demux it and then mux it ...

such as:

server:

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

client:

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