Stabilizer – a tool to stabilize shaky videos

Friday, March 16, 2018 @ 5:37 pm

I’ve created a simple tool to stabilize shaky videos using ffmpeg and the VidStab filter.

Download (13mb) for Windows (64-bit – recommended)

Download (12mb) for Windows (32-bit – if your computer does not support 64-bit)

Once downloaded, simply run Stabilizer.exe, select a video you want to stabilize, select where you want the stabilized video to be saved, and then click on Go.

As shown above, you can also choose to have comparison videos generated: a left-right comparison (left = original; right = stabilized) and/or top-bottom comparison (top = original; bottom = stabilized).

There is also a Preset dropdown: in general, slower is better so select “veryslow” for the best results if you can afford to wait (more info on ffmpeg presets).

Not my video, but here is an example of what a left-right comparison video would look like:

(Note: YouTube does offer a feature that will stabilize videos for you, but it’s always good to have options!)

Behind the Scenes

My tool is actually just a front-end for ffmpeg and semi-automates the process for you.

If you are not on Windows or wish to customize the process, you can download a static build of ffmpeg for Windows/Mac or Linux (which were compiled with VidStab included) and run the following commands.

Analyze and Stabilize Video

./ffmpeg -i "input.mp4" -vf vidstabdetect=stepsize=32:shakiness=10:accuracy=15:result="transforms.trf" -f null -
./ffmpeg -i "input.mp4" -vf vidstabtransform=input="transforms.trf":zoom=0:smoothing=10,unsharp=5:5:0.8:3:3:0.4 -vcodec libx264 -tune film -acodec copy -preset medium "stabilized.mp4"

(documentation on VidStab’s parameters and options)

Generate Comparison Videos

Assuming you ran the above commands, you can create comparison videos:

Horizontal (left-right)

./ffmpeg -i "input.mp4" -i "stabilized.mp4" -filter_complex hstack "comparison-lr.mp4"

Vertical (top-bottom)

./ffmpeg -i "input.mp4" -i "stabilized.mp4" -filter_complex vstack "comparison-tb.mp4"