Way back in Dec 2015, @maxogden wrote a nice guide on stabilizing your own video with ffmpeg. I return to it on occasion and have updated my gist comment to offer some updated commands. Since enough has changed regarding installation and use, I figure a new, spiffy, and working guide deserves a non-gist home.
Presenting the 2021-era guide to pretty easy DIY video stabilization!
On Mac OS, install ffmpeg
and vidstab
from homebrew:
1 2 |
|
On linux, you can sudo make install
.
Run stabilization in two passes
There are plenty of options for libvidstab, like shakiness
, accuracy
, smoothing
. The defaults are good, but you may want to experiment. There’s even a visual diagnostic mode.
Assuming the source video is named clip.mkv
…
1 2 3 4 5 6 |
|
You now have a clip-stabilized.mkv
!
Bonus: create a comparison video
Use the vstack
or hstack
filter, depending on if you want them stacked vertically or side-by-side:
1 2 3 4 5 |
|
Double bonus: A two-liner that does everything (because repeating these filenames gets annoying)
1 2 |
|