Video File Container Formats, Compression and Codecs - Oh My!

Video File Container Formats, Compression and Codecs   Oh My!

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!

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.

Don't Miss Any Stories!
Get daily online video tips and trends via email!
About the Author -
Mark Robertson is the Founder and Publisher of ReelSEO, an online information resource dedicated to the fusion of video, technology, social media, search, and internet marketing. He is a YouTube Certified, video marketing consultant and video marketing expert, popular speaker, and considered to be a passionate leader within the online video and search marketing industries. View All Posts By -

What do you think? ▼
  • Noob

    This is one of the most concise and explicit form of saying what are the video codecs and the video containers....As he said at the beginning the learning curve is really steep....I had some problems with a DVD player (it did not what to play some video files) so I start to document myself and to my surprise I started to belive that you almost have to be an image engineer to be able to make a movie watchable...

    So thank you for your post...

    • http://www.reelseo.com/ Mark Robertson

      ;-) Thanks George ...

  • Param

    Thanks for helping us beginners by keeping the explaination as simple as possible!

    • http://www.reelseo.com/ Mark Robertson

      You are more than welcome ;-)

  • Gregg

    I am trying to get started on learning how to write programs that do the coding and decoding. I can't seem to find any "how to" information on it to even get started. Any help would be appreciated.

  • HARISHANKAR

    u r really gr8 sir!!!!!!

  • HARISHANKAR

    THANK YOU SIR.
    I GOT WHAT I NEEDED.

  • HARISHANKAR

    u r really doing a gr8 job helping novice like me. Thanx 1nc again Sir.

  • Mbonyumuhire Sildio

    right

  • http://www.facebook.com/profile.php?id=100000206406405 Kazuhiko Yuki Yutaka

    wow!

  • Dave Carpenter

    Great explanation, thanks.

  • Jean Gabunar Molleda

    nya'a.

  • http://www.facebook.com/profile.php?id=559014339 Kevin Kornreich

    Hi Mark. You may not see this because your post is so old, but I'm trying my Q anyway because your post is the best simple explanation of this subject I've ever read! Thanks so much. My question is: Why do some formats appear to be *both* compression schemes and container formats? That confuses me. For example, while MP4 is a compression scheme, I also see it as a file format, as in.mp4. To make things more confusing, I sometimes see it together with another codec - as in "MP4 H.264." I'd be really grateful if you could somehow clarify this mess for me! Thanks!

  • http://www.facebook.com/profile.php?id=100002378683284 Tarun Kumar Sidar

    how to compress a video file? please send me a websites...

  • http://www.facebook.com/profile.php?id=1646261774 Bazlur Rahman Rokon

    hey, can you provide me some resources so that I can develop my own codec?