Choose Video Codec
Codec is a piece of software that can encode and decode video. When it encodes video, it gets uncompressed video (sequence of images) on its input and outputs some data, usually much smaller in size. That's the main purpose of the codecs - make video size in bytes smaller. When it decodes video, it takes that compressed data and outputs sequence of uncompressed images.
Some video editing/playing software contains certain codecs built-in, but most software doesn't - it uses codecs made by third-party developers and separately installed in your system. The system usually provides some means to find installed codec and use it for compressing and decompressing data. Each codec knows how to compress data, how to decompress data created by itself (but not by other codecs), but codecs do not know how to store this data on disk.
When you write compressed video to disk, it's written in one of container formats such as AVI, MOV, MP4 or something else. Each container format describes how to save chunks of compressed data and information about it, for example a little code (i.e. FourCC) that signals about compression method. When this file is then read, that meta information about compression method is used to find a codec that will decompress the data. So, knowing how to read AVI files is not enough to decode the video - a proper codec is essential.
Some compression methods are described in some standards (like MPEG4, for example). So many different codecs may implement such compression algorithms and they are often interchangeable. For example, DivX and XviD are both implementations of MPEG4 compression method, so video compressed by one of them can be decompressed by another one or even a third codec that knows how to decompress MPEG4. But some codecs have their own unique compression methods and video compressed by such codec can be decompressed only by the same codec.
Lossy and lossless compression
The task of a video codec is to compress video so it takes less space on disk or downloads faster. This can be done in two ways: it can try to compress the video without losing any information at all - like zip compresses your files without changing them. Such compression is possible but it's quite limited - most lossless codecs provide small compression ratio, like 1:3. And you cannot control how big the result will be - it totally depends on the algorithm and the source video. But they guarantee that decompressed video is exactly the same as the source.
Another way is to allow losing some information. Most video codecs go this way, they throw out much of original information but in a way not very noticeable by the eye. In this case decompressed video is not the same as original - it's always of lower quality. But now you can control how much information will be thrown away and so control how large the result will be measured in bytes. Amount of bytes (or bits) per second of video is called bitrate. The more the bitrate is, the less information is lost, the better is quality. The lower bitrate, the lower quality. And remember that each time you compress video by a lossy codec, the quality gets worse.
What kind of codec to use
So when selecting a codec you need to decide first which kind to use - lossless or lossy. If you need just to temporary store video for further editing and you need to keep maximum quality, then a lossless codec is what you need.
If, otherwise, you need to create a file which will only be played but not edited, and you want it to fit in limited size (like CD or DVD), then you need a lossy codec.
Choosing a lossless codec
Lossless codecs differ by availability (some are Windows-only, some are free, some are commercial), by speed and by average compression ratio. Some codecs are very powerful in compressing the data, but unusably slow. Some are very quick but compress poorly. Video Enhancer author's personal choice is Lagarith, it's quite fast and provides reasonable compression.
Choosing a lossy codec
Lossy codecs also differ by availability (some are Windows-only, some are free, some are commercial) and speed, but they also differ by quality/compression ratio. This means that every lossy codec can compress video to almost any given size, so the compression rate is the same. But video compressed to the same size by different codecs has different quality. And again, usually the better this quality/compression ratio is, the slower is the codec. Nowadays best quality/compression ratio is in H.264 implementations, but the speed is usually bad: they need a very powerful CPU to decompress (play) the video and huge amounts of time to compress it. |