[gst-devel] Properly seeking in a track with gst-python

Michael Smith msmith at fluendo.com
Tue Feb 21 08:01:10 CET 2006


On Tue, 2006-02-21 at 08:36 -0700, Adam Olsen wrote:
> I'm setting up the pipeline like so:
> 
> 
> play = gst.element_factory_make("playbin")
> audio_sink = gst.element_factory_make('esdsink')
> play.set_property("audio-sink", audio_sink)
> play.set_property("volume", 1)
> 
> play.set_property("uri", "file://%s" % self.loc)
> play.set_state(gst.STATE_PLAYING)
> 
> When trying to seek, I use the following:
> 
> value = 10
> play.set_state(gst.STATE_PAUSED)
> event = gst.event_new_seek(gst.FORMAT_TIME |
>                                     gst.SEEK_METHOD_SET |
>                                     gst.SEEK_FLAG_FLUSH, value)
> 
> play.send_event(event)
> play.set_state(gst.STATE_PLAYING)
> 
> This doesn't seem to be working, it just resets playback on the track.

You probably wanted to seek to 10 seconds, right?
Try setting value to 10 * gst.SECOND (which should give you
10000000000).

I assume that in this respect the python bindings are close to the C API
- timestamps are in nanoseconds.

Mike






More information about the gstreamer-devel mailing list