Controlling cache or buffer length in RTSP H.264 live stream?

Ricky Houghton ricky.houghton at gmail.com
Sun Jan 26 19:03:47 PST 2014


This was a huge help - thank for the answers, especially on the weekend -
much appreciated.

 After a bit of digging, I was able to correctly get the source-setup
signal and set the latency to a lower value.

For the benefit of others,  to Tutorial-4.c (in app_function), I added the
line:

 *g_signal_connect(G_OBJECT (data->pipeline), "source-setup",
(GCallback)source_setup_cb,data);*

then I added the following callback function:



*static void source_setup_cb (GstElement *pipeline, GstElement *source,
CustomData *data) { // .. stuff removed g_object_set (source, "latency",
100, NULL);*

* // .. stuff removed}*

The source_setup_cb required different args.





On Sun, Jan 26, 2014 at 12:29 AM, Sebastian Dröge <sebastian at centricular.com
> wrote:

> On Sa, 2014-01-25 at 14:41 -0500, Ricky Houghton wrote:
> > On Sat, Jan 25, 2014 at 11:56 AM, Sebastian Dröge <
> sebastian at centricular.com
> > > wrote:
> >
> > > On Fr, 2014-01-24 at 11:36 -0500, Ricky Houghton wrote:
> > > > As a follow up, I have determined that the program, Tutorial #4,l
> thinks
> > > > that the stream is "NOT LIVE", however it never hits the buffering_cb
> > > > function in tutorial-4.c, so this function is not responsible for the
> > > delay.
> > >
> > > Buffering only happens if the stream is not considered live, and for
> > > RTSP streams only if the complete duration is known. What's the case
> > > here?
> > >
> >
> > The duration is unknown so I would assume there is no buffering - but
> there
> > is some somewhere.
> > (N.B. the function Tutorial 4 function buffering_cb is never called, so
> > there is no buffering happening here.)
> >
> > The RTSP stream is coming from a hardware encoder running the TI DaVinci
> > 8168. The particular
> > encoder is here: http://www.neyasystems.com/products/uxstreamer - they
> have
> > demonstrated 100ms
> > video to network in the past. (These guys are my friends.) Network
> latency
> > is single digit millisecond as the units are sitting
> > on an isolated AP, encoder hardwired, Nexus 7 is only wireless device.
> >
> > I have continued playing/exploring and I stumbled upon
> >
> > g_object_get (data->pipeline, "buffer-duration", &bufdur,NULL);
> > g_object_get(data->pipeline, "buffer-size", &bufsize,NULL);
> >
> > Are these two values relevant, even if local buffering (in Tutorial 4) is
> > not being used?
>
> They are not used in this case, no.
>
> > Can you point me to how I can control the rtspsrc buffer? I am using
> > Tutorial 4 and have access to the
> > pipeline etc, but not exactly clear how to access the rtspsrc filter and
> > how I might set the parameters for the buffering?
>
> playbin has the source-setup signal, which will be emitted when the
> source element is created (rtspsrc in your case). You could connect to
> that and then set the "latency" property of rtspsrc to a lower value.
> You can also set different protocol value there, by default it will use
> TCP if possible and falls back to UDP.
>
> --
> Sebastian Dröge, Centricular Ltd - http://www.centricular.com
> Expertise, Straight from the Source
>
> _______________________________________________
> gstreamer-android mailing list
> gstreamer-android at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-android
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-android/attachments/20140126/643a476f/attachment.html>


More information about the gstreamer-android mailing list