Encoding MPEG-4/DivX Movies

The configure dialogue boxes for Microsoft's MPEG-4 codecs and DivX 3's codecs are the same (Gee, I wonder why…). There are only three parameters available to adjust. DivX 4 and DivX 5 both offer more options, but most of these additions are of little use, with the only major difference being that the data rate can be set higher. Since there are only three parameters, it isn't difficult to learn how to encode good video using these codecs. In fact, if you are in a hurry and don't want to experiment, in many cases the default settings will yield adequate quality and file size.

The three major parameters are:


Keyframe every ____ second:

Controls the number of keyframes (lower numbers are better). This primarily affects random access of the file. When you want to jump to a spot in a video file, the file can only start playing on a Keyframe, so a large interval between keyframes will result in you not being able to jump to an exact point your video.

For example, say you specify it to keyframe every 20 seconds. There is a Keyframe at the beginning, at 20 secs, at 40 secs, etc. Now say you want to go directly to a point 14 seconds into the video. When you attempt to jump ahead, the video will not start playing until it reaches the Keyframe at 20 seconds. If you had keyframed every second, then the video would start playing exactly at the 14 second mark.

More keyframes also yields better image quality, although the influence is very minor, often not noticeable. More keyframes also result in a larger file size, but again, the difference is minor.


Compression Control:

This parameter is a slider from 0 to 100, 0 is labeled smoothness, 100 is labeled crispness. This control is rather misleadingly labeled and often misunderstood. This setting essentially tells the codec what you value more, image quality or smooth playback (no dropped frames).

This settings usually only makes a difference at very low data rates. At this point, the codec may not be able to compress all the frames at the best quality, so it has to choose to either drop frames or allocate fewer bites to each frame, resulting in poorer quality. This slider determines which option the codec is likely to choose. If the number is higher (closer to crispness) then image quality will be the main concern and frames may be dropped. If the number is lower (closer to smoothness) then the codec will try to encode all the frames to ensure smooth playback.

As stated above, this setting only comes into play at low data rates (its impossible to say exactly when it matters, since it depends on what the video source is, but 500 kbps is a good place to start to be concerned about dropped frames.) Usually if the bit rate is very high, you can leave it at 100 and you will get both maximum quality and smooth playback. If it is a moderate bit rate, you may want to leave it at 75 to be safe. If the playback of an encoded file is choppy, lower this setting and try again.


Data Rate:

This is the most straightforward parameter and the most crucial to both quality and size. The maximum data rate is 6000 kbps. As stated above, this specifies the MAXIMUM bit rate; the actual bit rate will be a variable bit rate that peaks at the set rate. Thus, the final file size is rarely simply the bit rate multiplied by the number of seconds of video. Also, sometimes the video does not require the entire bit rate. A video encoded at 6000 kbps may only be slightly larger and slightly better quality than the same video encoded at 3000 kbps, simply because the extra bits were not needed.
Return to Video Guide