Thursday 12 July 2007

Comparing video encoding

[Edit - it's not a big deal but looking more carefully at the MOV files from my camera the audio quality is very low - turns out to be 8Khz, 8bit uncompressed. Selecting this for the encoding does knock a small bit of the file size. Since you're not gaining anything by encoding any higher than this. But we're only talking about 120k on a file this size. It would of course me more significant on a longer clip ... And if we're encoding a DV capture - you would want to encode the audio at a decent quality. So I'd tend to leave eveything as is - at least then you can use the same settings for all your encodings (although be careful if you change the size - with the WME settings I've used it won't matter, but with the others you'll have to up the video bitrate a bit.]

Most of the stuff on the web talks about encoding DVD's to divX or xVID. But often I'm just trying to encode video for the web. Sites like the ones I've talked about earlier.

It's difficult to make a choice on the best codecs and settings to use. Of course you can just upload the files as they are if they are from your digital camera - although they may be a little big and for sites that don't convert them they may not stream properly. (Eg my camera takes Quicktime movies - but they aren't enabled for streaming no Hinted Streaming. So if you share them on the web, the whole file is downloaded before they play).

Plus I often capture some DV footage off my camcorder and want to make a clip to share with friends and family. So I decided to do some very un-scientific tests! It's quite difficult to do this keeping all factors the same - for example video / audio bitrate, key frame interval and audio quality, but it's gives me a rough idea. Of course then's there system compatability factors - whether it'll play on Mac's, whether you need to download an additional codec etc etc.

I'm using a Quicktime file off my digital camera which is 15s long. The original file is 640x480 and 15MB. Pretty large for a 15s clip I think you'll agree! First off I'm using Quicktime Pro 6.5 to transcode it to something smaller. For all the clips I'm aiming to end up with a 2MB file which equates to around 1Mbps bitrate.

So in Quicktime I tried a few setting and ended up with selecting ExportMovie to Quicktime MovieUse LAN and then changing the size to 480x360:

Then I tried encoding to Flash using Riva FLV Encoder with these settings:

And finally I tried Windows Encoder. Unfortunately it wouldn't take Quicktime files so I used Quicktime to save the file to an uncompressed AVI and then loaded into Windows Encoder. As I've mentioned earlier it's a powerful tool with lots of settings. I played around and found these to be the most favourable settings and gave a file of 2MB as required too:

The easiest way to set the encoder up is to use the wizard and select "convert a file". Then select the file you want to encode. Then the only tab you need to change is in "properties" and choose the settings as above. You can then save the session and just change the input file as need be from then on. I use the profile editor (installed with Windows Encoder) to make a profile that I just load in via editimport on that compression tab.

To see how it all turned out see the link below:

http://blip.tv/file/300616
(select the various encodings from the drop down box below the video - including the 15MB source file.)

They is a difference between all the streams. Personally I think the Flash encoding looks the worst with some horrible blocking when there's any movement. But the image does look quite clean and sharp. Next up for me is the Quicktime file. It's pretty good - but it does require having Quicktime Pro (around $30 when I bought it). But I think the quality of the Windows Media Encoding is the best. No noteable artifacts - very nice.

However, everything comes at a price. Windows Media Encoder is free but doesn't accept Quicktime files. You need to uncompress them. If you don't have Quicktime Pro you can use the free Rad Video Tools to de-compress the file and then load it into WME. Plus the encoding took 40s for a 15s clip on my PC (Athlon 3000, 1GB RAM). Quicktime is quite nice and easy to use for this clip - but also pretty slow - also 40s. The quickest by a long stretch is Flash encoding - at 8s!!

And then there's the audience viewing your creations - I happen to know most people I send clips of family to have Windows PC's and therefore my encoder of choice is WME. But I'd probably always try to include a Flash encoding too to be safe. Using something like Blip.tv - it's very easy to have mutliple version. And I could have just uploaded the source file and let it encode the Flash file for me. As I've mentioned though - none of the video sharing sites I could find had decent privacy settings to unfortunately I will have to continue to encode my files myself for Adobe Photo Showcase that I'm using for now ...

No comments: