PDA

View Full Version : 1 pass or 2 pass?


robertvanwinkle
6th July 2006, 01:14
i'm just wondering if a 2nd pass is always necessary when encoding with xvid...does it make much of a difference, or can i get away with only using 1 pass (it's much faster obviously).

cheers,

- rvw

Blue_MiSfit
6th July 2006, 01:21
you can get away with 1 pass if you don't care about the filesize much. For example, if you are storing all your backups on your hard drive and you just want decent, consistent quality, then use 1 pass constant quantizer 4 mode. Do not under any circumstances use 1 pass vbr or 1 pass cbr mode. They are both.... unsuitable.

2 pass is great if you would like to hit a target filesize. For example, most movies I backup I like to have be 1/4 of a DVD+R each. Some people do 1 or 2 CDs. I like to fit a whole season of a tv show on 1-2 DVDs depending on the length and number of episodes. Sopranos - 13 eps per season, 344mb each lets them all fit on a single DVD, and I can hit that at full resolution and 5.1 AAC with x264.

Good luck.

robertvanwinkle
6th July 2006, 01:47
does that mean that a 2nd pass does not affect quality at all, only filesize..i use GK to set the file size to 1 CD/700mb, so i can fit 5-6 dvd rips of movies on 1 dvd, which leaves me room to create menus and stuff...how close does the 1st pass get to my desired file size, and how much closer does the 2nd pass get?...i can live with the file size fluctuating by 10-20mb, but not much more than that.

cheers,

- rvw

CWR03
6th July 2006, 09:39
If your calculations are accurate, you can hit the 1-pass filesize target exactly. With 1-pass, the filesize is met by manually adjusting the bitrate. With 2-pass, the bitrate and the amount of compression needed is determined by the first pass, then the second pass is done to those settings and the filesize is automatically met.
does that mean that a 2nd pass does not affect quality at all, only filesize
Actually it's the other way around. 2-pass is for variable bitrate, which means slow-action scenes get less bitrate where it's not as noticeable, and higher-action scenes will get more. In order to have a 1-pass file that will look as good as the same movie encoded with 2-pass at the right codec settings, the file would be several times larger.

drcl
7th July 2006, 19:27
In 2 pass encoding the 1st pass is used as an assessment. A log file is created detailing the complexity and detail of each frame and the motion between frames.

The second pass attempts to scale this information and encode the video to a constant visual quality at a given filesize or bitrate. This is the recommended method for personal backup and the method almost always used in professional end products (ie DVDs). It is the most efficient use of bitrate.

The 2 methods of 1-pass are very different.

1-pass - target bitrate.
Is a an attempt to do what a 2-pass does but in 1 pass. This is usually ineffective, because the encoder cannot predict in advance how to share out the available bitrate, so is in effect a lot of guesswork. The encoder will try to adjust the bitrate to the complexity and motion in a scene but will usually fail to do it suitably due to the fact that it is never sure how much bitrate it will need in future scenes. This mode is only suitable for streaming where there are data transfer rate restrictions.

1 pass - target quantizer.
This is like saying remove a given amount of detail from all frames. qunatizer 1 = no detail removal, 31 = remove so much detail as to scale the detail down by a factor of 8 in each direction. This method makes it impossible to predict the filesize, but results in a constant picture quality. This is most suited to archival purposes or if you want perfect quality(assuming a low quantizer is used).

The answer to your question is yes it does make a big difference to quality. Just try it out. But if you can't see a difference then it doesnt matter does it?

weaver4
8th July 2006, 16:13
Actually it's the other way around. 2-pass is for variable bitrate, which means slow-action scenes get less bitrate where it's not as noticeable, and higher-action scenes will get more. In order to have a 1-pass file that will look as good as the same movie encoded with 2-pass at the right codec settings, the file would be several times larger.

In single pass mode (target quantizer) the bitrate is not constant and more bits are dedicated to higher-action scenes than lower action scenes. The old codec routines that used single pass constant bit rate are bad, but the new constant quality routines are exceptional and just as good as two pass for the same filesize.

Here is a quote from the author of StaxRip. "The best encoding method quality wise is single pass in Quality Mode. In quality mode the codec uses a fixed quant which ensures a constant quality in static and complex scenes alike. It quality mode there is no control over the bitrate and filesize because every movie has a different compressibility. Action movies for instance have many complex scenes like explosions and therefore require a bigger filesize."

The thing about two pass encoding is that you can't guess what size a movie needs to be to give you good quality. Action movies require more, but busy background scenes can really take the bits. Sometimes you will get a movie (like casablanca) and you will be surprised on how many bits it takes to get this old b&w movie correct. Other movies (like Firewall) you will be surprised on how small it can be. Even though I am one of the authors of a BitRate calculator my experience has show that the general rules of thumb of .24 - .28 bit/pixel really suck.