Skip to content

Instantly share code, notes, and snippets.

Forked from maxogden/
Created Dec 20, 2015
What would you like to do?
Video stabilization using VidStab and FFMPEG (Mac OS X)

Video stabilization using VidStab and FFMPEG

Examples here use the default settings, see the VidStab readme on GitHub for more advanced instructions.

Install ffmpeg with the vidstab plugin from homebrew

brew install ffmpeg --with-libvidstab

Analyze your video to create a .trf file

This won't modify your video or create a new video, but it should create a new file called transform.trf

ffmpeg -i -vf vidstabdetect -f null -

Use the .trf file to create a stabilized video

ffmpeg -i -vf vidstabtransform=smoothing=5:input="transforms.trf"

This should create a new stabilized video called

Bonus: create a side by side comparison video

Found on a forum here

ffmpeg -i -i -filter_complex "[0:v:0]pad=iw*2:ih[bg]; [bg][1:v:0]overlay=w"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment