Doing x264enc tune=zerolatency made the video quite pixelated but really didn&#39;t affect the latency.<div><br></div><div>A brief explanation of what I am doing:</div><div><br></div><div>I am using AppSrc from gstreamer-java to grab rgb buffers from a large java app and putting them out as x264enc / rtph264pay / udpsink. That is the stream I am picking up with the test-launch pipeline I am working on. I can attach a gst-launch pipeline to the AppSrc output and display with very low latency so the delay is in the test-launch pipeline. I just reduced the size of the captured buffers in the AppSrc interface from 640x480 to 320x240 with improved latency so it appears that the amount of data in the pipeline is important. I have checked cpu usage everwhere with nothing showing over about 3 -5 % usage. All the involved computers are connected by gigabit connections.</div>
<div><br></div><div>Morris<br><br><div class="gmail_quote">On Tue, Mar 1, 2011 at 9:00 AM, Tim-Philipp Müller <span dir="ltr">&lt;<a href="mailto:t.i.m@zen.co.uk">t.i.m@zen.co.uk</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
On Tue, 2011-03-01 at 08:43 -0500, Morris Ford wrote:<br>
&gt; This morning I cranked up my test and I was seeing about 10 second<br>
&gt; latency. After rebooting all the systems involved I am still seeing<br>
&gt; about 7 - 8 second latency. This is really strange.<br>
&gt;<br>
&gt; Any insight?<br>
<br>
Try: x264enc tune=zerolatency<br>
<br>
Cheers<br>
 -Tim<br>
&gt;<br>
&gt; Morris<br>
&gt;<br>
&gt; On Tue, Mar 1, 2011 at 8:24 AM, Morris Ford &lt;<a href="mailto:morrishford@gmail.com">morrishford@gmail.com</a>&gt;<br>
&gt; wrote:<br>
&gt;         I get:<br>
&gt;         (lt-test-launch:21084): GStreamer-CRITICAL **:<br>
&gt;         gst_poll_set_flushing: assertion `set != NULL&#39; failed<br>
&gt;<br>
&gt;<br>
&gt;         Morris<br>
&gt;<br>
&gt;<br>
&gt;         On Tue, Mar 1, 2011 at 3:11 AM, Marco Ballesio<br>
&gt;         &lt;<a href="mailto:gibrovacco@gmail.com">gibrovacco@gmail.com</a>&gt; wrote:<br>
&gt;                 Hi,<br>
&gt;<br>
&gt;                 On Mon, Feb 28, 2011 at 6:14 PM, Morris Ford<br>
&gt;                 &lt;<a href="mailto:morrishford@gmail.com">morrishford@gmail.com</a>&gt; wrote:<br>
&gt;                 &gt; Thanks a lot for your help. That was the key to<br>
&gt;                 getting it to run. I now<br>
&gt;                 &gt; have a working rtsp-server pipe thus:<br>
&gt;                 &gt; ./test-launch &quot;( udpsrc port=5000 caps=<br>
&gt;                 \&quot;application/x-rtp,<br>
&gt;                 &gt; media=\(string\)video, clock-rate=\(int\)90000,<br>
&gt;                 &gt; encoding-name=\(string\)H264,  payload=\(int\)96,<br>
&gt;                 ssrc=\(guint\)2396357661,<br>
&gt;                 &gt; clock-base=\(guint\)2297066863, seqnum-base=\(guint<br>
&gt;                 \)49439\&quot; ! rtph264depay<br>
&gt;                 &gt; ! ffdec_h264 ! ffmpegcolorspace ! videoscale !<br>
&gt;                 x264enc ! rtph264pay<br>
&gt;                 &gt; name=pay0 pt=96 sync=false )&quot;<br>
&gt;                 &gt; Problem now is that there is a 3 - 4 second latency<br>
&gt;                 when playing using that<br>
&gt;                 &gt; pipeline and playing the resulting video through vlc<br>
&gt;                 or quicktime.<br>
&gt;                 &gt; My question: How do I find what is causing the delay<br>
&gt;                 and what can I do to<br>
&gt;                 &gt; reduce the delay?<br>
&gt;<br>
&gt;<br>
&gt;                 what if you don&#39;t explicitly set clock-base and<br>
&gt;                 seqnum-base?<br>
&gt;<br>
&gt;                 Regards<br>
&gt;<br>
&gt;<br>
&gt;                 &gt; Thanks<br>
&gt;                 &gt; Morris<br>
&gt;                 &gt;<br>
&gt;                 &gt; On Mon, Feb 28, 2011 at 2:33 AM, Marco Ballesio<br>
&gt;                 &lt;<a href="mailto:gibrovacco@gmail.com">gibrovacco@gmail.com</a>&gt;<br>
&gt;                 &gt; wrote:<br>
&gt;                 &gt;&gt;<br>
&gt;                 &gt;&gt; Hi,<br>
&gt;                 &gt;&gt;<br>
&gt;                 &gt;&gt; On Mon, Feb 28, 2011 at 3:05 AM, Morris Ford<br>
&gt;                 &lt;<a href="mailto:morrishford@gmail.com">morrishford@gmail.com</a>&gt;<br>
&gt;                 &gt;&gt; wrote:<br>
&gt;                 &gt;&gt; &gt; I am working on receiving an udpsrc stream and<br>
&gt;                 publishing it as an rtsp<br>
&gt;                 &gt;&gt; &gt; stream. This gst-launch string works just fine to<br>
&gt;                 receive the stream:<br>
&gt;                 &gt;&gt; &gt; gst-launch-0.10 -v udpsrc port=5000<br>
&gt;                 caps=&quot;application/x-rtp,<br>
&gt;                 &gt;&gt; &gt; media=\(string\)video, clock-rate=\(int\)90000,<br>
&gt;                 &gt;&gt; &gt; encoding-name=\(string\)H264,  payload=\(int\)96,<br>
&gt;                 &gt;&gt; &gt; ssrc=\(guint\)2396357661,<br>
&gt;                 &gt;&gt; &gt; clock-base=\(guint\)2297066863, seqnum-base=<br>
&gt;                 \(guint\)49439&quot; !<br>
&gt;                 &gt;&gt; &gt; rtph264depay !<br>
&gt;                 &gt;&gt; &gt; decodebin ! ffmpegcolorspace ! videoscale !<br>
&gt;                 xvimagesink sync=false<br>
&gt;                 &gt;&gt; &gt; but when I try to take that pipeline and put it<br>
&gt;                 into a test-launch, I<br>
&gt;                 &gt;&gt; &gt; get<br>
&gt;                 &gt;&gt; &gt; complaints about not being able to set the caps<br>
&gt;                 on udpsrc to<br>
&gt;                 &gt;&gt; &gt; application/x-rtp.<br>
&gt;                 &gt;&gt; &gt; Like this:<br>
&gt;                 &gt;&gt; &gt; ./test-launch &quot;( udpsrc port=5000<br>
&gt;                 caps=&quot;application/x-rtp,<br>
&gt;                 &gt;&gt; &gt; media=\(string\)video, clock-rate=\(int\)90000,<br>
&gt;                 &gt;&gt;<br>
&gt;                 &gt;&gt; It&#39;s just about bash syntax. The way you&#39;re using<br>
&gt;                 the &quot; make bash<br>
&gt;                 &gt;&gt; thinking you&#39;re passing test-launch a first<br>
&gt;                 argument like this:<br>
&gt;                 &gt;&gt;<br>
&gt;                 &gt;&gt; ( udpsrc port=5000 caps=<br>
&gt;                 &gt;&gt;<br>
&gt;                 &gt;&gt; concatenated to:<br>
&gt;                 &gt;&gt;<br>
&gt;                 &gt;&gt; application/x-rtp,<br>
&gt;                 &gt;&gt;<br>
&gt;                 &gt;&gt; and a second argument like:<br>
&gt;                 &gt;&gt;<br>
&gt;                 &gt;&gt; media=\(string\)video,<br>
&gt;                 &gt;&gt;<br>
&gt;                 &gt;&gt; useless to say this is not what you should pass to<br>
&gt;                 the test-launch<br>
&gt;                 &gt;&gt; command. I suggest you to try replacing the outmost<br>
&gt;                 pair of &quot; with &#39;<br>
&gt;                 &gt;&gt; or the innermost ones with \&quot;<br>
&gt;                 &gt;&gt;<br>
&gt;                 &gt;&gt; Regards<br>
&gt;                 &gt;&gt;<br>
&gt;                 &gt;&gt; &gt; encoding-name=\(string\)H264,  payload=\(int\)96,<br>
&gt;                 &gt;&gt; &gt; ssrc=\(guint\)2396357661,<br>
&gt;                 &gt;&gt; &gt; clock-base=\(guint\)2297066863, seqnum-base=<br>
&gt;                 \(guint\)49439&quot; !<br>
&gt;                 &gt;&gt; &gt; rtph264depay !<br>
&gt;                 &gt;&gt; &gt; decodebin ! ffmpegcolorspace ! videoscale !<br>
&gt;                 x264enc ! rtph264pay<br>
&gt;                 &gt;&gt; &gt; name-pay0<br>
&gt;                 &gt;&gt; &gt; pt=96 )&quot;<br>
&gt;                 &gt;&gt; &gt; ** (lt-test-launch:20772): CRITICAL **: could not<br>
&gt;                 parse launch syntax ((<br>
&gt;                 &gt;&gt; &gt; udpsrc port=5000 caps=application/x-rtp,): could<br>
&gt;                 not set property &quot;caps&quot;<br>
&gt;                 &gt;&gt; &gt; in<br>
&gt;                 &gt;&gt; &gt; element &quot;udpsrc0&quot; to &quot;application/x-rtp,&quot;<br>
&gt;                 &gt;&gt; &gt; ** (lt-test-launch:20772): CRITICAL **: could not<br>
&gt;                 create element<br>
&gt;                 &gt;&gt; &gt; I could not find any examples of udpsrc in a<br>
&gt;                 test-launch line or udpsrc<br>
&gt;                 &gt;&gt; &gt; in a<br>
&gt;                 &gt;&gt; &gt; gst-rtsp-server &#39;c&#39; program so I am not at all<br>
&gt;                 sure if what I am trying<br>
&gt;                 &gt;&gt; &gt; to<br>
&gt;                 &gt;&gt; &gt; do is valid.<br>
&gt;                 &gt;&gt; &gt; Morris<br>
&gt;                 &gt;&gt; &gt; _______________________________________________<br>
&gt;                 &gt;&gt; &gt; gstreamer-devel mailing list<br>
&gt;                 &gt;&gt; &gt; <a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>
&gt;                 &gt;&gt; &gt;<br>
&gt;                 <a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
&gt;                 &gt;&gt; &gt;<br>
&gt;                 &gt;&gt; &gt;<br>
&gt;                 &gt;&gt; _______________________________________________<br>
&gt;                 &gt;&gt; gstreamer-devel mailing list<br>
&gt;                 &gt;&gt; <a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>
&gt;                 &gt;&gt;<br>
&gt;                 <a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
&gt;                 &gt;<br>
&gt;                 &gt;<br>
&gt;                 &gt; _______________________________________________<br>
&gt;                 &gt; gstreamer-devel mailing list<br>
&gt;                 &gt; <a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>
&gt;                 &gt;<br>
&gt;                 <a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
&gt;                 &gt;<br>
&gt;                 &gt;<br>
&gt;                 _______________________________________________<br>
&gt;                 gstreamer-devel mailing list<br>
&gt;                 <a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>
&gt;                 <a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; gstreamer-devel mailing list<br>
&gt; <a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>
&gt; <a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
<br>
<br>
_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
</blockquote></div><br></div>