Search This Blog

Monday, April 10, 2006

Why the AVI?

So, I've had a couple people question (well, okay, it wasn't really 'questioning'...) my choice of video file formats. For those too lazy to look, the format I ultimately decided on was Microsoft MPEG-4 v2 video and MPEG Layer-3 audio in an AVI package. This was actually the product of quite a bit of research.

Being the compatability nut that I am, I first and foremost wanted a single format that both Windows and OS X could play out of the box. I looked at the list for Windows XP, the Windows Media Codecs Download Package 8.0, QuickTime, and this page. A few different possibilities showed up. Of the possibilities, MP3 was the obvious choice for audio.

For video, the choices are much more limited. QuickTime supports a fair variety of formats, but not that many than Windows XP also supports. By far the best option of the video codecs was ISO MPEG-4, supposedly supported by both. However, trying this out produced a rather ugly bug in the Windows ISO MPEG-4 codec - the codec only works when running as an administrator. I don't know the exact reason for this, but I suspect it has something to do with accessing restricted registry keys. In any case, ISO MPEG-4 was out. Failing that, I tried Microsoft Video 1; this proved far too poor quality to consider using. It was about this point when I realized that I wasn't going to find a single perfect format that works on both out of the box.

So, I applied a bit of market logic to the problem. Windows has something like 90% market share, OS X less than 5%, and Linux less than 5% as well. That made the decision pretty easy: whatever format I used had to work in Windows out of the box. I did some asking around, and found out about Windows Media Components for QuickTime. This seemed like the best available solution to the problem - run on 90% of computers out of the box, make the other 5% download a plug-in to work with the format.

Once this was decided, MS MPEG-4 became the obvious choice for the video codec. I would have used version 3, but the encoder I'm using - mencoder (with the libavcodec library) - doesn't support this.

The choice of container was semi-arbitrary. My first choice was the MP4 container, but Windows can't play that out of the box. So, I went with the old, reliable AVI.

So, that's the story; not a whole lot to it.

1 comment:

Anonymous said...

MPEG-4 is a pretty good format. Great choice. Again, simple math. Optimize the scenario for the 90% case. This means providing the best video at the greatest convenience for windows. It may hurt the OS-X and Linux folks to hear that, but it is true - they are still a niche market. And as I understand it - there is no problem playing MS Mpeg-4 out of the box on Linux.

- Cameron (aka Merlin)