wiki:

How to speed up

/

slow down a video


Version 4 (modified by rogerdpack, 4 years ago) (diff)

--

You can change the speed of your video using setpts video filter. The "old way" of creating timelapse or still frame was to first split up a video into individual frames, (for instance, as jpg's) then delete some and recombine the frames. Using the setpts filter is the new way and is faster and possibly less lossy :)

To speed up your video, you can type:

ffmpeg -i input.avi -vf "setpts=0.5*PTS" output.avi

Note that this method will drop frames to achieve your desired speed. You can avoid dropping frames by specifying a higher "output frame rate" than the input, for example, to go from 4 to 16 fps:

ffmpeg -i Input.mp4 -r 16 -vf setpts=0.125*PTS -an Output.mp4

Or possibly by specifying the vcodec as "copy".

To slow down your video, you can type:

ffmpeg -i input.avi -vf "setpts=2.0*PTS" output.avi