[gst-devel] Position info when doing time stretch

Gabriel M. Beddingfield gabrbedd at gmail.com
Mon Sep 6 03:59:47 CEST 2010


Hello,

I'm doing time stretching app, and want the UI to show 
position/length info in terms of the original media.  
However, gst_element_query_position() and _duration() always 
gives me playback times relative to the wall clock.  This 
time is affected by the playback speed.

Does anyone know a way to handle this?[1]

Here's the details................

Application:    StretchPlayer[2]
Implementation: C++
Current API's:  sndfile, rubberband, JACK

My GStreamer port is setting up this pipeline:

  playbin --> audioconvert --> pitch
          --> volume --> autoaudiosink

Pitch the soundtouch 'pitch' plugin that does time 
stretching and pitch shifting.  The playbin is only given 
local files.

Whenever I query playbin for position and duration, it 
always reports time in terms of the wall clock.  That is, if 
I've been listening for 30 secs, it tells me 30 secs.  
However, if I'm playing at 1/2 speed, I want it to tell me 
"15 secs".

At the moment, the only solution I see is to break up my 
pipeline like this:

  playbin --> appsink --> memory

  memory --> appsrc --> pitch --> volume --> autoaudiosink

This would allow me to precisely track the position of the 
audio, since I'm metering it out from memory.  However, when 
I tried to set up appsrc/appsink in a Qt application it gave 
me fits last week.[3]

Does anyone have any suggestions??

Thanks in advance,
Gabriel

[1] I did search the archives, though I had to use
    something like Nabble.  For some reason, I couldn't
    make SF's search work.  The only thing I found was
    the app playitslowly.
[2] http://www.teuton.org/~gabriel/stretchplayer/
[3] I started off trying to do appsrc because it would
    allow me to wrap gstreamer into a form that looked
    like JACK or ALSA.




More information about the gstreamer-devel mailing list