For footage with an odd or variable frame rate (screen recordings, web video, phone clips): minterpolate synthesizes frames at exactly 29.97 fps instead of dropping or duplicating them, so motion stays smooth. Also crops a 640×480 window from the center of a larger frame.
The command
ffmpeg -i input.mp4 \
-vf "crop=640:480,minterpolate=fps=29.97:scd=none,setpts=N/(29.97*TB)" \
-r 29.97 \
-c:a aac -b:a 128k \
-c:v libx264 -crf 21 -preset veryfast -pix_fmt yuv420p \
output.mp4 What each part does
crop=640:480 keep the centered 640×480 (input must be at least
that size)
minterpolate=fps=29.97:scd=none
resample to 29.97 fps with interpolated frames
setpts=N/(29.97*TB) evenly restamp frames, keeping the original speed
-r 29.97 constant 29.97 fps output
-c:a aac -b:a 128k -c:v libx264 -crf 21 -preset veryfast -pix_fmt yuv420p When to use it
Useful when a clip has an odd or variable frame rate (screen recordings, web video, phone clips) and you need a steady 29.97 fps file that plays at its original speed. Instead of dropping or repeating frames, it synthesizes new ones, so motion stays smooth. The header explains each flag.
Skip it if you want slow motion. Use minterpolate-slowmo-with-audio.sh instead. Interpolation is slow to render, so it is also overkill for footage that already has a clean, constant rate.
Variations:
- Change the target rate by editing 29.97 in all three places (minterpolate, setpts,
-r) so they agree. - Change the crop size (640:480), keeping it no larger than the input.
- Raise or lower
-crf 21to trade file size for quality.
If the output looks wrong, check these:
An error at the crop step usually means the input is smaller than 640×480. Warped frames around fast motion come from interpolation. Smeared frames at hard cuts happen because scene-change detection is off (scd=none), so cuts get blended. To see how interpolation choices compare, try minterpolate-mode-comparison.sh.
Notes
- Source
- ffmpeg-utilities/videogrep.sh (the hrdst command)
- Changed
- -filter_complex → -vf (single-input chain)