[gst-devel] Seeking for mp4/3gp files

Michael Smith msmith at fluendo.com
Thu Oct 19 09:56:25 CEST 2006

On Thu, 2006-10-19 at 09:44 +0530, Deeptendu Bikash wrote:
> Hi,
> I'm using gstreamer to play local movies. When I try to seek on MPEG2
> movies, in some movies I get some kind of seeking, but the interval of
> seek is variant. In some other movies, and in all mp4 and 3gp movies,
> everytime I try to do a seek, the movie starts playing from the
> beginning.
> I use the code:
> event = gst_event_new_seek(1.0, GST_FORMAT_TIME,
>                                            GST_SEEK_TYPE_CUR,
> gst_element_send_event(pipeline, event);
> My questions are: 
> 1. Though this code calls for 100 msec seek from the current position,
> the movement at times is more than 10 mins. Is there a way to correct
> this behaviour? 

GST_SEEK_TYPE_CUR does not seek from the current position. You want to
use GST_SEEK_TYPE_SET, and you almost certainly want to use
GST_SEEK_TYPE_NONE for the second (end) time.

I wouldn't be at all suprised if many plugins implement
GST_SEEK_TYPE_CUR incorrectly; there aren't many things that use it.

You probably want to issue a position query (to get the current
position), then seek to a specific location by adding/subtracting from



More information about the gstreamer-devel mailing list