<div dir="ltr"><div>Okay, I've actually found what was wrong with my setup:<br><br></div>h264parse somehow screwed internal video clocking from ip cam. without it mpeg-ts worked like a charm:<br><br>rtspsrc name=source latency=100 ! queue ! rtph264depay ! mpegtsmux name=mux ! multifdsink name=sink<br></div><div class="gmail_extra"><br><div class="gmail_quote">2016-02-26 10:04 GMT+03:00 Sebastian Dröge <span dir="ltr"><<a href="mailto:sebastian@centricular.com" target="_blank">sebastian@centricular.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Fr, 2016-02-26 at 09:37 +0300, Krutskikh Ivan wrote:<br>
> Hi all,<br>
><br>
> I want to serve mpeg-ts streams by http mainly for vlc clients in<br>
> python. I use gstreamer multifdsink for this. The main script for<br>
> serving streams is <br>
<br>
</span>multifdsink is not doing HTTP btw, but that should be unrelated to your<br>
problem here.<br>
<span class=""><br>
><br>
> So wfile should receive mpeg-ts stream. But when I use gstreamer<br>
> pipeline<br>
><br>
> rtspsrc name=source latency=100 ! queue ! rtph264depay ! h264parse !<br>
> mpegtsmux name=mux ! multifdsink name=sink<br>
><br>
> But on the clients I get a lot of errors and no video.<br>
><br>
> [00007f1f34c04468] ts demux error: libdvbpsi (PSI decoder): TS<br>
> discontinuity (received 15, expected 14) for PID 0<br>
<br>
</span>This means that the MPEG-TS that is received by the clients is<br>
corrupted. Can you check that it's all ok if you let multifdsink write<br>
to a file? Can you play back the resulting file?<br>
<span class=""><br>
> I've inspected the mpegtsmux element and found out that alignment<br>
> property can be the source of my issue. So for pipeline <br>
><br>
> rtspsrc name=source latency=100 ! queue ! rtph264depay ! h264parse !<br>
> mpegtsmux name=mux alignment=1024 ! multifdsink name=sink<br>
<br>
</span>The alignment property should be unrelated. It just defines how many<br>
MPEG-TS packets there are going to be per buffer. Apart from better<br>
performance there should be no difference here.<br>
<span class=""><br>
> I can get video for the first client. I considered it a victory...<br>
> Until I've added a second player. Additional players just fail to<br>
> show any video without errors. They are receiving the data aright,<br>
> but fail to output video. With gstreamer client I get an eternal<br>
> PREROLL.<br>
><br>
> It seams to be a time stamp issue and broken data stream due to<br>
> read/write dynamics on pipe. I was very frustrated until I tries<br>
> mpegpsmux. Everything is working for pipeline<br>
<br>
</span>Can you run a GStreamer pipeline and get a debug log with<br>
GST_DEBUG=3,*ts*:6,h264parse:6 ? That should tell us a bit more.<br>
<span class=""><br>
> rtspsrc name=source latency=100 ! queue ! rtph264depay ! h264parse !<br>
> mpegpsmux name=mux ! multifdsink name=sink<br>
><br>
> But the timescale is all wrong and I get long time from initial<br>
> connection to the first frame (waiting for the key frame. multifdsink<br>
> sync-method=1 does not fix the issue). I was wondering if I could<br>
> either fix mpegtsmux or the multifdsink dynamics for my app to work<br>
> correctly.<br>
<br>
</span>mpegpsmux probably does not mark buffers that contain a keyframe as<br>
keyframes, or it does not repeat its headers whenever a video keyframe<br>
is received so that you have to wait until it does that automatically.<br>
<br>
You'll have to check the output that is received and what exactly is<br>
missing there for the receivers.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Sebastian Dröge, Centricular Ltd · <a href="http://www.centricular.com" rel="noreferrer" target="_blank">http://www.centricular.com</a><br>
<br>
</font></span><br>_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
<br></blockquote></div><br></div>