Thursday, January 29, 2009

Minimum Distance to keyframe - the real meaning

This sets the minimum # of frames between key frames.

This prevents the compressor from making every frame a key frame

in high action scenes.


I would recommend setting this to about 1/2-1 second, depending on the content.

(for 30 frame/second video, set this to 15-30)


Wednesday, January 28, 2009

Keyframe distance - the real meaning

This is also called Key Frame every x frames.


This sets the maximum # of frames between key frames. If this # of frames without a keyframe occurs, the compressor will insert a keyframe regardless of whether the scene has changed.


The larger this number, the smaller the resulting video file.

The smaller this number, the more control the user has over video playback - when seeking in web video, you might only be able to seek to a key frame.


I would recommend setting this to 5-10 seconds for reasonable file size of longer videos.

(for 30 frame/second video, set this to 150-300)

For 1-3 minute videos where you want users to be able to seek more accurately, set this to 2-5 seconds.


Tuesday, January 27, 2009

B-Frames - the real meaning

The name is short for Bidirectionally Predicted frames. These frames can refer to other frames that occur both before and after the B-frame.

In other words a B-Frame can say "this frame is the same as the last frame except that the football player has moved, and the ball is from the next frame except that it has moved"


Specific differences

In MPEG-1, 2 and B-frames can refer only to the previous and next Key or P-frame

In h.264. B-Frames can refer to multiple key, P and B frames


Monday, January 26, 2009

P-Frames - the real meaning

The name is short for Predicted frames. 

These frames can refer to other frames in order to reduce the frame size.

In other words a P-frame can say "this frame is the same as the last frame except that the football player has moved and the ball is new - this is what the ball looks like"

P-Frames are significantly smaller than Key Frames, but jumping to them is harder, as one or more other frames has to be decoded in order for the P-frame to be decoded.


Specific differences

In MPEG-1,2 and 4, P-frames can only refer to a single previous Key or P-frame.

In h.264, P-frames can refer to multiple Key, P, or B-frames


Sunday, January 25, 2009

Key Frames - the real meaning

Key Frames are also known as I-frames - short for Intra-coded frames.

Key Frames are encoded with no other frames used as a reference.

This allows one to jump to a Key frame with minimal decoding effort.


Key Frames are large compared to other types of compressed frames, and having too many of them will hurt video quality. On the other hand, having too few will make it hard to navigate in the video.

Saturday, January 24, 2009

Frame Rate - the real meaning

This is the frames per second of the final video.


You usually have an option to use the original frame rate or some fraction of the original, plus fixed frame rates.

Some compression programs put standard frame rate conversions here (e.g. inverse telecine/inverse 3:2 pulldown, Film-PAL, PAL-Film)


My recommendation is to use the original frame rate whenever possible. If you don't have that option, use 1/2 the original frame rate.


Frame Size - the real meaning

This is just the final video width and height in pixels (dots).

640x480 is roughly equivalent to NTSC Standard Definition television and 768x576 is roughly equivalent to PAL Standard Definition television. 1280x720 is 720P HD and 1920x1080 is 1080i/1080P HD


You additionally may have to specify how to adjust the aspect ratio to fit. There are 4 possible options:

1. Distort - also known as Unconstrained. This resizes the video to fill the final size regardless of the original aspect ratio. This is appropriate for converting 720x480 NTSC video or PAL 720x576 PAL video to computer square pixels. 

2. Letterbox - this will put black bars in the video to adjust the aspect ratio. This is appropriate for publishing video in a player that resizes video to fill the player screen.

3. Maintain Aspect Ratio - this will shrink one of the output dimensions so that the original aspect ratio is maintained. This is preferable to Letterbox for players that maintain aspect ratio when scaling video.

4. Crop - also known as pan & scan. This will crop off the edges of the video that won't fit in the destination. This is almost never appropriate.


I recommend you make the final video as large as practical without going larger than the original video. You gain more from the extra pixels than you lose in size.

Thursday, January 22, 2009

Peak Rate - The Real Meaning

The Peak Rate setting is the maximum bitrate that should be allowed by the codec. 

Be aware that some codecs will occasionally peak somewhat higher than the Peak Rate setting.


Tuesday, January 20, 2009

Bitrate in the Real World

The Bitrate setting is also known as Data Rate and Average Rate.

In almost all codecs and programs it is used to set the target (not actual) size of the file in kilobits/second (kbps). Usually, the actual size is larger than the bitrate setting (how much larger varies based on the program and codec)


Determining the final actual bitrate.

To determine the approximate actual bitrate of a compressed file, take the file size in Kilobytes, multiply by 8 (there are 8 bits in a byte), then divide by the # of seconds of video in the file. This will give you a total bitrate for audio and video combined.

This is only an approximate bitrate because there is some overhead, but it should be very close.


Compression Settings in the Real World

The settings available in most compression programs are confusing. 

The help file often is confusing, and often inaccurate.

Sometimes the actual effect of a setting is the opposite of what you would expect.

With that in mind, I am working on describing most of the settings available, listing some alternate wording used in the programs, and describing what the setting does in the real world.