Thoughts of a multimedia madman

Monday, November 27, 2006

New job

Hello world, long time no blog post :-)

I've been quite busy since September however I've recently landed myself a new job in a slightly different industry. I will now be developing the software for Freeview boxes it will be quite a change working on hardware rather than software and it might change my perspective on media PCs compared against consumer electronics. I'll try and blog a bit more in the near future :-)

Tuesday, September 05, 2006

Relight my blog

Hello world, if you actually follow this blog you may have noticed it’s been rather quiet recently this is because RealLife™ has taken over and prevented me from having the time to contribute new content. Since the last blog post I’ve gotten married, gone on my honeymoon and completed another commercial product. Unfortunately my blog could be quiet for a while as I’m going to continue to be rather busy however I hope to bring you some exciting developments in the next couple of months and also cover a few more topics that seem to be lacking much information on the net.

Friday, July 21, 2006

Why Theora and Dirac matter

If you’re a small multimedia developer who uses video in your product then you’ve probably been through the dilemma of trying to pick a suitable video codec for your project. For those who haven’t if you think this is an easy process and that some flavour of MPEG4 such as DivX, xvid, etc is the ideal choice then you’d be very much mistaken. Video codecs are a patent and licensing nightmare which makes choosing one both a legal minefield and very costly. Consider MPEG4 to license the codec at raw patent licensing costs is $0.25 per decoder and there are fees for the encoded footage as well, MPEG2 is oddly far more expensive at $2.50. So if you thought the margins were slim on those £20 DVD players consider that about 7% of the cost goes just on licensing! As I said those figures I quoted are the raw licensing costs, unless you plan on writing your own decoder or can find something you can use for free you will also have to license a 3rd party decoder to distribute with your software. All these costs add up and unless you make a large margin on each sale of your product they it may be uneconomic to license a video codec.

So what are the free options? One of the most widely used codecs is MPEG1 as Windows has been supplied with an MPEG1 decoder since the Windows 95 days. Unfortunately MPEG1 is being to show its age and for high action scenes the video can become very blocky also the colours tend to be washed out. The other free option is Windows Media (WMV) but the quality of the video isn’t very high and the decoding complexity can push your application’s processor requirements up quite significantly. On2 released a free version of their now quite old VP3 codec but again like WMV the decoding complexity is high. Now even if you are in a position to license MPEG4 there are now two different patent pools neither of which contain each others patents in full and in addition there may be companies who have chosen not to put their patents into either pool and may demand you license separately. You could license one pool or even both and still be at risk from potential legal challenges from submarine patents.

So what choices does a small developer have? Are there any other free alternatives that can be used? There are two alternative choices but neither are ready for commercial deployment yet. Theora and Dirac are the two main options and come from different perspectives. Theora is based on VP3 which On2 donated to the Open Source community with an irrevocable free license for use. Dirac on the other hand is an experimental Open Source codec being developed by the BBC to be powerful, royalty free and has been developed to avoid existing patents which aren’t owned by the BBC. So lets take a look at these in detail.

Currently Theora is in the alpha stage, as of 20th June alpha7 was released with the bitstream being frozen since alpha3 so all videos encoded since then should still be playable on the current releases. Theora while based on VP3 aims to replace some of the fixed internal parameters with a more flexible encoding model so that the codec could be more easily tweaked for better video performance. Development of Theora is complemented by a series of related projects under the same banner, there are some audio codecs most noticeably Vorbis as well as the Ogg container format which allows for a completely free and open video system to be used. There is also a project for implementing the various components as a series of DirectShow filters thus making implementing Theora relatively straightforward. The big issues with Theora are that the development has been painfully slow, On2 made the original sources to the codec available back in September 2001 and yet nearly 5 years later we still haven’t even reached beta yet. My personal evaluation of the codec and DirectShow filters threw up a few problems that meant I couldn’t use the codec in a commercial product.

Dirac was made public back in March 2004 and has since progressed to the point where a reference implementation of the codec is almost complete however the reference implementation is very CPU intensive to encode and decode with decoding speeds that are less than real-time on the fastest machines I have access to. There were also visual issues with some video footage such as quite severe blocking artefacts. Until the reference codec is complete and some heavy optimisation is applied Dirac is nowhere near ready for commercial deployment. It also suffers from the fact it has very few tools to help encode the video which makes the process of generating video non-trivial. My personal opinion is it will probably be at least at year before this codec could potentially be consider for commercial use.

Overall I believe Theora and Dirac are definitely a step in the right direction of software producers who need a royalty free video codec however there could be a long wait before anyone could use either of these codecs in real products. The process could be speeded up with some assistance and I would encourage you to at least try and use these codecs and report any bugs or issues you find to the developers. The more people who test the code the and report the problems the quicker it can reach a stable 1.0 release, after all a bit of QA is the least you can give in return for a free video codec.