10/22/2025
Learn to create stunning timelapse and slow-motion effects by changing video speed with FFmpeg. This guide provides the exact commands and filter explanations for perfect results.
How to Speed Up or Slow Down Video with FFmpeg (Timelapse & Slow Motion)
Want to condense a multi-hour sunset recording into a few seconds of beautiful timelapse? Or slow down a fast-paced action to analyze every detail? FFmpeg allows you to achieve precise speed control by manipulating a video's "timestamps," letting you create professional-grade speed effects with ease.
🚀 Quick Path: The FFmpeg Commands
To Speed Up a Video (e.g., 2x Speed):
To make a video play twice as fast, you need its timestamps to progress twice as quickly. PTS
stands for Presentation Timestamp. PTS/2
means all frames will be shown in half the original time.
ffmpeg -i input.mp4 -vf "setpts=0.5*PTS" -an output_fast.mp4
To Slow Down a Video (e.g., 0.5x Speed / Slow Motion):
To make a video play at half speed, you need its timestamps to progress more slowly. PTS*2
means all frames will be shown over double the original time.
ffmpeg -i input.mp4 -vf "setpts=2*PTS" -an output_slow.mp4
🧠The Breakdown: What Each Parameter Means
The core of this command is the setpts
filter, which stands for "Set Presentation TimeStamp."
Parameter | Explanation | Example |
---|---|---|
ffmpeg |
The command to start the FFmpeg program. | ffmpeg |
-i input.mp4 |
-i (input) specifies your source video file. |
-i my_journey.mp4 |
-vf |
Short for "video filter," this tells FFmpeg you are applying a filter to the video stream. | -vf |
"setpts=X*PTS" |
This is the core of the speed change. It modifies each frame's PTS value with a multiplier. | "setpts=0.5*PTS" |
↳ X |
The inverse of the speed factor. For 2x speed, X is 1/2=0.5 . For 0.5x speed, X is 1/0.5=2 . |
0.5 , 2 , 4 , etc. |
↳ PTS |
A variable representing the original timestamp, which you must include in the expression. | PTS |
-an |
Short for "Audio No." When changing speed, the audio often becomes unusable, so it's best to remove it. | -an |
output.mp4 |
The filename for your new, speed-adjusted video. | timelapse.mp4 |
FAQ & Variations
Q: I changed the video speed, but the audio is now too fast/slow and sounds weird. How can I adjust the audio speed to match?
A: Great point! The -an
parameter in the examples above simply discards the audio. If you want the audio to match the new speed, you need to use the atempo
audio filter. The atempo
filter accepts a speed multiplier between 0.5
and 100.0
.
For example, to speed up both video and audio to 2x:
ffmpeg -i input.mp4 -filter_complex "[0:v]setpts=0.5*PTS[v];[0:a]atempo=2.0[a]" -map "[v]" -map "[a]" output_full_speed.mp4
- We use
-filter_complex
to process the video[0:v]
and audio[0:a]
streams simultaneously. - The video uses
setpts=0.5*PTS
(the inverse of the speed). - The audio uses
atempo=2.0
(the direct speed multiplier).
Q: The atempo
filter has a maximum speed of 100x. What if I want to create an even faster timelapse?
A: An excellent advanced question. You can chain atempo
filters together. For example, to achieve a 400x speed, you could call atempo=100
twice (100*100=10000, which is too fast), but more practically, you can chain atempo=2.0
multiple times.
For instance, to achieve 4x audio speed:
... -filter_complex "[0:a]atempo=2.0,atempo=2.0[a]" ...
This will speed up the audio by a factor of 2, and then speed up that result by another factor of 2, for a total of 4x speed.