GNOME Bugzilla – Bug 123815
Variable-speed playback on any stream
Last modified: 2005-08-15 01:28:50 UTC
There is a utility for Windows which lets you set the playback speed for any windows media window to anywhere between 0.5 and 2.0x the original speed. It's an awesome feature which is especially useful for lectures that come on CD/DVD, or for audiobooks. Very quickly you get used to absorbing information at twice the speed, and listening/watching at the original speed is just painful. How hard would it be to add this feature to gst-player, or to the gstreamer framework in general? I am requesting it here with a hope that it will be something that you can at least design the APIs/the framework around, for future addition, before the system gets completely set in concrete... Thanks!
Isn't this possible with the speed plug-in <URI:http://gstreamer.net/status/?category=5> that "changes speed/pitch by arbitrary amounts using linear interpolation"?
It does look like that's exactly what it does -- has anyone tried it? How could I test it out (do I have to write code)?
Yep, this is definitely what it does. You can try it out by running something like this (no code is necessary): gst-launch-0.7 filesrc location=Barry_White.ogg ! vorbisfile ! speed speed=2 ! osssink Be prepared to laugh, or similar. :)
Nice :-> Unfortunately the sound quality is seriously degraded by this -- what is the resampling algorithm used? Doesn't Gstreamer already have a high-quality resampler? I also get: WARNING **: element speed0 performs a yield, please fix the element And it takes two Ctrl-C's to interrupt the pipeline (weird). Is it possible to insert an element as a preprocessor to a sink, so it is always used, i.e. so that osssink runs through speed for the whole desktop? (It would be nice to have an applet that sets the speed for all gst apps, without needing to set up their pipelines explicitly.)
if you'd like to have this speed plugin used as a preprocessor in many GNOME based GStreamer applications, you can put it into your GConf settings, under /system/gstreamer/default/audiosink : set the key to something like "speed speed=2 ! osssink". in fact, this key accepts any valid gst-launch syntax, so you could come up with other equally interesting preset sinks to use. the drawback of this approach is that you can't modify the speed once an application starts running. but until this feature creeps its way into the gst-player, it might be a good solution for you.
Awesome, thanks. Just one other question then before I close the bug -- is it possible to get better resampling quality? Does "speed" use gstreamer's built-in resampler?
Actually, I take that back -- does this work for video stream framerates too? i.e. is it a clock rate fixer, or is it just a sound resampler? (I don't have any video playback mechanism for GStreamer right now to test the video on.) Also, would it be possible to interpolate video frames to produce "in-betweens", using e.g. MPEG2 motion vectors to interpolate, to double the framerate or halve the playback speed? 24fps always seemed jerky to me -- imagine playing back a DVD at 48fps... it would also be nice if we had real video in-between support for slow playback speeds. (That would be needed e.g. for a non-linear video editor for some speed-related effects.)
Speed doesn't use libaudioresample, but should. Video resampling ("pulldown") is always done framewise, since interpolating frames is impossible.
This might be useful too: http://scizzor.sourceforge.net/
Can this bug be closed? The speed plugin should be fixed in CVS (not using libaudioresample though). And isn't providing variable-speed playback on any stream something that should be taken care of at the application level rather than at the GStreamer level in any case? Cheers -Tim
Sure, closing bug. Thanks.