<< back to index

Stabilize video in Ubuntu Linux

I own a Flip Mino HD pocket video camera. The video quality is really amazing. I find it unbelievable that it's 5 times cheaper than our old 8mm video camera, uses no tapes, no cables, no charger. Nothing, but the camera itself. But it does have one problem: the camera is so light that it's hard to hold it stable, so if you are not using a tripod the result is probably shaky. One year ago I tested a popular program that corrects shaky video: Deshaker. But it's only available for Windows. After some research I found vid.stab. I tested it once with the default settings and the result is already much better than the original (see above).

Update: See this tutorial to make it even easier by adding a right click menu option to stabilize your videos.

How to use vid.stab under Ubuntu?

Vid.stab is a plugin for Transcode. To get it running:

    + Go to the Ubuntu Software Center, find and install Transcode. The current version (September 2010) already comes with the stabilization plug in, BUT it didn't work for me. When I tried using it it complained about "unsupported codec" all the time. Try it. Maybe your version already works. Skip to step 5 and if you get the error, go back to step 2. + Visit the vid.stab download page and download the latest plug in binary. Currently called "Version 0.75, binary files (linux 32bit i586), works with 1.1.X". This is a packed .tgz file that contains the plug in (filterstabilize.so and filter_transform.so). + Unpack the plug in: you can double click the .tgz file, double click the stabilize folder, then drag the two .so files to the Desktop. + Open a terminal and move filter_stabilize.so and filter_transform.so from the desktop into /usr/lib/transcode/ overwriting the files with the same names. Type something like: sudo mv /home/YOURUSER/Desktop/filter* /usr/lib/transcode/ (where YOURUSER is your Linux user name). + Ready to try it out: cd into the directory where your videos are located: cd /home/YOURUSER/Desktop/MYVIDEOS/ + Type transcode -J stabilize -i YOURSHAKYVIDEO.mp4 (this will analyze the shakiness). + Type transcode -J transform -i YOURSHAKYVIDEO.mp4 -y xvid -o STABLEVIDEO (this will correct the shakiness).
Now you should have a much less shaky video called STABLEVIDEO in xvid format. For information about the command line options visit the Stabilize plug in web page and the Transcode web site. You can improve results by adjusting the amount of shakiness distance and duration. When will we get this kind of stability? :)