[gst-devel] Re : question on seek

Albert Costa costa_albert at yahoo.fr
Fri Apr 10 10:51:53 CEST 2009


Thanks to all for the answers.
So it looks like I can't avoid simply the prerolled frames, at least without significant code change. So I'll just let it be for the moment.
Al



________________________________
De : Tim-Philipp Müller <t.i.m at zen.co.uk>
À : gstreamer-devel at lists.sourceforge.net
Envoyé le : Mercredi, 8 Avril 2009, 14h26mn 41s
Objet : Re: [gst-devel] question on seek

On Wed, 2009-04-08 at 09:21 +0000, Albert Costa wrote:

> I have a simple question: I have an application where I want to
> display only a subset of a video. My pipeline can be resumed to
> 'filesrc ! decodebin ! ffmegcolorspace ! queue ! directdrawsink'. To
> see only a part of the video, I use following :
> 
>               (snip flushing segment seek)
>               gst_element_set_state(m_pipeline, GST_STATE_PLAYING);
>               gst_element_get_state(m_pipeline, NULL, NULL, -1);
>               gst_element_send_event(m_pipeline, seek_event);
>
> where start/stop_time are values for the start and end positions in my
> file.
> Everything works fine, except for the fact that just before displaying
> the video at position start (and then playing up to stop position), I
> do see the first (0) frame of the video.

The problem is that the video sink will render the first frame already
on preroll, so just as it goes into PAUSED state. You are waiting for
the pipeline to finish prerolling though (and reach playing state on top
of that) before you issue the flushing seek, so at that point it's too
late and the first frame has already been shown.

So if you want to avoid that you either have to prevent the videosink
from drawing preroll buffers, or do the seek before it reaches the sink
(but after you know the demuxer is read for seeking, which is tricky).
You could probably do something involving pad blocks here. Or use
gnonlin, as has already been suggested.

Cheers
-Tim




------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
_______________________________________________
gstreamer-devel mailing list
gstreamer-devel at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20090410/60390767/attachment.htm>


More information about the gstreamer-devel mailing list