<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>Hi Andoni,</div><div>thanks for the tip. In fact, the seek itself is running fine, once it is active. My issue is that the pipeline starts playing from 0 before the seek really occurs, thus displaying a few frames before it moves to expected position. I've tried to seek before setting the pipeline to&nbsp;<span class="Apple-style-span" style="font-family: arial; font-size: 13px; ">GST_STATE_PLAYING (put the pipe in&nbsp;GST_STATE_PAUSED, then seek, then set to&nbsp;GST_STATE_PLAYING) but it doesn't work. Is there a way to position the stream to a given seek pos before it actually starts to play?</span></div><div><font class="Apple-style-span" face="arial" size="3"><span class="Apple-style-span" style="font-size: 13px;">Al</span></font></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> Andoni Morales &lt;ylatuya@gmail.com&gt;<br><b><span style="font-weight: bold;">À :</span></b> Discussion of the development of GStreamer &lt;gstreamer-devel@lists.sourceforge.net&gt;<br><b><span style="font-weight: bold;">Envoyé le :</span></b> Mercredi, 8 Avril 2009, 12h27mn 41s<br><b><span style="font-weight: bold;">Objet&nbsp;:</span></b> Re: [gst-devel] question on seek<br></font><br>2009/4/8 Albert Costa &lt;<a ymailto="mailto:costa_albert@yahoo.fr" href="mailto:costa_albert@yahoo.fr">costa_albert@yahoo.fr</a>&gt;:<br>&gt; Hi All,<br>&gt; I have a simple question: I have an application where I want to display only<br>&gt; a subset of a video. My pipeline can be resumed to 'filesrc ! decodebin !<br>&gt; ffmegcolorspace ! queue ! directdrawsink'. To
 see only a part of the video,<br>&gt; I use following :<br>&gt; GstEvent* seek_event;<br>&gt; seek_event = gst_event_new_seek (1.0, GST_FORMAT_TIME,<br>&gt; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(GstSeekFlags) (GST_SEEK_FLAG_SEGMENT |<br>&gt; GST_SEEK_FLAG_FLUSH),<br>&gt; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;GST_SEEK_TYPE_SET, start_time,<br>&gt; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;GST_SEEK_TYPE_SET, stop_time);<br>&gt; &nbsp;&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; &nbsp;gst_element_get_state(m_pipeline, NULL, NULL,<br>&gt; GST_CLOCK_TIME_NONE);<br>&gt; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;gst_element_send_event(m_pipeline, seek_event);<br>&gt; where start/stop_time are values for the start and end positions in my file.<br>&gt; Everything works fine,
 except for the fact that just before displaying the<br>&gt; video at position start (and then playing up to stop position), I do see the<br>&gt; first (0) frame of the video.<br>&gt; Is there a way to avoid this and have the pipeline really starting from the<br>&gt; position I want?<br><br>Maybe using this method is simpler:<br><br>gst_element_seek (m_pipeline, 1.0,<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_ACCURATE,<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; GST_SEEK_TYPE_SET, start_time,<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; GST_SEEK_TYPE_SET, stop_time);<br><br>If you want accuracy in the seek, you should use the flag<br>GST_SEEK_FLAG_ACCURATE. The seek&nbsp; is slower but much more accurate.<br><br>Andoni<br><br>&gt; Regards,<br>&gt; Al<br>&gt;<br>&gt; ------------------------------------------------------------------------------<br>&gt; This SF.net email is sponsored by:<br>&gt; High
 Quality Requirements in a Collaborative Environment.<br>&gt; Download a free trial of Rational Requirements Composer Now!<br>&gt; <a href="http://p..sf.net/sfu/www-ibm-com" target="_blank">http://p.sf.net/sfu/www-ibm-com</a><br>&gt; _______________________________________________<br>&gt; gstreamer-devel mailing list<br>&gt; <a ymailto="mailto:gstreamer-devel@lists.sourceforge.net" href="mailto:gstreamer-devel@lists.sourceforge.net">gstreamer-devel@lists.sourceforge.net</a><br>&gt; <a href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</a><br>&gt;<br>&gt;<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>