<div dir="ltr">Thank you Nicolas. Tim has given a similar solution last week.<div><br></div><div>We are now facing a new problem. We moved from ffserver to gst-rtps-server. I explained the issue in a previous email.</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 28, 2017 at 2:39 PM, Nicolas Dufresne <span dir="ltr"><<a href="mailto:nicolas@ndufresne.ca" target="_blank">nicolas@ndufresne.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>Le mercredi 20 septembre 2017 à 14:13 -0300, Azure1 Sureale a écrit :<br>
> Hello, I'm trying to have an Android Player receiving a RTSP stream<br>
> from the internet and play it with very low latency.<br>
> I'm using Tutorial 5 from the GStreamer home. Without any change my<br>
> stream has a latency about 2 seconds (worst than Vitamio that I was<br>
> using previously).<br>
<br>
</span>This is the default configuration on rtpsrc. Connect to "source-setup"<br>
signal on playbin, and then setup a lower latency. Here's a code<br>
snipet:<br>
<br>
static void<br>
source_setup_cb (GstElement *playbin, GstElement *source, gpointer<br>
user_data)<br>
{<br>
  if (g_str_equal ("GstRTSPSrc", g_type_name (source)))<br>
    g_object_set (source, "latency", 50, NULL); /* in ms */<br>
}<br>
<br>
{<br>
  ...<br>
  g_signal_connect (pipeline, "source-setup", G_CALLBACK (source_setup_cb), NULL, NULL);<br>
  ...<br>
<span>}<br>
<br>
<br>
<br>
> With futher investigation we realized we could change the latency to<br>
> 0 in the pipeline using this code:<br>
><br>
> ******************************<wbr>******************************<wbr>****<br>
> data->pipeline = gst_parse_launch("playbin", &error);<br>
>     gst_pipeline_set_latency(<wbr>data->pipeline,0); //This is what I<br>
> wrote<br>
<br>
</span>That's won't work, since you'll have to display the frame before you<br>
even have started decoding them, it make no sense. It's better to<br>
configure the element, and let the normal latency workflow run.<br>
<span><br>
><br>
>     if (error) {<br>
>     gchar *message = g_strdup_printf("Unable to build pipeline: %s",<br>
> error->message);<br>
>     g_clear_error (&error);<br>
>     set_ui_message(message, data);<br>
>     g_free (message);<br>
>     return NULL;<br>
>   }<br>
><br>
> ******************************<wbr>******************************<wbr>****<br>
><br>
> Now the stream is strutting, alas dropping frames. However the stream<br>
> is faster than the base code.<br>
> Based on other questions, I tried to add rtpjitterbuffer into the<br>
> pipeline but seems that is not that simple.<br>
><br>
> How can I construct or change the pipeline to have low latency and no<br>
> strutting?<br>
<br>
</span>The configuration depends on your network, GStreamer don't implement<br>
dynamic latency, though you may implement it yourself by warning QoS<br>
event about dropped frame (to detect too low latency) and do some<br>
adjustment.<br>
<div class="m_360833109915751334HOEnZb"><div class="m_360833109915751334h5"><br>
> ______________________________<wbr>_________________<br>
> gstreamer-devel mailing list<br>
> <a href="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank">gstreamer-devel@lists.freedesk<wbr>top.org</a><br>
> <a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/gstreamer-dev<wbr>el</a></div></div><br>______________________________<wbr>_________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank">gstreamer-devel@lists.freedesk<wbr>top.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/gstreamer-dev<wbr>el</a><br>
<br></blockquote></div><br></div></div>