Skip to content

Instantly share code, notes, and snippets.

@joshschmelzle
Last active April 21, 2024 02:38
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshschmelzle/05d4023c931a744475284b0e6f153c65 to your computer and use it in GitHub Desktop.
Save joshschmelzle/05d4023c931a744475284b0e6f153c65 to your computer and use it in GitHub Desktop.
Slow a video down with ffmpeg

To slow down your video, you have to use a multiplier greater than 1:

ffmpeg -i input.mkv -filter:v "setpts=2.0*PTS" output.mkv

For example, to double the speed of the video, you can use:

ffmpeg -i input.mkv -filter:v "setpts=0.5*PTS" output.mkv

Source

If you have audio, see comment below about also slowing down the audio.

@IamMusavaRibica
Copy link

IamMusavaRibica commented Dec 4, 2023

This leaves audio at original speed over the video
From the docs:

ffmpeg -i input.mkv -filter_complex "[0:v]setpts=0.5*PTS[v];[0:a]atempo=2.0[a]" -map "[v]" -map "[a]" output.mkv

@joshschmelzle
Copy link
Author

Thanks for catching this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment