Android is strutting for Real Time Stream

Nicolas Dufresne nicolas at ndufresne.ca
Thu Sep 28 17:39:42 UTC 2017


Le mercredi 20 septembre 2017 à 14:13 -0300, Azure1 Sureale a écrit :
> Hello, I'm trying to have an Android Player receiving a RTSP stream
> from the internet and play it with very low latency. 
> I'm using Tutorial 5 from the GStreamer home. Without any change my
> stream has a latency about 2 seconds (worst than Vitamio that I was
> using previously).

This is the default configuration on rtpsrc. Connect to "source-setup"
signal on playbin, and then setup a lower latency. Here's a code
snipet:

static void
source_setup_cb (GstElement *playbin, GstElement *source, gpointer
user_data)
{
  if (g_str_equal ("GstRTSPSrc", g_type_name (source)))
    g_object_set (source, "latency", 50, NULL); /* in ms */
}

{
  ...
  g_signal_connect (pipeline, "source-setup", G_CALLBACK (source_setup_cb), NULL, NULL);
  ...
}



> With futher investigation we realized we could change the latency to
> 0 in the pipeline using this code:
> 
> ****************************************************************
> data->pipeline = gst_parse_launch("playbin", &error);
>     gst_pipeline_set_latency(data->pipeline,0); //This is what I
> wrote

That's won't work, since you'll have to display the frame before you
even have started decoding them, it make no sense. It's better to
configure the element, and let the normal latency workflow run.

> 
>     if (error) {
>     gchar *message = g_strdup_printf("Unable to build pipeline: %s",
> error->message);
>     g_clear_error (&error);
>     set_ui_message(message, data);
>     g_free (message);
>     return NULL;
>   }
> 
> ****************************************************************
> 
> Now the stream is strutting, alas dropping frames. However the stream
> is faster than the base code.
> Based on other questions, I tried to add rtpjitterbuffer into the
> pipeline but seems that is not that simple.
> 
> How can I construct or change the pipeline to have low latency and no
> strutting?

The configuration depends on your network, GStreamer don't implement
dynamic latency, though you may implement it yourself by warning QoS
event about dropped frame (to detect too low latency) and do some
adjustment.

> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20170928/a1d19dc9/attachment.sig>


More information about the gstreamer-devel mailing list