Footage stabilization with Vegas

There is currently no stabilization plugin for Vegas Platinum since the only third party plugin that used to be available from BorisFX was discontinued a few weeks ago, while Deshaker/Mercalli only work with the Pro version of Vegas. So I decided to write this little Deshaker/VirtualDub tutorial to show you how to stabilize your footage, especially if you are running Vegas Platinum.

Update: Below, I’m suggesting the Lagarith codec, but you can try instead the new Matrox MPEG-2 AVI intermediate codec.

Vegas Pro

For Vegas Pro you simply have to install “New Deshaker” script. Install the New Deshaker .msi or .zip file (choose one of the two, files are to be installed on the Vegas Pro’s “Scripts” folder if you choose the .zip file), and the VirtualDub package also from the same page.

Then, install the 32bit version of the Lagarith codec from here. If you are running a 64bit version of Vegas, install both the 32bit and the 64bit version of Lagarith, otherwise, just the 32bit version (regardless if your Windows is 32bit or 64bit).

Load Vegas, load the file you want to stabilize, setup the right project properties (this is important, follow step 1 from this tutorial). Place the file in the timeline. Click “Render As” from the main menu, select the AVI filetype, and then click “custom” to make everything look similar to this (depends on what footage you used. Also, ignore the project properties step, since we did that above). Then, give a new name to that tweaked template, e.g. “Lagarith”, and then click the save icon in that “Custom Template” dialog. From now on, you can reuse that template directly.

Discard the “Render As” screens, save the whole Vegas project and give it a name. Now select the clip in the timeline, and select the New Deshaker option from Tools/Scripting. In the new window that’s loading, make sure the paths to VirtualDub/Deshaker are correct (for 64bit operating systems you might need to tweak them), set a “render to” path (e.g. c:\videos\myVegasProject\temp\), and select the “Lagarith” template we just created above in the “Outbound Template”. Then, in the “VirtualDub Compressor” option, delete the “0” there, and type: “lags” (without quotes). Then, “Save settings” in the bottom of the New Deshaker window, and then select “Start”.

The script will now start stabilizing your video, it might take 3 to 8 minutes to stabilize just 10 seconds of footage depending on the speed of your CPU, so use this ability wisely. After it’s all done, the new stabilized video will be inserted as a new “Take” on top of the existing clip in the timeline. By pressing the “T” key on the keyboard, while the clip is selected in the timeline, is going to interchange the take between the original file and the stabilized one.

Please note that the new stabilized take, which uses the Lagarith codec, will be slow to edit, this is to be expected. Unfortunately, there is no freeware AVI intermediate lossless codec that’s fast to decode, so Lagarith is your best option. The filesize is going to be big as well (~2 GBs per minute), as it’s true for any intermediate lossless codec.

Also, if you find that a Vegas Pro process still running on your Windows after you have closed down Vegas, then you must kill that process using the Windows task manager (New Deshaker doesn’t always clean up after itself).

Finally, in the New Deshaker dialog, you can create a new template instead of the “Default” one, to optimize the stabilization even more. For example, in the “Pass 1” tab you can change “Half” to “Full”, and “Every 4th” to “All”. Doing these changes will add more stabilization into the video, but it will also make the calculation process 4-5 times slower (and don’t forget that it’s already slow).

Vegas Platinum

Install this. Then, install the 32bit version of the Lagarith codec from here.

Load Vegas, load the file you want to stabilize, setup the right project properties (this is important, follow step 1 from this tutorial). Place the file in the timeline. Click “Render As” from the main menu, select the AVI filetype, and then click “custom” to make everything look similar to this (depends on what footage you used. Also, ignore the project properties step, since we did that above). Then, give a new name to that tweaked template, e.g. “Lagarith”, and then click the save icon in that “Custom Template” dialog. From now on, you can reuse that template directly. Now, from the main “Render As” dialog, render out the file.

Load the VirtualDub.exe application from its “Program Files” folder (navigate there with Windows Explorer). Select “File”, and “Open Video File”. Load in it the .avi file you just rendered above. *If* your VirtualDub is freezing while loading any AVI file and it shows just black screens, then you need to go to its Preferences panel and select OpenGL for output, and VSync (at least, this fixed the issue for me). Anyways, when the AVI file is loaded on VirtualDub, click on “Video” from the main menu, then “Compression”, and from the long list that pops up, find the “Lagarith lossless codec” and select it. Click “Ok” to that dialog.

Then, from “Video” again, select “Filters”. Click “Add”, scroll and select “Deshaker 2.4”, then click “ok”. Select the “Deshaker” entry in the Filters dialog and click “Configure”. Set the “Source Pixel Aspect” the same way as it’s on your Vegas’ project properties (e.g. for HDV it’s 1.333, for most AVCHD it’s 1.0). For “Video Type” select “Interlaced, upper field first”, provided your video is HD and was shot interlaced (if unsure, then again consult Vegas’ Project Properties as you are supposed to have the right properties). Finally, click on the big “Pass 1” button. Then, click “ok” and “ok” again.

Now, click the “play” button on the VirtualDub icon bar on the bottom of its window. Make sure you click the play button that has the little “o” in it, not the one with the “i”. It will now apply the Pass 1 of Deshaker, have patience.

When it’s done, select again Video/Filters, and select the Deshaker plugin, and then click “Configure” again. Then, select the “Pass 2” big button. Click “ok” twice again. Now, click on “File”, and “Save as AVI”, give it a filename. It will now export the stabilized video in the Lagarith AVI format.

The new stabilized file is now ready to be edited on Vegas in your main project, so bring it in! *If* Vegas recognizes the stabilized file as 4:3 instead of widescreen, then while it is still in the “media bin” holding area of Vegas, right click on it, “Properties”, and from the “Video” tab set its aspect ratio to 1.3333 instead of 1.000. You can even tell Vegas to remember that setup for that specific video format, by clicking the little “save” icon in that dialog.

Please note that the new stabilized version, which uses the Lagarith codec, will be slow to edit, this is to be expected. Unfortunately, there is no freeware AVI intermediate lossless codec that’s fast to decode, so Lagarith is your best option. The filesize is going to be big as well (~2 GBs per minute), as it’s true for any intermediate lossless codec.

Finally, in the Deshaker configuration dialog inside VirtualDub, you can optimize the stabilization even more. For example, in the “Pass 1” tab you can change “Half” to “Full”, and “Every 4th” to “All”. Doing these changes will add more stabilization into the video, but it will also make the calculation process 4-5 times slower (don’t forget that it’s already slow).

5 Comments »

Einar Ritsmer wrote on August 2nd, 2009 at 11:18 PM PST:

In the cases where you do not need to apply Pan/Crop or FX to the media – and when your final format is one that Vegas can render without recompression (last Vegas Pro manual page 337) – then you can skip the Lagarith step and let New Deshaker render directly to your final output format.


This is the admin speaking...
Eugenia wrote on August 2nd, 2009 at 11:30 PM PST:

This is actually a very rare case, it assumes that people won’t use any FX/Pan/Crop, and also that Vegas can export without re-compression to the desired output format, which is not always the case. Especially if the user is exporting for the web in 720p MP4 (resized), for example, which is usually the case for my readers.


Eddie B wrote on August 4th, 2009 at 11:19 AM PST:

Does Deshaker work with 24p Advanced? I saw an older post on DVXUser that suggested it didn’t.


This is the admin speaking...
Eugenia wrote on August 4th, 2009 at 11:46 AM PST:

If you removed pulldown and it’s TRUE 24p, then yes, it would.


Jorge wrote on August 7th, 2009 at 11:32 AM PST:

Thanks again!!!


Comments are closed as this blog post is now archived.

Lines, paragraphs break automatically. HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

The URI to TrackBack this blog entry is this. And here is the RSS 2.0 for comments on this post.