User Tools

Site Tools


tutorial:guide_to_encoding_types

Guide to encoding types

This is a small guide to understand the terms used for video encoding types.

Two pass

This methods does two passes over the entire video. The 1st pass examines the entire video. It makes a complex analysis of each frame and each scene, and decides which parts of the video need more bitrate and which ones need less. During the second pass the video is actually encoded using the information found in the previous pass.

Why are two passes needed? Because the codec cannot see in the future. So it cannot know how much bits to give to the current images.

Let's assume that Quantizer*Encoded size is more or less constant. If you do the 1st pass encoding with quantizer=2, you will get a size S. Now, you know the wanted final size (F) that should be less than S, else you just wasted your time.(nbsp):-)

The average quantizer is then Q=(2*S)/F. It is then tuned all along to give more bits to scenes where it will make a big difference, and less to the scenes where giving bits will not increase the quality noticably.

So, using two-pass mode will give you:

  1. A given filesize
  2. A good distribution of bits
  • Quality: Very high quality
  • Time: Requires the most time (obviously because it does two passes). The first pass may be faster than the second as it is somehow lighter. The computation does not need accurate numbers to work.
  • Video size: If using a video target size option, usually accurate within 2(nbsp)% of target size.
  • Recommended: Yes. It is worth the extra time.

Same Qz as input

A method for quick re-encoding a file that will encode each frame with the same quantizer as the quantizer the input frame was encoded with. The output could be a file with bitrate/filesize similar to the original one. This may be useful e.g. for re-encoding MPEG-4 video without codec options such as QPel, which some hardware players do not support (note that by re-encoding, you always lose quality, unless the target format is lossless). This method will extract the 1-pass analysis information already stored in the video frames and reuse it, effectively avoiding a whole pass and saving time.

  • Note: This method cannot guarantee that the final filesize/bitrate will be the same as the original, but it can get quite close and it's faster than two-pass.
  • Quality: Usually quite close to the original file.
  • Time: Linear time depending on the length of the file. Requires approximately half the time of two-pass encoding, usually quite fast.
  • Video size: Generally the same as the original input file, but not always.
  • Recommended: Only useful for modifying an existing encoded file.

Single pass – bitrate

This encodes the video one time, using a limited video bitrate range on all scenes, regardless of whether or not they need less, equal or more bitrate. Note that this is not constant bitrate encoding.

  • Quality: The lowest quality videos.
  • Time: Requires the least amount time of encode.
  • Video size: Size of videos will vary and cannot be accurately predicted.
  • Recommended: This method is not recommended because it produces the lowest quality videos. Two-pass is recommended.

Single pass – quantizer

Also known as constant quantizer or constant quality mode. By selecting a number, each frame will get the same level of compression based on the chosen level. Good for quick and simple compression, at the sacrifice of possibly not achieving the large or small size of video desired. Low levels equal less compression, and therefore result in higher video quality. High levels equal more compression, and therefore result in lower video quality. This is very useful for quickly compressing something based on a simple value system.

  • Quality: Variable, depending on the quantizer.
  • Time: Linear time depending on the length of the file. Usually quite fast.
  • Video size: Variable depending on the quantizer, cannot be predicted easily.
  • Recommended: Recommended when simple and quick compression is desired or when highest-quality encoding is desired - that is, encoding the whole video with quantizer=2.
tutorial/guide_to_encoding_types.txt · Last modified: 2012/11/11 08:51 (external edit)