best way to start playback at 01:22, playback rate 1.3x?

Tim Müller tim at centricular.com
Tue Nov 12 03:29:16 PST 2013


On Mon, 2013-11-11 at 22:09 +0200, Dan wrote:

Hi Dan,

> I'm currently using Playbin2 0.10 (with PyGST, but that shouldn't
> matter). What's the best way to specify the playback starting position
> and playback rate for a new video?
> 
> I'm currently issuing a seek "as soon as I get the chance" (i.e. when
> I get a GST_MESSAGE_STATE_CHANGED / PLAYING, since I've seen some bugs
> with seeking while PAUSED). I bet there's a more elegant way to do
> this though.

Out of curiosity, what bugs have you seen with seeking in PAUSED? It's a
really common pattern, so I would expect this to work fine.

The usual way of doing this (for non-live playback) is
 - set pipeline to PAUSED
 - wait for ASYNC_DONE message on bus
 - do flushing seek with start=82*GST_SECOND and rate=1.3
   (assuming 01:22 = 1m22s and not 1h22m)
 - set pipeline to PLAYING

Might also be good to know what platform you're working on, if this is
some embedded system or standard desktop/laptop linux, or windows/OSX
etc..

Cheers
 -Tim

-- 
Tim Müller, Centricular Ltd - http://www.centricular.com






More information about the gstreamer-devel mailing list