Video

Codecs

A codec – or coder/decoder – is an encoding tool that processes video and stores it in a stream of bytes. Codecs use algorithms to effectively shrink the size of the audio or video file, and then decompress it when needed. There are dozens of different types of codecs, and each uses a different technology in order to encode and shrink your video file for the intended application.

Once a file has been encoded using a specific codec, that same codec must be used to decode the file in order for it to play on your device.

Depending on the codec, this encoding occurs in one of two ways: lossy or a lossless compression.

H.264

MPEG-4 Part 10, AVC (Advanced Video Coding)
H.264, also known as MPEG-4 Part 10 – Advanced Video Coding (MPEG-4 AVC), is served as one of the most commonly used formats for the recording, compression and distribution of video content. Developed by the ITU-T Video Coding Experts Group together with the ISO/IEC JTC1 Moving Picture Experts Group, H.264 is known to us perhaps because it is one of the video encoding standards for Blu-ray Discs and all Blu-ray Disc players can decode H.264.

One of the very nice things about h.264 is that you can use it at very low and very high bitrates. The h.264 will send highly compressed low resolution video across the web and then happily encode your high definition movie at super high bitrates for delivery to a High Definition television. This is a very common codec for camcorders and digital video cameras. Its container is AVCHD.

H.264 is quickly becoming the standard codec, while either mp4 or MKV are worthy containers. MP4 might get the edge here because it is better supported in consumer devices, and is the standard for most large streaming video sites.

The current video landscape prefers the highest quality compression available for your intended purpose and to have multiple versions of your files for multiple uses — i.e. one file for web-streaming, another for disk-based distribution, another for standard definition DVD, another for Blu-ray, etc.

H.265

HVEC (High Efficiency Video Coding)
The new codec is a successor to H.264, a common format used for most videos released and streamed online. H.265 is also known as High Efficiency Video Coding (HVEC).

H.265 was created as a collaboration between the ITU Video Coding Experts Group (VCEG) and MPEG.

H.265 is not a video format, but a kind of video compression standard. It is the successor to H.264 (AVC), and surely better than H.264. In the H.265 vs H.264 comparison report, H.265 is tested to be able to offer higher image quality but with much lower bit rate, in other words, less data and smaller file size. H.265 supports up to 8K UHD(8192×4320).

MPEG-1

VCD (Video Compact Disks)
MPEG-1 is used almost exclusively for Video Compact Disks (VCD), which are extraordinarily popular in some parts of the world but never caught on in the U.S. — the video quality is substantially lower than DVDs. Short answer: No.

MPEG-2 (h.262)

DVD (Digital Video Disk) / HDTV (High Definition Television)
MPEG-2 is a container format, but there is also a codec of the same name, which most people call h.262, so that it’s not so confusing, though a world where we call something h.262 is already more confusing than it ought to be. MPEG-2 is used for DVDs and pretty much nothing else with the exception of broadcast High Definition Television (HDTV). Short answer: No.

Windows Media Video (.wmv)

Once it was realized that the Internet was a delivery vehicle for things like video, people started trying to come up with ways to share video that wouldn’t take up a lot of bandwidth and disk space. One of the big advances was the idea of streaming video — where your computer downloads only a part of a video and begins to play while the download continues — this means you don’t have to wait two hours for a movie to download before you can start watching. Over the years the WMV format has grown to include support for high definition 720 and 1080 video. To make things complicated, files that end in .wmv are usually stored in an .asf container.

Lossless Compression

Lossless compression basically works by removing redundancy. Information that’s redundant is replaced with instructions telling the computer how much identical data repeats. A simplified example:

fffffffuuuuuuuuuuuu

Can be “compressed” to:

f7u12

Lossless compression works much like a ZIP or RAR file in that after compressing and decompressing, the file is essentially the same, but it’s not an efficient way to store large files because there isn’t much compression that actually takes place. In addition, online transmission of large video files uses far too much bandwidth to make it a viable streaming option.

Containers

A video’s file extension usually refers to the container.

A few containers have codecs that they almost always use and other containers are often used with many different codecs.

A container exists solely for the purpose of bundling all of the audio, video, and codec files into one organized package. In addition, the container often contains chapter information for DVD or Blu-ray movies, metadata, subtitles, and/or additional audio files such as different spoken languages.

Modern containers often include the required audio and video codecs needed to play the file.

Telling someone to send you an MP4 file doesn’t give away any useful bits of information without understanding how the video and audio itself were encoded. The container is just that, a place to store the audio, video and the codecs needed to decode them for playback.

MP4, M4V

MP4 is the recommended format for uploading video to the web, and services such as Vimeo and YouTube have it listed as their preferred format. The MP4 container utilizes MPEG-4 encoding, or H.264, as well as AAC or AC3 for audio. It’s widely supported on most consumer devices, and the most common container used for online video. You really can’t go wrong with MP4.

MP4 and M4V are the same video format. The distinction is that Apple uses M4V to indicate that the video may contain DRM — that is, encrypted media streams and a block that identifies it as encrypted. Applications that present M4V as an output option don’t encrypt the streams, so M4V and MP4 are the same.

So, the only difference between MP4 and M4V is going to depend on the encoding options used (bitrate, resolution, fps, profile, etc.). In some products, there’s an option for “Apple Devices” and MP4, and those will use the different file suffixes (as M4V is usually configured to open iTunes), but also it automatically selects the MP4 profile and settings that use the lowest battery power for playback on Apple iOS devices (which have hardware MP4 decoders), and sometimes a smaller bitrate (to conserve storage on the device). To the extent that a lower bitrate setting is used, then the M4V will have lower quality than the MP4 — but that has nothing to do with it being M4V, just the encoder setting.

AVCHD

AVCHD is a very popular container for data compressed with h.264 — it comes to us through a collaboration between Sony and Panasonic as a format for digital camcorders. It’s a file based format, meaning that it’s meant to be stored and played back on disks or other storage devices such as compact flash drives or SD cards. It supports both standard definition and a variety of high definition variants from 720 to 1080p in a variety of frame rates including 60 frames per second, 24p native as well as 3D modes.

It’s an extraordinarily robust container format that includes not just things like subtitles, but menu navigation and slideshows with audio. Short answer: Yes.

MKV

MKV is a rapidly growing format that was designed to be future-proof. The container itself supports almost any audio or video format which makes it adaptable, efficient, and highly regarded as one of the best – if not the best – ways to store audio and video files. In addition, it even supports multiple audio, video and subtitle files even if they are encoded in different formats. Due to the options the container offers, as well as its handling of error recovery (which allows you to play back corrupted files), it has quickly become one of the best containers currently available.

FLV, SWF

FLV, SWF (Flash Video)
Macromedia originally created Flash before they were ultimately acquired by Adobe in 2005. Flash is an aging container that is being phased out due to limitations in the technology, creating what Steve Jobs used to refer to as “buggy” file handling. This led to a very public omission from iOS devices for Adobe and it appears that this was the beginning of the end for the format. As HTML5 standardization takes hold, we should see less Flash videos online, and the container is most likely going to disappear with it.

AVI

AVI (Audio Video Interleave)
Developed by Microsoft and released with Windows 3.1 way back when false teeth were still made out of wood, AVI files were once a workhorse of digital video. If I say “AVI is dead” the comments section will clog with people still using it, so I’ll say that it’s popularity has waned, but there is still lots of legacy AVI to be found all over the web. Short answer, don’t output video to it, but keep a player handy.

ASF

ASF (Advanced Systems Format)
ASF is a proprietary Microsoft container that usually houses files compressed with Microsoft’s WMV codec — to make things confusing, the files are usually designated .wmv and not .asf. The ASF container has the advantage over many other formats that it is able to include Digital Rights Management (DRM), a form of copy protection. It was designed for streaming video from media servers or over the Internet. Short answer, again, don’t output video to it, but keep a player handy.

MOV, QT

MOV, QT (QuickTime)
QuickTime was developed by Apple and supports a wide variety of codecs. It’s a proprietary format though and Apple decides what it supports. Quicktime, like Microsoft’s version, .avi, looked like it was going to fade into the sunset but just as it was about to die, Apple released the Mavrick update and quietly replaced anything inside a .mov container with h.264. In fact, both Nikon and Canon DSLR’s output h.264 video wrapped in a .mov container. Short answer: Sure, why not. Most people will be able to read .mov files for a while now.