gstreamer with playbin: how to pause 'now' or pause at exact time

Tim-Philipp Müller t.i.m at zen.co.uk
Thu Sep 26 14:38:03 PDT 2013


On Thu, 2013-09-26 at 23:12 +0200, Alexandru Munteanu wrote:

Hi,

> > > I am using gstreamer 1.0.10 (packages from debian testing) with the playbin element
> > > (for mp3splt-gtk).
> > > 
> > > When I set the element to GST_STATE_PAUSED, I always have a lag between the moment I call
> > > gst_element_set_state() and the time when the pause occurs.
> > > Is there a way to "pause right now" or "pause at a precise time in the future" ?
> > 
> > Sorry for not answering your question, but let me ask you first: what
> > are you trying to achieve with that? What's the big picture?
> 
> I just want to pause at a precise time (say for example at 1 minute, 3
> seconds and 57 hundreths of seconds).
> You can see in the following screenshot two green circles and I want the
> player to pause exactly at middle of the second green circle:
> http://mp3splt.sourceforge.net/mp3splt_page/screenshots/mp3splt-gtk_0.7.3.png
> 
> And I set the state to GST_STATE_PAUSED when gst_element_query() with 
> GST_FORMAT_TIME gives me the time I want to stop at. But when I query again
> after the pause, I don't have the same time as when I paused it.
> 
> I hope it is a little bit more clear now.

What you can do is that you preroll the pipeline, and then do a
(flushing) seek in TIME format and specify a stop position with the
seek. Then it should stop exactly where you want it to stop.

There's also the gnonlin plugins and, even higher level,
gst-editing-services, which you might also find useful.

Cheers
 -Tim



More information about the gstreamer-devel mailing list