Log in

View Full Version : How to generate a 1st Pass AVI file for DivX5?


JimmyBarnes
22nd April 2002, 01:58
i.e. the maximum size which the AVI can't exceed

I think you'd use Min quant = max quant = 2

Would you also set bitrate = 6000 ?

Also, could one use the 2-pass, 1st run info (LOG and BIN files) for the run which you had done using the GKnot info for bitrate, or would your have to do this again (2-pass, 1st run) using video bitrate = 6000 kpbs?

Presumably you'd disable BiDirectional Encoding as this results in the quantiser being doubled for some frames?

What about GMC?

Why do I want to do this? Because no one can tell me how to extract the 1st Pass AVI size from the 1st Pass LOG file, in the same way that GKnot could read this info from the 1st Pass Stats file when using NanDub.

thanx
JB

dragoman
22nd April 2002, 04:30
Hi,

You have to understand the difference between a log file and a stats file. Nandub and Xvid both write out the entire first pass using max quality (max/min quantizer of 2) and then apply the bitrate settings to that for the second pass. That's why the first pass using Xvid is so huge.

DivX5 simulates the encoding at max quality level, then records the results in the log file. That's why the log file for divx5 is only 5-6MB in size.

If you want to see the filesize at 100% quality, then encode at 1-pass quality passed encode at 100%, and disable b-frames. This will encode every frame using a quantizer of 2 (you are correct, in 1pass mode b-frames are encoded at quantizer 4) and you will see the max filesize you can achieve for that particular movie.

As for extra features such as GMC, use them on this encode if you are going to use it in the second pass to get an accurate representation as to how it affects your filesize.

To figure out the bitrate of the file you get, just do the math.

Hope this helps,

dragoman

Acaila
22nd April 2002, 09:49
Dragoman wrote:
DivX5 simulates the encoding at max quality level, then records the results in the log file. That's why the log file for divx5 is only 5-6MB in size.
Like you said during the first pass DivX3-SBC and XviD encode at 100% quality (constant quantizer = 2), however DivX4 and 5 already scale everything to the bitrate you've selected and only write out info that is applicable for that specific bitrate (which is why the more you deviate from that bitrate for the 2nd pass the more off the motion estimation will be). It does not 'simulate' a constant quantizer of 2, it encodes at the specified bitrate.

I know you understand the process, but I thought you didn't make that point very clear the way you said it. :D

JimmyBarnes wrote:
I think you'd use Min quant = max quant = 2. Would you also set bitrate = 6000?
When you use constant quantizer of 2 the bitrate become irrelevant (or effectively set iy at 6000, whatever makes it more clear to you). So you don't have to manually set the bitrate at all.

dragoman
22nd April 2002, 16:59
@Acaila:

Thanks, yeah I didn't make that clear....I am working nights now, and sometimes I type all foggy-headed....

Just what the world needs, right, another bleary-eyed cop with a gun....:)

Anyway, yes, that's what I meant to say when I said the word "simulate" encoding at the max POSSIBLE quantizers according to the bitrate you set.

So while using Xvid and SBC you can (conceivably) change the bitrate for the second pass and not really screw with the first pass data...DivX 4/5 it is imperative that you keep same settings in both passes in order for quality to be right.

dragoman