Wednesday, November 29, 2006

Rotating videos the Virtual Dub way

As mentioned I need to rotate some videos, neither the software provided by Microsoft or Canon seem to want to do this. I suspect they're still caught up with the old model - cameras that take movies are designed to be held in only one way so it's not a problem. Of course with smaller cameras and even camera phones now able to take movies, more and more people will be finding out just how difficult it is to rotate a movie, but here's a solution.

It's called VirtualDub, it's free and it works. It is however not that user friendly, especially to the pampered Windows crowd, who upon visiting the page will no doubt try to download the source code and wonder why it doesn't work. Four pages later and you'll find a zip file which you can simply decompress (ie open and copy) into a new folder you'll need to create. Then run "virtualdub" yep no installer, no creation of little icons into the Program Menu, this is old-school stuff.

Once you've got it running Use File|Open video file and find the video you want to rotate

You'll be looking at two screens showing apparently identical still images, the one on your left is the input (or source) the one on the right the output. First things first we want to rotate them. Select Video|Filters and you'll get a blank pop-up box, it's blank because you haven't added anything yet. So select Add and you'll get another pop-up box with a list of filters,the one you want is rotate, click that and select OK pick which way you want to rotate it and select OK again. You now have one filter showing up. Select OK don't worry if it looks all stretched, click the Play icon with the O for Output and the video will start playing and should snap the correct way round. If you've got the rotation wrong, go back to Video|Filters pick the filter and then Configure and change it.

Now it gets tricky. By default the output video will be uncompressed this is bad filesize-wise nobody wants to turn a 100Mb file into a 1000Mb file for uploading, so you need to pick how you want to compress it.

Compression is separated into two parts video and audio, audio is normally a piece of cake, most of the time you don't want to change it so you can leave it as Audio|Source Audio and Audio|Direct stream copy, this will leave it exactly as is.

Now for video compression, which is trickier. To do this you use what is known as a codec, think of them in the same way as fonts, if someone else doesn't have it then they can't see what you can see, however there are some standard ones around. If you're doing this just for yourself then of course you can pick any of the ones you've got, if you want to send it to others or upload it then your get a shorter list of choices.

Okay let's go for it Select Video|Compression and look at the list, by default you'll have the top one selected - that's the uncompressed version, advantages - it'll work anywhere; disadvantages it'll output a huge file. The two that are most likely to appear are Intel Indeo(R) Video R3.2 and Microsoft Video 1, as to which is best that's a matter of experimentation.

Pick one and you'll get some extra compression options, ignore them for the time being just select OK. Almost time to output your video, select File|Run video pass analysis. This'll tell you how large the output file is going to be without actually dumping a huge file onto your hard drive; what you're looking at is Projected file size, sadly this box will disappear when finished so you need to keep an eye on it. If that looks okay then we'll go to the next step, otherwise go back and alter the compression settings (higher compression = smaller size = lower quality). I'm currently uploading one done with 75% Microsoft Video 1, which increased the original video from 50Mb to 70Mb without any noticeable deterioration.

Final step File|Output to AVI select a name (I normally add "a" to the original filename) make sure you're not about to overwrite the original and select OK... now wait.

Use My Computer to find the folder you saved to and you should now have a new movie file, open it up and take a gander, if the quality is poor then you can change the compression or pick another codec as detailed above and try again. Once you've got something at a size and quality you like select File|Save processing settings pick a location you can find again and hit OK, if you need to do this rotation again in future select File|Load processing settings pick the file you've saved and you won't need to do all this fiddling around again.

Done and dusted.