CODECS, Part 1. Mostly Video CODECS: What are they? What are they good for?

(version September 16, 2007)

This is a short article on the topic of video CODECS, which are behind-the-scenes software. But as an animator you need to know what lies behind the scenes so that you can make some smart choices. Also, even though you follow common rules for video production, expect some users to have problems: their system will be missing standard software found on most systems, or they will be using versions of operating systems where the CODEC is not supported. Knowing how to fix these issues will keep you audience happy, and most video producers like that.

Mostly Video CODECS

If you have ever played a DVD on a DVD Player or on your computer, or if you have played an AVI file or MOV file (from YOU TUBE or any Web site), you have used a CODEC—and you probably were unaware that you were using a CODEC. This articles talks about Video CODECs and not so much about Audio CODECs, although both are used in video production all the time. The goal of the article is to take some of the mystery out of the term and help you find out how to fix a video CODEC problem when one occurs. As an animator using 3D software CODECs will come up and greet you all time. You might as well learn what they are all about.

CODEC is short for COmpression-DECompression algorithm. For the purposes of this article you can think of an algorithm as a set of rules. In fact it is software. When you use a CODEC to create a video, you use the COmpression part of the rules. When you play back a DVD, you use the DECompression part of the rules. Your DVD player has CODECs loaded into it when you buy it from the store. If it did not have CODECs loaded, then you would not be able to play DVDs which were built when the movie manufacturer created the DVD. Some older DVD players cannot play some of the new movies for the reason that they do not have the required CODEC loaded. You might have a DVD player and noticed that it does not play a certain DVD, but that DVD plays on your computer. The reason is likely to be that your computer has the right CODEC loaded on it, but the older DVD player does not. (There are, of course, many other reasons why DVDs may not play; this is just one common problem.)

If all movies were very short (just a few minutes, say), we might not need CODECs. One of the main reasons for CODECs is that they help to save space. Just like a ZIP file version is usually smaller than the original—so it helps to save space—a video file processed with a CODEC is usually much smaller than the uncompressed video file (that is, no CODEC used). The main benefits to using a CODEC are these:

  1. Save space on the hard disk or the DVD.
  2. Reduce transmission time (a big help if you are on a slow network and streaming a video).
  3. Provide encryption of the video content.

We’ll talk about each one of these areas separately down below. The notes here apply to all types of video files: .AVI, .MOV, .MPG2, .MPG3, .VOB and more. When the video is being played by your standalone DVD player, you usually do not see these file types on the screen anywhere. Instead you see a menu of selections which you can choose from. Still in all those file types are found on the DVD.

A brief note about Reason #3 above: If I want to restrict the audience of a DVD to only those who have paid for a legal copy, I could use a custom CODEC to do this. Anyone can download the video file, but in order to view it they will need the custom CODEC. Some video production sites (such as training videos) have custom CODECs for exactly this purpose: prevent unauthorized viewing of the video.

Take a quick look at http://www.free-codecs.com/index.htm and you will see that there are quite a few video CODECs around, in fact there are hundreds. Although certain CODECs which were not around a few years ago are now the most popular, there is still a need for the old CODECs: you might be playing a video file encoded in the old CODEC and the only way you will be able to see it is if you have it loaded onto your system. Old CODECs never really go away, but their popularity decreases. If you use a Windows computer running XP or Vista, the installation software will include many of the most popular CODECs but by no means all of them. When you install the Mac OSX operating system certain popular CODECs are installed, but they are not the same ones as Windows XP or Vista installations. This will cause some problems at first if you have both computers at home—some videos play on one system but not the other—however, in most cases you can find the appropriate FREE CODEC and download it to the computer that does not have it and install it there. Not all CODECs are free but most of them are.

Here is some information about a popular, free tool called GSpot that will give you information about the CODECs used in encoding video and sound files and also tell you if you have the CODEC installed on your system. GSpot is updated periodically and you will want to check to see if you have the latest version installed. The Web site is http://www.headbands.com/gspot/ and it will have a link for a free download as well information on how to use GSpot software.

If you plan to do serious animation, we strongly recommend that you download GSpot and become familiar with it. If you produce a video, you can use GSpot to check that the encoding (i.e., the use of CODECs) is exactly what you want. You will be able to give users specific information on a CODEC that they need, and possibly some hints on where to find or download the CODEC.

Take a look at the example screen below from a video BOWLING.AVI. The sample screen shot shows how GSpot displays information about this video file. Most of the problems that users have in watching a video they download come from two areas: the producer of the video did not really understand the use of CODECs, and the user is equally lost about the use of CODECs. If both the producer and the user follow some easy rules, there are no major problems.

GSpot to the Rescue

The screen below has an Audio section (lower left) and a Video section (top right). We can ignore the Audio section for now (it is important, but our focus is on video CODECs for now).  Can you tell from the screen shot what video CODEC was used? It’s called CRAM (Microsoft Video 1). Click on Tables | Video CODECs in Gspot and you will see a large list of CODECs and their manufacturer. This list cannot be complete: new CODECs for security purposes come out all the time and some CODECs are not publicly distributed. But the list is the most complete one of its kind that you can easily come across. The STATUS section right below the CODEC name states “Codec(s) are NOT Installed”. It is possible that other CODECs will be compatible with the CRAM CODEC and you may have one of these compatible CODECs installed. This STATUS screen is still the best place to start when you cannot play a video. Take a cruise on the Web and search for the needed CODEC, download it, scan for viruses, and then install. You should be up and running with GSpot after doing that. Take some time to browse the manual. This is especially important for new animators. You need to know where to turn when you have a question about running GSpot. And you will be able to fascinate your friends with all your video knowledge, won't you?

The topic of CODECs will keep you jumping, because there are constant updates in this area in the movie industry. We have a demand for higher resolution and want to see more challenging video on larger screens. This drives a number of changes in the CODEC software.

CODEC Headaches

Before continuing, let’s summarize the major headaches for users of video CODECS.

  1. They have the CODEC but not the right version. They will need to get a later version.
  2. The user of a CODEC on a computer must install it. That can be a challenge if you are not used to installing software.
  3. The CODEC is missing but the user just does not know that. He thinks that the video that won’t play is broken, or maybe contains a virus. After all, his other videos play, so it can’t be a problem with his system, can it?
  4. The video plays partially (sound but no video, video but no sound, smooth video and jerky sound, smooth sound and jerky video, it stops abruptly after playing a few minutes). The user again thinks in must be a BAD VIDEO, not one for which the CODEC is wrong or missing.

 

Creating Your Movie File: Questions about CODECs

At some point after creating your own 3D animation you will want to show it off. This is only natural, and that’s exactly what a movie maker likes to do anyhow. When you go to produce a movie file, regardless of the 3D software you are using, you will have some choices to make. These will include the following (most but necessary all):

  1. What kind of file? (AVI, MOV or other)
  2. What is the name of the output file? (mymovie.avi or mymovie.mov)
  3. What is the screen size? 640x480 or custom or larger
  4. Frames per second. Generally 30, but as a movie producer you may change this value if your software allows it.
  5. Compressed or Uncompressed? If uncompressed, you output will be huge. If you are doing a very short animation (just a few seconds, no big problem, but you will still have a bulky short film). Normally you will want COMPRESSED output. This is where you pick the CODEC to use. Try DivX and try some others. Take a look at the results: can you tell the difference (in size, in quality?).

 

How video CODECS work

Let's image that we have a movie camera that is absolutely still: it sits on a heavy tripod, is not subject to any vibrations, and it remains still throughout our video. Let's further imagine that we are indoors where the weather and the wind play no part in our filming. In this perfect still world—although a bit unrealistic—the only objects that are moving are our actors in the film. They may pick up an object (and that object then moves). If I am filming at a normal rate of 30 frames per second, there is very little change from frame to frame at normal human speeds (a rocket flying past the camera would be an exception to “normal human speeds”). CODECs are smart (some are smarter than others) and notice that there is very little change from frame to frame. An actor’s hand has moved just a little bit, but nothing else. The CODEC asks: why store the unchanged information between frames, why not just store the information that changes? That is what CODECs do. They look at the frames and decide what has changed, what is the same, and do their best and tracking only the changes. The exact rules for how a CODEC does this is what makes each one different and unique. Some chop the frame up into small “buckets” or rectangles and look at just the rectangles: if this rectangle has not changed, the CODEC says “DO NOTHING HERE” or if the rectangle has changed “RECORD THE ENTIRE NEW RECTANGLE”. The CODEC does this for all rectangles. (Note that there are some CODECS that do not look at rectangles, such a fractal CODECS that look at a “transformation” of the frame. These work differently, and some can give spectacular results with much higher compression.) What is being described here is the COmpression part of the CODEC. When you view a video that has been processed with a CODEC, the DECompression part of the CODEC comes into play. It is essentially a reversal of this COmpression process, restoring the buckets that have changed. By not repeating information that stays the same the CODEC can help to cut down on the overall output size of the video file.

Depending on the specific rules that are followed, a CODEC can also lose some information compared to the uncompressed version. This is not very typical and there are some very small losses in detail which the human eye does not notice very easily. Such losses may be acceptable and the savings in cutting down on the output file size can be significant. What is really happening when a CODEC runs is that it is noting changes between frames but is also ignoring some changes too small for the eye to pick up easily. Only when the video is shown in a larger size does this issue become important.

 

Using CODECs for Encryption and Security

A custom CODEC can be a means for hiding the video from the viewer. This may be useful if I distribute videos and want to be sure that only my paying customers see them. If a special CODEC is required, then piracy of the video does not mean that the pirate got to see it. He would have to know that a CODEC is needed in order to view it. In that way a video manufacturer can protect from unauthorized use, but at some expense to the paying customer who needs to install the custom CODEC.

 

Benefits to Internet Viewers of Streaming Video

When a video is cut down in size significantly from the uncompressed version, then an Internet user of the video really benefits. Smaller amounts of data need to be passed to the user in order for him to view the video. This means that dial-up users or cell phone browsers can experience the video without delays in sending the information to the user.

There are tools around which allow a video file that has been encoded with one CODEC to be re-encoded with another CODEC. If you are going to produce videos with the same animation and different CODECs, you will not want to make use of these tools. They are handy at times but you will lose some quality. Instead of using these tools, re-encode the movie file with a different CODEC.

 

Useful Exercise

When you create your first movie (3D animation), do it two ways: compressed and uncompressed. Pick a CODEC such as DivX for the compressed version. Make both movie files, calling one UNCOMPRESSED and the other COMPRESSED. Go into a video editor and compare the videos frame by frame until you notice differences. You should note some differences.

Take a look at the Topics for further exploration and reading on your own below. You might find something that catches your interest.

 

Additional articles will appear in this section.

 

Topics for further exploration and reading on your own


1. What video CODECS are installed on your system? (Control Panel | System | Hardware | Device Manager | Sound, video and game controllers | Video CODECs | Properties) Do this step on a friend's computer system as well and see what the differences are.
2. What audio CODECs are installed on your system?
3. Download GSpot from the link given above in the article and use it to find the video and audio CODECs in a movie file. What are your findings?
4. See if you can guess what video CODECs are on your standalone DVD player. You know how to find CODECs for a video file on your compute running GSpot. These same CODECs must be on your standalone DVD player if the DVD plays at all.
5. Learn about the newest DivX CODEC (HINT: http://www.divx.com/). What is the latest version number? What features were added in the newest release? Download the CODEC. Notice that there is a free version and a paid version. What are the differences between the free and paid versions? What is the DivX Player? How does it compare to your current movie player? Does your standalone DVD player allow you to update CODECs (most do not)?
6. Explain what video CODECs are to someone you know who is not familiar with this topic. Take time to show them what you know and try to explain why this is important to you as a future producer of animations. Once you have done your explanation, ask them brief questions about what you said. Try to determine if you were understood.

We enjoy hearing from you. Some of the questions listed above will appear in future "Topics in 3D" articles. Please send your comments about this article to