February 13, 2010

Video and audio codecs

Most of us have seen and used avi files to store our videos. These files consist of a separate video stream and audio stream(both of different formats) and stored in a container which is capable of holding both the audio and video streams. Here, avi is the name of the container used. These audio and video streams are compressed or encoded with different codecs.

Why the need for compression or encoding? You see, storing multimedia in its uncompressed or raw forms eats up storage space. A 90-minute uncompressed movie will easily fill our entire hard drive. Over the years, various codecs(coder-decoders) were developed, which implemented algorithms to allow us to encode multimedia and reduce their file size considerably, with as high quality as possible.

Some of the more common video codecs are Xvid and DivX. They are used to encode the video streams for .avi files. The audio streams are usually encoded in good old mp3 using the LAME encoder. While these codecs are extremely good in their own rights, they are relatively outdated. With the introduction of HD video and HD surround sound, something new was needed which could compress these high quality audio and video streams efficiently. Enter H.264 and AAC....

H.264 and AAC are the new codecs used for encoding HD video and multichannel audio streams. H.264 is capable of encoding a full HD movie to fit in a single 25-GB disc. H.264 has been designed to be highly efficient, while preserving high video quality.

AAC, on the other hand, has been designed to be the successor to mp3. Mp3 has been the king of the audio formats for around 10 years, but it has various shortcomings, which led to the creation of AAC. AAC has the ability to store many more audio channels than mp3 in a single file and is more efficient.

While AVI can still be used for holding H.264 streams, it can't hold AAC streams without a lot of problems. Matroska is a relatively new container which has been developed to hold a large number of different audio and video streams. You might have come across these files, they end in .mkv extension. Matroska is one of the containers capable of holding H.264 and AAC streams. 

While HD technology is a far cry from becoming mainstream, the codecs are definitely not! Implementations of these codecs are easily available for free download. Since these codecs are much more efficient than the earlier codecs, you can use them to convert your video and audio files to a format which occupies less space while preserving the same quality, or maintain the same file size with a higher quality file. The popular multimedia players like VLC Media Player, Windows Media Player 12 and Winamp come preinstalled with all the codecs required to play back these files. Installation of codec packs like KLite Codec Pack and Shark007 Codecs should also enable older versions of these players to play back such files.

So what would you need in order to do this conversion? You'd need a program that serves as a mediator between you and the codecs, which allows you to set the conversion settings for your files and which can manage the efficient use of these codecs. One such program is Mediacoder, which is available for free download off the net. Give it a try!

That's all for today... I'll be back soon with a tutorial on how you can use Mediacoder to convert your videos to .mkv files.. Wait for it!

Have a great day,
Vinay

5 comments: