Seeking a pipeline with live streams

Andrei Melnikov andy.melnikov at gmail.com
Mon Oct 28 13:31:08 CET 2013


> On Sa, 2013-10-26 at 23:49 -0200, Adrian Pardini wrote:
> > On 25 October 2013 06:44, Andrei Melnikov <andy.melnikov at gmail.com>
wrote:
> > > I load the pipeline using gst_parse_launch(), set it to PLAYING and
seek by
> > > passing the pipeline bin to gst_element_seek_simple(). The code works
fine
> > > with simple pipelines playing a file, but the pipeline above refuses
to
> > > seek. It sort of seeks, but with glitches and
gst_element_seek_simple()
> > > returns FALSE.
> >
> > Hi Andrei, after a while trying to achieve the same I've resorted to
> > have a main pipeline for the live sources and a second one for the
> > file content linking both with a pair of interaudio and intervideo
> > sink and src's.
>
> basically you want to seek on the file
> based pipeline while letting the live pipeline continue running, right?

Correct.

> So you should only send a seek to the file based part of the pipeline.

> You would need to adapt
> the segment event coming from the file based pipeline into videomixer to
> make sure that the buffers after the seek would have a running time that
> is just a continuation of the previous buffers.

How do I do that? gst_event_new_new_segment() and gst_pad_push_event()?
There is not much documentation.

Do I need to get current running time and arrange a seek at some point in
the future?

What if I want to disable the recorded stream or to switch to another file?

> By using the inter elements you make the file based pipeline a live
> stream too, which solves all these problems for you. It is not the
> optimal solution though and has some downsides, but if it works fine for
> you just keep it ;)

Unlike Adrian I don't have any existing code so I'd like to go the right
way (tm).







On 27 October 2013 21:51, Sebastian Dröge <sebastian at centricular.com> wrote:

> On Sa, 2013-10-26 at 23:49 -0200, Adrian Pardini wrote:
> > On 25 October 2013 06:44, Andrei Melnikov <andy.melnikov at gmail.com>
> wrote:
> > > I load the pipeline using gst_parse_launch(), set it to PLAYING and
> seek by
> > > passing the pipeline bin to gst_element_seek_simple(). The code works
> fine
> > > with simple pipelines playing a file, but the pipeline above refuses to
> > > seek. It sort of seeks, but with glitches and gst_element_seek_simple()
> > > returns FALSE.
> >
> > Hi Andrei, after a while trying to achieve the same I've resorted to
> > have a main pipeline for the live sources and a second one for the
> > file content linking both with a pair of interaudio and intervideo
> > sink and src's.
> >
> > Hope that helps but I'd also like to hear the opinion of more
> > knowledgeable people.
>
> I think that's a valid approach for this. The main question here is how
> you want everything to behave, basically you want to seek on the file
> based pipeline while letting the live pipeline continue running, right?
> So you should only send a seek to the file based part of the pipeline.
>
> As videomixer mixes both streams according to their running times, you
> need to make sure that those still align after the seek. A flushing seek
> would ensure that the running time of the file based pipeline would
> start again at 0, which is not what you want. You would need to adapt
> the segment event coming from the file based pipeline into videomixer to
> make sure that the buffers after the seek would have a running time that
> is just a continuation of the previous buffers.
>
>
> By using the inter elements you make the file based pipeline a live
> stream too, which solves all these problems for you. It is not the
> optimal solution though and has some downsides, but if it works fine for
> you just keep it ;)
>
> --
> Sebastian Dröge <sebastian at centricular.com>
> Centricular Ltd - http://www.centricular.com
> Expertise, Straight from the Source
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
>


-- 
Andrei
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20131028/9476f583/attachment.html>


More information about the gstreamer-devel mailing list