Re: Changing Playback rate with Gstreamer?

Michael Gruner via gstreamer-devel <[email protected]> Thu, 5 Oct 2023 08:55:00 -0600
Newsgroups gmane.comp.video.gstreamer.devel
Message-ID <[email protected]>
Hi Will

Yes the videorate can do what you want. Set the “rate” property to 2.0

Videorate serves two purposes:

1. control the framerate but maintain the playback speed (most documented usage)

2. vary the playback speed (using the rate property)

If you want more flexibility than videorate can offer you will need to send a seek event. This allows you to, not only to increase/decrease the speed, but also to start from a certain point, go backwards and many other trick modes.

Trickmodes

gstreamer.freedesktop.org

https://gstreamer.freedesktop.org/documentation/additional/design/trickmodes.html?gi-language=c#client-side-backwards-trickmode

Michael

On 5 Oct 2023, at 07:57, Will McElderry via gstreamer-devel <[email protected]> wrote:

Hi All,

I'm wondering if there is a way to change the playback display period rate of an input stream.

For example, I'd like to convert:

file1.mp4 with 1000 frames, plays back @10 fps = 100 seconds long

Into

file1_fast.mp4 with 1000 frames, plays back @20 fps = 50 seconds long

I can do it with ffmpeg in various ways as detailed here:

https://trac.ffmpeg.org/wiki/How%20to%20speed%20up%20/%20slow%20down%20a%20video

Are there any simple pipelines elements that can do that?

(NB: I believe the videorate plugin does not do what I want. Please flag if you know otherwise!)

Thanks!

Will.
favicon-180.png (image/png, 14 KB) - not displayed