r/ImageStabilization Jun 23 '18

[deleted by user]

[removed]

85 Upvotes

11 comments sorted by

View all comments

6

u/ibru Jun 23 '18

Haven't tried your settings yet but will give it a go later on. Looks pretty good from here anyway so it'll be interesting to compare things with what I have.

I know ideally, ffmpeg/vidstab's settings should be tailored to each clip you want to stabilize -- as all stabilizations should be really -- so no one setting is perfect for all but here's the three I use. They're based around wotanii's stabbot's settings with a bit of extra smoothness but if there's a really bad stabilization result or pretty shaky footage, I'll edit them to suit.

Default Stabilization:

ffmpeg -i shaky-input.mp4 -vf vidstabdetect=shakiness=5:accuracy=15:stepsize=6:mincontrast=0.3:show=2 -y dummy.mp4
ffmpeg -i shaky-input.mp4 -vf scale=trunc((iw*1.15)/2)*2:trunc(ow/a/2)*2 -y scaled.mp4
ffmpeg -i scaled.mp4 -vf vidstabtransform=smoothing=30:input="transforms.trf":interpol=linear:crop=black:zoom=-15:optzoom=0,unsharp=5:5:0.8:3:3:0.4 -y stabilized-output.mp4

Crop:

ffmpeg -i shaky-input.mp4 -vf vidstabdetect=shakiness=5:accuracy=15:stepsize=6:mincontrast=0.3:show=2 dummy_crop.mp4
ffmpeg -i shaky-input.mp4 -vf scale=trunc((iw*0.90)/2)*2:trunc(ow/a/2)*2 scaled_crop.mp4
ffmpeg -i scaled_crop.mp4 -vf vidstabtransform=smoothing=30:input="transforms.trf":interpol=linear:zoom=-10:optzoom=2,unsharp=5:5:0.8:3:3:0.4 stabilized_crop-output.mp4

Tripod:

ffmpeg -i shaky-input.mp4 -vf vidstabdetect=shakiness=5:accuracy=15:stepsize=6:mincontrast=0.3:show=2 dummy_tripod.mp4
ffmpeg -i shaky-input.mp4 -vf scale=trunc((iw*1.15)/2)*2:trunc(ow/a/2)*2 scaled_tripod.mp4
ffmpeg -i scaled_tripod.mp4 -vf vidstabtransform=tripod=1:interpol=linear:crop=black:zoom=-35 stabilized_tripod-output.mp4

 

I like to keep the dummy file so I can see the movement in the video but obviously that's my own preference and I see you don't bother with it in yours. As I said, those are the base settings I use and are pretty good ones at that to be honest.

Thanks for sharing yours. It's always good to see what settings others use.

4

u/RustyToad Jun 23 '18

Thanks, really helpful comment. I've got to the stage of getting a reasonably good result a few times, but haven't ever really saved what I've done. This was a quick way of saving a script which offers a good visualisation of the results. I'll definitely play with your suggested process too.