Tuesday, February 13, 2007

Layman's Video Codec

In the begining I was quite puzzle with video formats, especially when I was playing with TVersity. After spending lots of time reading up, I have better understanding.
There are lots of variant and beside filename extensions (who knows why they are call MIME-type) doesn't help.

My basic understanding goes like this:

MPEG - Short form for Moving Picture something...
And in each Mpeg there are different layers, treat them like sub-version.eg 1.1, 1.2,1.3 etc.

Then there is another community, that does the H.26x standard.

Mpeg-1 = lousy picture as in asia's VCD still watchable if you don't care much on the details, normally this is layer 2.
Mp3 songs also = Mpeg-1 layer 3 Audio

Mpeg-2 = SVCD and DVD.
But then a broadcaster also uses Mpeg-2, difference is in the stream. In Media eg DVD, they are call MpegPS - Program Stream. Meaning at the begining of the file, it contain how long is the movie, etc.
In broadcasting, MpegTS - Transport Stream is used. There is no fix length to the movie. Generally your recorded TV is this format.

The difference in watching this 2 files over a device like slm5500, a PS file you can see in the information bar how long is the movie, while the other you cannot. Not all DMA handle this well enough though.

To make things more complicated, a recorded TV program from Microsoft Media Center is DVR-MS. Although this is also a Mpeg-2 file with data scrambled. ie they mess up the bits, so that normal Mpeg decoded cannot read it properly.

Mpeg-3 not used

Mpeg-4 this is the confusing one. There are lots of labeling and extension, beside every video player claim that they are mp4 player.

In layer 2, the older Mpeg-4, you have the popular DivX, Xvid even WMV.

In Layer 10, which is the getting popular Mpeg-4 AVC also known as H.264. The new Blu-ray is supposed to used AVC HD.

Then you have the ITU guys who did the Internet stuff decided they also need compressed video over the IP. Hence comes out with H.261, hardly used now and H.263 for video conferencing.

Video Containers

To confuse us more we put video and audio into a file call a container.

A common container is AVI.
Today only perhaps Mpeg1, Divx, Xvid uses avi.

VOB - The DVD format, Video in mpeg-2 audio in ac3.
3GP - for most mp4 player. Video either H.263 or raw mp4, Audio AMR-NB or AAC-LC
MKV - Matroska contains Mpeg-4 video.
MP4, M4V, MOV - base on quick time raw mpeg-4, very loosely used
FLV - Flash movie for most of todays internet video like YouTube. But they are likely to be embedded in a SWF file. A variant of H.263?
SWF - Not a video container, but if you look at the type is listed as application. So you actually need adobe player to run this file.
ASF - Streaming container for Windows Media.

Then there is also Playlist
You have m3u, pls, xspf, asx. - which is basically your collections like a favourite listing.

This article has proven to be a challenge to me. Took me quite a while to write and to make sure that I did not make serious mistake.

No comments: