Travel

All Free Stuff – Video Stabilisation

My experience with trying to get really good video quality has pretty much made this apparent: make it as stable as you can when you shoot it. Shaky video is going to have issues even after you ‘stabilise’ it, because there’s some things you simply can’t fix yet with software.

One of these issues is ‘rolling shutter’. You see it here, in this video:

…at around 30 seconds, where the video appears to wobble and shake – and this is after de-shaking. Well, we’re talking ‘shot while landing’ in Queenstown, NZ, and the aircraft was none too steady, but yeah, ffmpeg had issues with this shot.

So, stabilising video is a two-step process. It involves an analysis scan, then the conversion process. Here are the commands I use:

ffmpeg -i a017di.mov -vf vidstabdetect=stepsize=6:shakiness=6:accuracy=9:result=transform_vectors.trf -f null -

and

ffmpeg -i a017di.mov -vf vidstabtransform=input=transform_vectors.trf:zoom=1:smoothing=30,unsharp=5:5:0.8:3:3:0.4 -vcodec libx264 -preset slow -tune film -crf 18 -acodec copy a017dis.mov

I failed to explain my naming conventions — prefixes and suffixes attached to the name, so I sort-of can tell what I’d done to a video just by the name. The .MTS becomes an .mov… and the naming breakdown is thus:

* ‘a’ – for first go, ‘b = second go, and so forth
* ‘017’ – the number of the video itself, taken from the original name
* ‘di’ – de-interlaced
* ‘s’ – stabilised (I only do this if the video needs it)
* ‘A’, ‘B’, ‘C’ and so forth – a clip (portion) of a fairly long shot

So far, this seems to work. By-the-way, I tend to highlight bash commands in tutorials in the browser, copy and paste them into terminal (bash) and then run the command (press [Enter]). All SO much easier than typing the whole thing out, and less prone to error.

Here is de-interlacing footage of a hike we did on Mou Waho, an island on Lake Wanaka: