Codec stands for Coder-Decoder (some say Compressor-Decompressor) and is used to describe anything which turns data into another form for storage or transmission, then changes it back for use.
In traditional broadcasting, a codec is a physical device which turns analog video and audio data into digital form to be sent out over the air. It is also capable of turning received digital information back into an analog format.
In computers, a codec is used as a way of compressing video, images and audio to a more manageable size. The majority use a lossy method of compression, but some are lossless. Lossless codecs, such as MSU or Huffyuv, reproduce the original video exactly, with no subsequent loss if the video is re-encoded. The more common lossy codecs lose varying degrees of information, but can save substantial amounts of space.
A lossy codec may be transformative, predictive, or a combination of both. The transformative type cuts up the original image(s) or sound and quantizes it into a more efficient space, then encodes it. A predictive codec compares a chunk of known data to adjacent data and eliminates excess information to save size. There are many types of codec available, each attempting to strike an ideal balance between the loss of information and file size. Other factors, such as openness and the processor power needed to decode, are also important when considering which one to use.
The MPEG-1 codec is used for VCDs and contains the standard MP3, the most commonly used audio codec. Support for MPEG-1 is incredibly high, both among computers and consumer movie devices. The quality is very high, though not as high as MPEG-2, and file-sizes for video are fairly large. The MP3 audio standard has good compression through a number of codecs and is very popular as an audio-encoding solution.
MPEG-2 is an incredibly high-quality standard used for DVDs. While the MPEG-1 codec allows for only progressive scanning, MPEG-2 also supports interlacing, allowing for better display for its size. While not the most advanced of the available video codecs, MPEG-2 is firmly entrenched because of its use as the standard for commercially available DVDs.
MPEG-4 is a step beyond the MPEG-2. It has a number of significant technical advancements and better compression techniques, can handle both interlaced and progressive-scan video, and is widely supported. A number of popular online codecs are derived from the MPEG-4 codec. These include DivX, 3ivx and XviD. Each of these has minor deviations from the original MPEG-4 codec to give them better compression and functionality in certain situations.
The Ogg Theora and Ogg Vorbis codecs are a pair of video and audio codecs, respectively. They have high-quality and good compression, and are entirely free of patent restrictions, making them popular amongst many developers. RealVideo is a video codec designed specifically for streaming use online. While many codecs can be streamed, RealVideo and its sister codec RealAudio are particularly optimized for the PNA and Real Time Streaming protocols.
There are literally hundreds of codecs used online, and everyone has their own favorites for specific applications. Many programs, such as Windows Media Player, have features integrated to automatically search for and download the necessary codec to play a movie or audio file, eliminating the need for a user to actively find them. A number of bundles are also available for download, installing the most common audio and video codecs all at once.