+3 votes
72 views
in Solutions by (242k points)
reopened
Everything you need to know about video codecs and video containers

1 Answer

+4 votes
by (1.6m points)
edited
 
Best answer

What is a codec?
Video file formats and containers
What do you think ?

It's hard to try to break through and decipher the differences and relationships between codecs, containers, and compression. There are a lot of complicated questions..

image

The fuzzy lines appear when you start talking about formats like MPEG-4, which can be classified as the bit of a codec and the bit of containers as well. So what is a video codec, and how is it different from a container?

What is a codec?

A codec (encoder / decoder) is an encoding compression algorithm that processes video files and keeps them in a byte stream. The video codec uses an algorithm to compress the size of video files and decompress as needed. Selecting the right codec depends on many factors, such as target file size, output quality, and delivery method. Depending on the codec, encoding occurs in two ways: lossy or lossless compression.

Here are some examples of popular codecs:

H.264 / MPEG-4 AVC: It is the most commonly used codec in modern camcorders and digital cameras. YouTube now uses H.264 to encode videos with high definition, which is playable using Adobe Flash; YouTube also offers H.264 encoded video to mobile devices, including iPhones and other phones..

MPEG-2: Note that we must distinguish the codec (MPEG-2 Part 2, also known as H.262) from the MPEG-2 container format. MPEG-2 is used exclusively as the compression standard for DVD videos. It was also used in the early days of Blu-ray disc creation.

DivX / XviD: The DivX codec is often used to rip DVDs in the pre-HD era. And XviD is an open source version of DivX, which is popular among movie pirates..

Video file formats and containers

Okay, when you watch a video file, you will notice that the file names end with, for example .mp4, .mov, .wmv, .flv, etc. These extensions indicate the video file format. Just as a ZIP file can contain any kind of file inside, the container is basically a collection of audio and video files. This can contain audio tracks, video and audio-video codecs, subtitles, as well as metadata.

Here are some examples of popular containers:

MPEG 4 , usually with an .mp4 or .m4v extension. The MPEG 4 container is based on Apple's older QuickTime container (.mov). The movie trailers on Apple's site still use the older QuickTime container, but the movies you rent from iTunes come in an MPEG 4 container.

Flash video , usually with a .flv or .swf extension. Flash Video is, unsurprisingly, used by Adobe Flash. Flash video which is newer, is encoded with H.264 AAC video and audio codecs.

Audio Video Interleave , usually with an .avi extension. AVI is an older Microsoft container format. It's still pretty common, but you probably won't want to use it with new projects.

AVCHD is the standard container used by many camcorders. Video captured with these devices is compressed with the H.264 AVC codec. Audio is encoded in Dolby Digital (AC3) or uncompressed linear PCM.

What do you think ?

So far, have you got the basic idea of ​​the video codec and the container? What questions do you have with video encoding, editing and converting? If you have any questions, please feel free to express them in the comments section below.


...