Halve the timestamps with setpts=0.5*PTS and double the audio tempo with atempo=2.0, and a 10-second clip plays in 5, in sync. Through ReelSDK that 2x job cost under a fifth of a cent, at $0.02 per compute minute.
Speed up or slow down video with ffmpeg
Picture and sound need separate filters, and ReelSDK's API applied both to our 2x clip in about 6 seconds. Frames get dropped or stretched: at 2x every other frame goes, and at half speed 30 fps turns into a steppy 15.
GuidesUpdated
ffmpeg -i in.mp4 -filter_complex "[0:v]setpts=0.5*PTS[v];[0:a]atempo=2.0[a]" -map "[v]" -map "[a]" \
-c:v libx264 -crf 20 -preset veryfast -c:a aac -movflags +faststart fast.mp4setpts=0.5*PTS halves every frame's timestamp; atempo=2.0 plays the audio twice as fast at the same pitch. The output stays at 30 fps, so every other frame is dropped.
Variations
The other commands you will need
4x faster
atempo takes up to 100 in one go, but above 2 it skips samples, so chain two at 2.0. Both versions came out at a quarter of the original length.
4x ffmpeg -i in.mp4 -filter_complex "[0:v]setpts=0.25*PTS[v];[0:a]atempo=2.0,atempo=2.0[a]" -map "[v]" -map "[a]" \ -c:v libx264 -crf 20 -preset veryfast -c:a aac -movflags +faststart fast4.mp4Half speed
setpts=2.0*PTSspreads the same frames over twice the time. No frames are added, so the result runs at 15 fps.half speed ffmpeg -i in.mp4 -filter_complex "[0:v]setpts=2.0*PTS[v];[0:a]atempo=0.5[a]" -map "[v]" -map "[a]" \ -c:v libx264 -crf 20 -preset veryfast -c:a aac -movflags +faststart slow.mp4Smooth slow motion
minterpolatebuilds new frames from the motion between real ones: 583 frames at 30 fps instead of 293 at 15. It is slow: about two and a half minutes for under 10 seconds of 1080p.smooth ffmpeg -i in.mp4 -vf setpts=2.0*PTS,minterpolate=fps=30:mi_mode=mci \ -an -c:v libx264 -crf 20 -preset veryfast -movflags +faststart smooth.mp48x timelapse
Sound at 8x is noise, so
-androps it.fps=30keeps the output rate fixed, so only every eighth frame is left.timelapse ffmpeg -i in.mp4 -vf setpts=PTS/8,fps=30 -an -c:v libx264 -crf 20 -preset veryfast -movflags +faststart timelapse.mp4
The flags
The filters in these commands
| Flag | What it does | Used here |
|---|---|---|
setpts=0.5*PTS | Halves each video timestamp: twice as fast | 2x |
atempo=2.0 | Doubles audio speed at the same pitch; 0.5 to 100 per filter | 2x, 4x |
setpts=2.0*PTS | Doubles each timestamp: half speed | Half speed, smooth |
atempo=0.5 | Half-speed audio, the lowest one filter allows | Half speed |
minterpolate | Creates in-between frames from motion; mi_mode=mci is the full method | Smooth |
fps=30 | Fixes the output rate by dropping or repeating frames | Timelapse |
-an | Leaves the audio out | Smooth, timelapse |
Sources: ffmpeg filters: setpts, ffmpeg filters: atempo, ffmpeg filters: minterpolate, checked November 2026.
Why two filters
setpts only rewrites when each video frame is shown; it never touches the audio. atempo changes the speed of the sound and keeps its pitch. Use matching factors on both: 0.5 for setpts goes with 2.0 for atempo.
The manual says tempo "must be in the [0.5, 100.0] range" and that above 2 it "will skip some samples rather than blend them in". Chain filters for bigger changes, as in the 4x command.
Dropped frames and stretched frames
At 2x our output stayed at 30 fps, so ffmpeg dropped the frames that no longer fit, about every other one. That is fine; the motion still looks smooth.
Slowing down has the opposite problem. Nothing new is made: half speed spread the same frames over twice the time, 15 a second, and pans stutter. minterpolate fixes that by inventing frames, at about 12 times the render time of the plain slow version.
On the API
setpts, atempo, fps and minterpolate are all allowed on POST /v1/ffmpeg. The 2x job ran in about 6 seconds. Keep an eye on minterpolate: it took about two and a half minutes for under 10 seconds of 1080p on our desktop, and a job stops at 600 s, so scale down first or slow the clip in parts. Billing is per compute second; see pricing.
Without installing ffmpeg
The same command as one API call
Send the 2x command's args to POST /v1/ffmpeg. Each job runs ffmpeg 8.1 on a fresh machine at $0.02 per compute minute, billed per second; this one finished in about 6 seconds and cost under a fifth of a cent.
curl "https://api.reelsdk.com/v1/ffmpeg?wait=60" \
-H "Authorization: Bearer $REELSDK_KEY" \
--json '{
"inputs": {
"in.mp4": "https://api.reelsdk.com/f/lib/demo/landscape.mp4"
},
"args": [
"-i", "in.mp4", "-filter_complex",
"[0:v]setpts=0.5*PTS[v];[0:a]atempo=2.0[a]", "-map", "[v]", "-map",
"[a]", "-c:v", "libx264", "-crf", "20", "-preset", "veryfast", "-c:a",
"aac", "-movflags", "+faststart", "fast.mp4"
],
"outputs": ["fast.mp4"]
}'FAQ
Questions, answered
How do I speed up a video 2x with ffmpeg?
Use -filter_complex "[0:v]setpts=0.5*PTS[v];[0:a]atempo=2.0[a]" with -map "[v]" -map "[a]". Our 10-second clip came out at about 5 seconds.
Why does my slow motion look choppy?
setpts=2.0*PTS adds no frames, so 30 fps becomes 15. Add minterpolate=fps=30:mi_mode=mci to build the missing frames, at a much higher render time.
Can atempo go above 2?
Yes, ffmpeg 8.1 accepts 0.5 to 100, but above 2 it skips samples. Chain filters instead, like atempo=2.0,atempo=2.0 for 4x.
How do I make a timelapse with ffmpeg?
Use -vf setpts=PTS/8,fps=30 -an for 8x. Our 10-second clip became just over a second.
- Reverse a video with ffmpegPlay a clip backwards with reverse and areverse, keep memory down on long clips, and make a boomerang loop.
- Change the frame rate with ffmpegConvert a video to 24, 30 or 60 fps with the fps filter, see how -r differs, and make smooth 60 fps with minterpolate.
- Loop a video with ffmpegRepeat a clip a set number of times or to a length with -stream_loop, without re-encoding, or with the loop filter inside a graph.
- ffmpeg -filter_complex explainedLabels, commas and semicolons: how a filtergraph wires inputs to outputs, with four working graphs and the errors they fix.
- Trim a video with ffmpegCut a clip with -ss and -to: frame-exact with a re-encode, fast with -c copy, and why the copy starts before your time.
- Video to GIF with ffmpegMake a clean GIF from a video with palettegen and paletteuse, then shrink it with frame rate, size, colours or a different format.
- FFmpeg onlineRun your own ffmpeg command on your files in the browser, free and without installing or uploading anything.
- ffmpeg exited with code 1: Conversion failed!fluent-ffmpeg reports only ffmpeg's exit code and last line. The real cause is in stderr: print it, or use -v error to see it alone.
- ReelSDK vs self-hosted FFmpegTranscoding a minute of 1080p to 720p takes about 24 seconds of compute: about 0.8 cents on ReelSDK, about a tenth of a cent on a busy 4 vCPU box. Below about 11,000 minutes a month, the API costs less than an always-on box.
Sources, checked November 2026
Ready to build?
Ship video from your app today
Your first $0.50 is free, and one key covers every endpoint.
