Speed Up Video with FFmpeg Frame Interpolation
This guide demonstrates how to speed up a video in FFmpeg while
maintaining smooth, fluid motion using frame interpolation. When you
simply accelerate a video, the motion often becomes choppy because
frames are dropped; however, by combining video speed adjustments with
FFmpeg’s motion interpolation filter (minterpolate), you
can generate seamless transitions and maintain a high frame rate.
The Core FFmpeg Command
To speed up a video and interpolate the missing frames, you must
combine the setpts filter (which alters video speed) with
the minterpolate filter (which generates the smooth,
intermediate frames).
Use the following command to double the speed (2x) of a video and output a smooth 60 frames per second (fps) result:
ffmpeg -i input.mp4 -vf "setpts=0.5*PTS,minterpolate=fps=60:mi_mode=mci:mc_mode=aobmc:vsbmc=1" -an output.mp4Parameter Breakdown
setpts=0.5*PTS: This speeds up the video playback. Multiplying the Presentation Timestamp (PTS) by0.5doubles the speed. To speed up a video by 4x, you would use0.25*PTS.minterpolate: This activates the motion interpolation engine.fps=60: This defines the desired output frame rate. A higher frame rate like 60 fps allows the interpolation filter to insert enough generated frames to make the accelerated motion look perfectly smooth.mi_mode=mci: Sets the motion interpolation mode to “Motion Compensated Interpolation.” This is the key setting that analyzes pixel movement between frames to estimate and draw entirely new, transitional frames.mc_mode=aobmc: Uses Advanced Overlapped Block Motion Compensation. This reduces visual warping and blocky artifacts around moving objects.-an: Disables audio. Because speeding up video desynchronizes it from the original audio track, removing the audio is often necessary.
Adjusting Audio Speed (Optional)
If you want to keep the audio and speed it up to match the 2x video,
replace the -an flag with the audio tempo filter
(atempo):
ffmpeg -i input.mp4 -vf "setpts=0.5*PTS,minterpolate=fps=60:mi_mode=mci" -af "atempo=2.0" output.mp4Performance Consideration
Motion compensated interpolation (mi_mode=mci) is highly
CPU-intensive and can take a significant amount of time to render. If
the render times are too slow for your project, you can change the mode
to mi_mode=blend. This blends adjacent frames together
rather than calculating motion vectors, which renders much faster but
results in a slightly ghosted, motion-blurred look rather than true
motion estimation.