Stabilize Shaky Video with FFmpeg (vidstab)

Two-pass command to analyze camera shake and smooth it out of your footage.

WindowsvideostabilizationffmpegLow risk
Run vidstabdetect first to write transforms.trf, then vidstabtransform to render the smoothed video.

01Command

Command
$ ffmpeg -i shaky.mp4 -vf vidstabdetect=shakiness=5:accuracy=15 -f null -
ffmpeg -i shaky.mp4 -vf vidstabtransform=smoothing=20:input="transforms.trf" -c:a copy stable.mp4

02What it does

Stabilization works in two passes: vidstabdetect analyzes motion frame by frame and saves it to transforms.trf, then vidstabtransform applies a smoothed counter-motion to produce the stable video. Higher shakiness (1–10) catches stronger shake; smoothing controls how aggressively motion is damped. Audio is copied untouched with -c:a copy.

03Risk

RiskLow risk
RequirementsFFmpeg is not preinstalled on Windows — install it first with: winget install --id Gyan.FFmpeg
!Warning: Heavy stabilization crops in and can produce wobbly edges — lower smoothing or increase optzoom settings if the result looks distorted.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

Last verified: 2026-09-18 · Category: Media