gstplayer how to let all of the plugins are not cached and processing data as soon as possible?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

gstplayer how to let all of the plugins are not cached and processing data as soon as possible?

rland
This post was updated on .
I use gstplayer(gst sdk 1.8.2) to play a video only with RTMP, because there is only a video track, so I set the sync=false , but the delay is still more than 13S.
I guess it is because some of the queue or multiqueue  inside has  cache, so I would like to ask for advice, how to use code elegant way of processing data as soon as possible and without caching data in anywhere ?

In addition, if  use the following pipeline,it can  reduce the latency to 1s,
----
gst-launch-1.0 rtmpsrc location=rtmp://10.9.44.131:1935/mytv/300 ! flvdemux name=d d. ! queue ! decodebin ! glimagesink sync=false

----


Reply | Threaded
Open this post in threaded view
|

Re: gstplayer how to let all of the plugins are not cached and processing data as soon as possible?

Sebastian Dröge-3
On Do, 2016-09-22 at 19:45 -0700, lucky chou wrote:
> I use gstplayer(gst sdk 1.8.2) to play a video only with RTMP, because there
> is only a video track, so I set the sync=false , but the delay is still more
> than 5S.
> I guess it is because some of the queue or multiqueue  inside has  cache, so
> I would like to ask for advice, how to use code elegant way of processing
> data as soon as possible and without caching data in anywhere ?

The problem won't be so much buffering or caching anywhere, but the
timestamps and latency introduced by RTMP and rtmpsrc probably. You
would have to debug where exactly the latency is introduced and then
try to lower it by tuning whatever is available at that point.

--
Sebastian Dröge, Centricular Ltd · http://www.centricular.com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (985 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: gstplayer how to let all of the plugins are not cached and processing data as soon as possible?

rland
Thank you for your comment.

>The problem won't be so much buffering or caching anywhere, but the
>timestamps and latency introduced by RTMP and rtmpsrc probably.

But the RTMP source is the same source, so I think it should not  caused by the RTMP itself?
>You
>would have to debug where exactly the latency is introduced and then
>try to lower it by tuning whatever is available at that point.

with playbin, I did the following 2  attempts:
(1)Make basesink->sync= false
       =>Latency is reduced  6S(13s->7s)
 (2)  Comment queue2-0's property settings code,
       =>Latency is reduced  6S(7s->1s)

----------------------------------------------------------------------playbin0---------------------------------------
|                                                                                        ----------------------uridecodebin0-------------------
|                                                                                        |
|rtmpsrc -> typefindelement -> queue2-0 ->|  -> typefind -> flvdemux -> multiqueue   ...
|                                                                                        |
|                                                                                         --------------------------------------------------------------
|
------------------------------------------------------------------------------------------------------------------------------    

gsturidecodebin.c type_found ()
/* signaled when we have a stream and we need to configure the download
 * buffering or regular buffering */
static void
type_found (GstElement * typefind, guint probability,
    GstCaps * caps, GstURIDecodeBin * decoder)
{
  ......
    if (do_download) {
      gchar *temp_template, *filename;
      const gchar *tmp_dir, *prgname;

      tmp_dir = g_get_user_cache_dir ();
      prgname = g_get_prgname ();
      if (prgname == NULL)
        prgname = "GStreamer";

      filename = g_strdup_printf ("%s-XXXXXX", prgname);

      /* build our filename */
      temp_template = g_build_filename (tmp_dir, filename, NULL);

      GST_DEBUG_OBJECT (decoder, "enable download buffering in %s (%s, %s, %s)",
          temp_template, tmp_dir, prgname, filename);

      /* configure progressive download for selected media types */
      g_object_set (queue, "temp-template", temp_template, NULL);

      g_free (filename);
      g_free (temp_template);
    } else {
//      g_object_set (queue, "use-buffering", TRUE, NULL);
//      g_object_set (queue, "ring-buffer-max-size",
//          decoder->ring_buffer_max_size, NULL);
//      /* Disable max-size-buffers */
//      g_object_set (queue, "max-size-buffers", 0, NULL);
    }
 .....
}

Through the above 2 step tuning, the latency is roughly 1~2s.However, why  queue2-0 can be introduced into  6S delay, the reason I still don't  know ...