Digital Wanderer

We live as long as we fly

Article - The current situation with video compression, part 1

At first, I wanted to use Silverlight for videos on the blog, but hardly anyone has it installed. I don't yet suffer from an inflated  ego to such a degree as to think that people would install some obscure crap on their computers just for my ancient, stupid clips. So I started looking at what's going on in the enemy camp, namely Adobe flash video. Along the way, I researched what's generally happening in the realm of digital multimedia encoding.

Crash course and glossary

Codec – a program that uses specific encoding and decoding algorithms to compress  video. A codec – the implementation of a standard, meaning a document that defines what the result will be and how it should be played back. This is how compatibility is achieved: what is compressed by DivX can be played by XviD, and vice versa. A codec consists of a coder and a decoder, hence the name.

Container – a file format that stores compressed video.

The classic, ancient container – AVI, Microsoft loves its ASF (ASF or WMV extension), flash – FLV, on DVD – IFO/VOB, the new container for everyone's beloved H.264 – MP4, Quick Time uses its own (with the MOV extension), anime fans use matroska (.MKV), and in general it's all on Wikipedia

Most containers allow you to cram in video compressed by different codecs. The file extension can also be different, that's not a big deal.

DirectX filter – a special program format for codecs that allows other programs (usually players) to use them. For example, to play video in MPEG4 format , made by the DivX codec, using the ZoomPlayer, you can install the XviD filter, which includes an implementation of the MPEG4 codec. Or install the native DivX codec filter.

History and theory

On DVD and in satellite broadcasts, if you recall, the ancient MPEG-2 codec is used. The MPEG consortium didn't stop its work and birthed a legitimate heir, MPEG-4 Part 2 (usually just called MPEG-4), which spread in the form of its illegitimate brother DivX, and the semi-legitimate bastard XviD. However, we don't care much about them anymore, because quite some time ago, the pinnacle of progress emerged – the CPU-hungry H.264, a.k.a. MPEG-4 Part 10. It is everywhere nowadays: in phones, game consoles, and is also quite often supported by special hardware accelerators and even video cards like the ATI HD2600. H.264, understandably, compresses the best at the same quality, or gives higher quality at the same size.

In parallel, Microsoft hustled and created something similar – an evolution of the Windows Media business (usually in the .wmv container) called VC-1. The differences from H.264 – supposedly lower CPU requirements during decoding, and possibly – sometimes slightly better quality.

Both of these codecs are actively used not only by video pirates on trackers, as you might have thought, but also on high-definition Blu-ray and HD-DVD discs (the latter has already passed away).

But here's the sad part – until recently, the internet, meaning the place where a high degree of compression would be most in demand, was ruled by all sorts of murky ancient crap. And that's all because the main way of delivering video on the web is flash, and it only supported rather limp commercial codecs whose names won't go down in history.

Added to this, Adobe used its own flv container for flash video, which didn't bring any happiness to webmasters either – videos had to not only be re-encoded but also repackaged.

Fortunately, Microsoft hustled and released Silverlight. It is generallly good for many things, but in this case, we're interested in the fact that it supports the excellent VC-1 codec. However, it's swapping one piece of crap for another – the format is closed, proprietary, and in an ASF container on top of that. And most importantly – hardly anyone had Silverlight installed on their computer, so for webmasters craving quality, this isn't a way out either.

Part two, the practical one.