What is a Codec ?
Codec is a hardware or computer programs that encode/decode digital data streams or signals. Codec shrinks large movie files, and makes them playable on your computer. Codec programs are required for your media player to play your downloaded music and movies.
Codec = Coder + Decoder .
A codec encodes a data stream/signal for transmission, storage or encryption and decodes it for playback or editing.
Do we need Codecs ?
Video and music files are large(Uncompressed 1080i high-definition video recorded at 60 frames per second eats up 410 gigabytes per hour of vide), they become difficult to transfer across the Internet quickly. To help speed up downloads, mathematical “codecs” were built to encode (“shrink”) a signal for transmission and then decode it for viewing or editing. Without codecs, downloads would take three to five times longer than they do now.
Codec is a translator for compressing/decompressing raw media data.
Raw Data is huge. Codec compress them and facilitate to store.
Lossy and Lossless Codecs
Lossy Codecs reduce quality by some amount in order to achieve compression. Often, this type of compression is virtually indistinguishable from the original uncompressed sound or images, depending on the codec and the settings used. Lower data rates also reduce cost and improve performance when the data is transmitted.
Lossless codecs are typically used for archiving data in a compressed form while retaining all of the information present in the original stream. If preserving the original quality of the stream is more important than eliminating the correspondingly larger data sizes, lossless codecs are preferred. This is especially true if the data is to undergo further processing (for example editing) in which case the repeated application of processing (encoding and decoding) on lossy codecs will degrade the quality of the resulting data such that it is no longer identifiable (visually, audibly or both).
Using more than one codec or encoding scheme successively can also degrade quality significantly. The decreasing cost of storage capacity and network bandwidth has a tendency to reduce the need for lossy codecs for some media.
Media Codecs and their variations
Codecs are often designed to emphasize certain aspects of the media, or their use, to be encoded. For example, a digital video (using a DV codec) of a sports event needs to encode motion well but not necessarily exact colors, while a video of an art exhibit needs to encode color and surface texture well.
Audio codecs for cell phones need to have very low latency between source encoding and playback. In contrast, audio codecs for recording or broadcast can use high-latency audio compression techniques to achieve higher fidelity at a lower bit-rate.
So, there are thousands of codecs available. There are codecs for audio and video compression, for streaming media over the Internet, videoconferencing, playing mp3’s, speech, or screen capture. If you are a regular downloader, you will probably need ten to twelve codecs to play your music and movies.
Many multimedia data streams contain both audio and video, and often some metadata that permit synchronization of audio and video. Each of these three streams may be handled by different programs, processes, or hardware; but for the multimedia data streams to be useful in stored or transmitted form, they must be encapsulated together in a container format.
Lower bitrate codecs allow more users, but they also have more distortion. Beyond the initial increase in distortion, lower bit rate codecs also achieve their lower bit rates by using more complex algorithms that make certain assumptions, such as those about the media and the packet loss rate. Other codecs may not make those same assumptions. When a user with a low bitrate codec talks to a user with another codec, additional distortion is introduced by each transcoding.
Difference between Codec and Compression and Container Format
Compression format or standard – a format is a document (the standard), a way of storing data, while a codec is a program (an implementation) which can read or write such files. In practice, however, “codec” is sometimes used loosely to refer to formats.
Container specifies how different data elements and metadata coexist in a computer file or stream
Once the media data is compressed into suitable formats and reasonable sizes, it needs to be packaged, transported, and presented. That’s the purpose of container formats–to be discrete “black boxes” for holding a variety of media formats. Good container formats can handle files compressed with a variety of different codecs.
Theoretically, a container format could wrap any kinds of data, most container formats are specialized for specific data requirements.
Container does not describe how the data warped is encoded.
Popular Codecs and Containers