Slowing a clip is a go-to technique for tutorials, product demos, gameplay, and cinematic b-roll. In community threads, a common theme emerges: people want clean slow motion with synced audio, minimal quality loss, and commands that are easy to reuse in scripts and CI pipelines.
Hi folks,
I need a reliable, repeatable way to change playback speed for several clips across macOS and Linux. Specifically, how to slow down video using FFmpeg while keeping audio in sync and quality high? I’m looking for examples like 2x and 4x slow motion, how to keep pitch natural, and any tips for smoothing motion so it does not look choppy. Bonus points if there is a way to generate outputs for the web with sane defaults. Thanks!
FFmpeg makes creating slow motion video simple using a video PTS change and an audio tempo adjustment. Below are proven recipes, from basic to smoother, plus tips for quality and batching. If you are new to FFmpeg’s role in modern workflows, this overview of FFmpeg features and use cases is a good start.
- Video speed is controlled by presentation timestamps (PTS).
- Factors greater than 1 slows down videos. Example: factor 2 means half speed.
# 2x slow motion, video only
ffmpeg -i input.mp4 -filter:v "setpts=2*PTS" -an \
-c:v libx264 -crf 18 -preset medium -pix_fmt yuv420p output_slow2x.mp4Code language: PHP (php)
- Use
atempofor audio. It changes tempo while preserving pitch. atemposupports 0.5 to 2.0 per filter. Chain filters together for bigger changes.
# 2x slow motion with audio
ffmpeg -i input.mp4 -filter_complex "[0:v]setpts=2*PTS[v];[0:a]atempo=0.5[a]" \
-map "[v]" -map "[a]" \
-c:v libx264 -crf 20 -preset medium -pix_fmt yuv420p \
-c:a aac -b:a 192k output_slow2x_av.mp4
# 4x slow motion with audio (0.25x speed requires chaining atempo)
ffmpeg -i input.mp4 -filter_complex "[0:v]setpts=4*PTS[v];[0:a]atempo=0.5,atempo=0.5[a]" \
-map "[v]" -map "[a]" \
-c:v libx264 -crf 20 -preset medium -pix_fmt yuv420p \
-c:a aac -b:a 192k output_slow4x_av.mp4Code language: PHP (php)
Tip: To mute audio instead, drop the audio mapping and add -an. To keep the audio untouched, omit the atempo chain, but the audio will finish earlier than the video.
If the clip looks choppy at high slowdowns, synthesize intermediate frames before stretching time.
# Interpolate more frames, then slow to 4x
ffmpeg -i input.mp4 -filter:v "minterpolate=fps=120, setpts=4*PTS" \
-c:v libx264 -crf 20 -preset slow -pix_fmt yuv420p output_slow4x_smooth.mp4Code language: PHP (php)
Start with fps=60 or fps=120 depending on your output needs. More frames means more compute time and a bigger file.
- Codec: H.264 is the safe baseline for web delivery. See H.264 best practices.
- Rate control: CRF controls quality. Lower CRF is higher quality. Common range is 18 to 23.
- Preset: Slower presets use more CPU to compress better at the same quality.
- Pixel format:
yuv420pmaximizes device compatibility. - Audio: AAC 128 to 192 kbps is fine for most content.
- Target delivery: Read up on video encoding best practices for the web.
# Bash: 2x slow for all MP4s in a folder
for f in ./*.mp4; do
ffmpeg -y -i "$f" \
-filter_complex "[0:v]setpts=2*PTS[v];[0:a]atempo=0.5[a]" \
-map "[v]" -map "[a]" \
-c:v libx264 -crf 20 -preset medium -pix_fmt yuv420p \
-c:a aac -b:a 160k "${f%.mp4}_slow2x.mp4"
doneCode language: PHP (php)
- Can I slow down without re-encoding? Practically no. Changing timestamps or generating frames requires re-encoding the video stream.
- How do I choose the PTS factor? new_factor = 1 / playback_speed. Example: 0.5x speed means factor 2, 0.25x speed means factor 4.
- Why does the output look washed out on some players? Ensure
-pix_fmt yuv420pfor compatibility.
Prefer to generate slowed versions on demand and skip local encoding pipelines? You can upload your source video once, then request a slowed variant via a URL-based transformation. For example, you can deliver a 50% slow version on the fly, and combine that with format and delivery controls.
https://res.cloudinary.com/demo/video/upload/e_accelerate:-50/sample.mp4
You can integrate this with web players or batch operations, and pair it with best practices from the guides above to ensure smooth delivery for your users.
- Use
setptsto slow video: Factor greater than 1 slows down. - Use
atempoto keep audio in sync and preserve pitch. Chain atempo for big slowdowns. - Interpolate frames with
minterpolate. This makes smoother motion at extreme slow speeds. - Encode with H.264, CRF 18 to 23, and yuv420p for broad compatibility.
- Cloudinary can generate slowed versions on demand via URL transformations.
Ready to streamline video processing and delivery in one place? Create your free Cloudinary account and start optimizing today.