<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:'times new roman', 'new york', times, serif;font-size:12pt"><div>Thanks to all for the answers.</div><div>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.</div><div>Al</div><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><br><div style="font-family:arial, helvetica, sans-serif;font-size:13px"><font size="2" face="Tahoma"><hr size="1"><b><span style="font-weight: bold;">De :</span></b> Tim-Philipp Müller &lt;t.i.m@zen.co.uk&gt;<br><b><span style="font-weight: bold;">À :</span></b> gstreamer-devel@lists.sourceforge.net<br><b><span style="font-weight: bold;">Envoyé le :</span></b> Mercredi, 8 Avril 2009, 14h26mn 41s<br><b><span style="font-weight: bold;">Objet&nbsp;:</span></b> Re: [gst-devel] question on seek<br></font><br>On
 Wed, 2009-04-08 at 09:21 +0000, Albert Costa wrote:<br><br>&gt; I have a simple question: I have an application where I want to<br>&gt; display only a subset of a video. My pipeline can be resumed to<br>&gt; 'filesrc ! decodebin ! ffmegcolorspace ! queue ! directdrawsink'. To<br>&gt; see only a part of the video, I use following :<br>&gt; <br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (snip flushing segment seek)<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  gst_element_set_state(m_pipeline, GST_STATE_PLAYING);<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  gst_element_get_state(m_pipeline, NULL, NULL, -1);<br>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  gst_element_send_event(m_pipeline, seek_event);<br>&gt;<br>&gt; where start/stop_time are values for the start and end positions in my<br>&gt; file.<br>&gt; Everything works fine, except for the fact that just before displaying<br>&gt; the video at position start
 (and then playing up to stop position), I<br>&gt; do see the first (0) frame of the video.<br><br>The problem is that the video sink will render the first frame already<br>on preroll, so just as it goes into PAUSED state. You are waiting for<br>the pipeline to finish prerolling though (and reach playing state on top<br>of that) before you issue the flushing seek, so at that point it's too<br>late and the first frame has already been shown.<br><br>So if you want to avoid that you either have to prevent the videosink<br>from drawing preroll buffers, or do the seek before it reaches the sink<br>(but after you know the demuxer is read for seeking, which is tricky).<br>You could probably do something involving pad blocks here. Or use<br>gnonlin, as has already been suggested.<br><br>Cheers<br> -Tim<br><br><br><br><br>------------------------------------------------------------------------------<br>This SF.net email is sponsored by:<br>High Quality
 Requirements in a Collaborative Environment.<br>Download a free trial of Rational Requirements Composer Now!<br><a href="http://p.sf.net/sfu/www-ibm-com" target="_blank">http://p.sf.net/sfu/www-ibm-com</a><br>_______________________________________________<br>gstreamer-devel mailing list<br><a ymailto="mailto:gstreamer-devel@lists.sourceforge.net" href="mailto:gstreamer-devel@lists.sourceforge.net">gstreamer-devel@lists.sourceforge.net</a><br><a href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</a><br></div></div><div style="position:fixed"></div></div><br>



      </body></html>