[gst-devel] Altering playback speed

Xavier Queralt Mateu xqueralt at gmail.com
Wed Jun 9 20:54:26 CEST 2010


On Wed, Jun 9, 2010 at 5:17 PM, Wes Miller <wmiller at sdr.com> wrote:
>
> How does one alter the playback speed of a recorded video feed?  Is it as
> simple as changing the timestamps to make them closer together?
>
> Assuming that I can get at each buffer in a pipe using a padprobe, is the
> timestamp directly alterable (i.e. is it metadata) or do I need to create a
> copy of the buffer?  Once the buffer is modified, will pushng it out cause
> the modified buffer to flow from a src pad instead of the original buffer?

I'm not an expert on that but I guess the best way of altering the
playback speed is to send a newsegment event with the desireed rate to
the sink element:

gst.event_new_new_segment(True, 0.5, gst.FORMAT_TIME, 0, -1, 0)

with this you're telling the sink to play the buffers from time 0 at
half speed. This way the sink will take care of playing the incoming
buffers at the specified rate and you don't have to worry of the
timestamps.
You better take a look to the documentation and play with it:

http://www.gstreamer.net/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstEvent.html#gst-event-new-new-segment
http://pygstdocs.berlios.de/pygst-reference/class-gstevent.html#function-gstevent--event-new-new-segment




More information about the gstreamer-devel mailing list