FFmpeg framerate Filter: Convert FPS with Blending
The FFmpeg framerate filter allows you to alter a
video’s frame rate by generating intermediate frames through temporal
blending rather than simply duplicating or dropping frames. Unlike basic
frame rate changers, it features built-in scene change detection that
prevents cross-fade artifacts across shot transitions. This guide
explains how the framerate filter works, details its
primary parameters, and provides practical FFmpeg commands for achieving
smooth frame rate conversion.
How the framerate
Filter Works
When converting video from one frame rate to another (for example,
from 24 fps to 60 fps), standard filters like -r or
fps repeat or drop entire frames, which can introduce
stutter or judder.
The framerate filter solves this by:
- Linear Blending: Creating intermediate frames by blending adjacent frames according to configurable interpolation windows.
- Scene Detection: Monitoring pixel variation between consecutive frames. If a transition exceeds a specified threshold, the filter marks it as a scene change and disables blending for that transition, preventing "ghosting" between unrelated scenes.
Key Filter Parameters
The framerate filter accepts several parameters
configured in a key=value format:
fps: The target output frame rate. Can be specified as an integer (e.g.,60), float (e.g.,29.97), or rational expression (e.g.,30000/1001). Default is50.scene: The scene change detection threshold as a percentage (from0.0to100.0). A frame difference higher than this value is treated as a cut. Default is8.2. Lower values make the filter more sensitive to scene changes.interp_start: The point within the transition window (from0to255) where blending begins. Default is15.interp_end: The point within the transition window (from0to255) where blending ends. Default is240.flags: Processing flags. You can setflags=scenecdto use scene change detection (enabled by default).
Basic Syntax
To perform a basic conversion, pass the filter into the
-vf (video filter) argument:
ffmpeg -i input.mp4 -vf "framerate=fps=60" -c:a copy output.mp4This command takes input.mp4, uses the default blending
and scene change settings, and outputs a 60 fps video to
output.mp4 while copying the audio stream without
re-encoding.
Adjusting Scene Change Sensitivity
If you notice ghosting across cuts, decrease the scene
threshold to make the detection more aggressive. If rapid motion inside
the same scene is mistakenly triggering scene cuts (preventing smooth
blending), increase the value.
ffmpeg -i input.mp4 -vf "framerate=fps=60:scene=6.0" -c:v libx264 -crf 18 -c:a copy output.mp4In this command:
fps=60: Outputs at 60 frames per second.scene=6.0: Decreases the detection threshold from the default8.2to6.0, ensuring sharper cuts are respected.-c:v libx264 -crf 18: Encodes the output with high visual quality using H.264.
Fine-Tuning Blending Behavior
The interp_start and interp_end parameters
dictate the weight of the blend. By default, values below
15 show only the previous frame, and values above
240 show only the next frame, avoiding excessive blur when
motion is minimal.
To create wider blending transitions across intermediate frames:
ffmpeg -i input.mp4 -vf "framerate=fps=59.94:interp_start=0:interp_end=255:scene=8.0" -c:v libx264 -preset slow -crf 20 -c:a copy output.mp4interp_start=0andinterp_end=255enforce full-range interpolation, ensuring every newly generated frame is a composite blend of its surrounding frames.