FFmpeg · Command Guide

How to Speed Up or Slow Down a Video With FFmpeg

Changing playback speed requires adjusting video and audio separately — they use different filters, and forgetting the audio one is the most common mistake.

Changing playback speed requires adjusting video and audio separately — they use different filters, and forgetting the audio one is the most common mistake.

The command

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

What each flag does

setpts=0.5*PTSHalves each frame's timestamp, which doubles playback speed. Use 2.0 to halve the speed instead.
atempo=2.0Speeds up audio by 2x while preserving pitch — the inverse of the setpts factor above.
-map "[v]" -map "[a]"Explicitly selects the filtered video and audio streams for output.

Where this goes wrong

The atempo filter only accepts values between 0.5 and 2.0 in a single instance. For more extreme speed changes (like 4x), chain two atempo filters: atempo=2.0,atempo=2.0 for 4x total.

Slowing down instead

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

Note the factors are inverted from speeding up: setpts uses the same number you'd divide speed by, atempo uses the reciprocal.

After the command

Speed changes are a raw-footage decision — made before the clip is considered 'cut.' NULLFRAME's templates take it from there, exactly as long as the clip you hand them already is.

See the templates

Common questions

Why does my audio sound like a chipmunk after speeding up?+
That happens if you only apply setpts to video and let audio play back at the original rate misaligned — atempo is required to keep pitch natural at the new speed.
Can I speed up video without changing audio speed?+
Yes, if you want the audio unchanged, mute or drop the original audio track and add a separate one instead — otherwise the two streams drift out of sync.
Does this work for variable speed ramps (slow-mo into normal speed)?+
Not with a single setpts factor — variable speed requires a more advanced expression or a dedicated tool, since setpts applies one constant factor across the whole clip.