Altering playback speed

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Altering playback speed

Wes Miller
Administrator
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?

Wes
Reply | Threaded
Open this post in threaded view
|

Re: Altering playback speed

Xavier Queralt Mateu
On Wed, Jun 9, 2010 at 5:17 PM, Wes Miller <[hidden email]> 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

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Altering playback speed

Wes Miller
Administrator
Xavier,

I can't seem to get the new_segment to work.  Does it matter that my sink is a file?  Where should I issue this command?  befor setting the state to PLAYING, in a callback?



I did get the behavior I wanted by modifying each buffer changing their timestamp to consecutive multiples of 33000000.  My stream was every 50th frame from a recorded "live" stream.  Until I modified the timestamps, the video still played at the original speed just displaying each frame for 50 time intervals

.

Wes