When I first took the dive into online video, I quickly found that there was a steep learning curve - especially with regard to new terms like codecs, video file formats, compression and the like.

At ReelSEO, Ive had several readers ask me to clarify the differences between mp4, AAC, flv, mov, H.264, VP6, Spark, AAC, .ogg, Theora, XviD, MKV, etc...  Just last week, we posted a basic overview of web video formats and I thought it would be worthwhile to follow up and provide some basic information around what we mean when we talk about video formats, or encapsulation containers, as opposed to online video compression and encoding.

Video File Formats and Containers

Wikipedia defines a video file format as "A container or wrapper format is a meta-file format whose specification describes how data and meta-data is stored (not coded)."  What does this mean?

Well, when you look at a multimedia file, you will notice that the file names end with, for example -  .mov, .ogg, .wmv, .flv, .mp4, .mpeg, etc...  These extensions indicate the video file format. Essentially, videos are packaged up into encapsulation containers, or wrapper formats, that contain all the information needed to present video.  Videos have a lot of different information that can be "wrapped" up into these containers - including the video stream, audio stream, metadata, subtitles, chapter-information, synchronization information, etc...   For multimedia data streams to be useful in stored or transmitted form, they must be encapsulated together in a container format. You can think of file formats as being the containers that hold all this information -very similar to a .zip, .sit or .rar file.

So, as an analogy - Let's say that you have a board meeting where you need to present your ideas for 2011.  You may have various pieces of information that you need to present during a board meeting.  These may include a presentation, financial charts, legal documents, etc...  Each of these separate items is compressed on their own into PowerPoint files, Excel files, Word documents, etc...  To package these items up together, you might put these all into a .zip file.  Separately, each one of these pieces carries important information that when packaged together - represent your whole story.

Examples Common Video File Formats:

  • .mov, .wmv, .ogg, .avi, .flv, .ogg, .mp4, .mpeg

Video Compression & Codecs

Although container formats do employ "compression" to compress all the various information sources into a compact file (like a zip file) - prior to bundling that information, each data stream is encoded/compressed. So, for example, you may encode a video stream using h.264 and an audio stream using the AAC compression scheme.   These may then be wrapped up within a .mov or .mov file container.

Video File Container Formats, Compression and Codecs   Oh My! encoding video 600x239

As a general rule, the more bits/second (the amount of data per second that's required to render audio and video content) in a video file, the better the resulting quality. The other part of the equation has to do with how the data is compressed and de-compressed as some compression schemes are better than others.  Compressing data essentially relies on algorithms to pull data out with the goal of making big data chunks smaller. Doing this makes for better quality video while taking up less space which is particularly important for delivering video over the web.

Basically, a codec - which is a combination of  the words "compressor/decompressor" (or coder/decoder) is a set of instructions that identifies the method used to compress data into fewer bytes, as well as doing just the opposite when a video file is played back, decompressing it.  So, a video codec, is a compression scheme to compress a video stream while an audio codec would be a compression scheme for audio..

Examples of Compression Schemes:

  • Video = H.264, H.263, VP6, Sorenson Spark, MPEG-4, MPEG-2, etc...
  • Audio = AAC, MP3, Vorbis, etc...
  • Metadata = XML, RDF, XMP, etc...

Keep in mind that there are 2 types of codecs - lossy and losseless.  These are just what they sound like.  Lossy compression (commonly used to compress multimedia for delivery) compresses data in such a way that it looses some of the original data but achieves much smaller file sizes.  Lossless compression is just the opposite.

There are some details about compression, codecs, file formats, etc...  that I left out of this post in order to keep things simple.  If you really want to learn all about these, head over here for some in-depth information.

So - does this help at all?

What questions do you have with regard to encoding video for the web? Please include any questions that you might have in the comments section below and we will be sure to answer.