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

Alexandru Munteanu m at ioalex.net
Tue Oct 1 15:04:37 PDT 2013


On 22:38 Thu 26 Sep     , Tim-Philipp Müller wrote:
> 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.

Tim,

If I understand well, you are suggesting to seek backward (with flush)
after changing the state to PAUSED. Sorry if I misunderstood, I'm not quite
familiar with prerolling.
The stop will surely be where I want it to stop but not when I want it.
Wouldn't the user hear more than necessary ?

Thank you.
-- 
Alex

> Cheers
>  -Tim



More information about the gstreamer-devel mailing list