Log in

View Full Version : 2-pass encoding


gettho
20th March 2002, 13:29
hi all
i want to test the divx 5 codec in virtual dub with 2-pass encoding at different bitrates and options. here my question: when i do the first step of the 2-pass encoding i get test.avi, divx.log and mvinfo.bin, which i've configured to 450 kbps / GMC / B-Frames. i make the real avi just changing from first step to second- but can i use the files from the first step after that to make a different config with changing bitrate and options? or have i do to the first step everytime i cahnge the config?
hope u understand non oxford english
cya

Northpack
20th March 2002, 21:13
I honestly don't know! Very good question! Does someone know exactly which options you can change in second pass?

Acaila
20th March 2002, 21:16
The only thing you can safely change is the bitrate, and that only a little (+/- 20% is still safe). Any other setting changes the whole motion estimation calculations and you'll need a new logfile for that.

Northpack
20th March 2002, 22:37
Thanks - thats good to know ;)

But why does bitrate matter? I always thought first pass stats are independant of the bitrate used in second pass!?

Why only a differece of 20 percent?

Acaila
20th March 2002, 22:51
The bitrate you set determines the quantizer that is used for each frame and motion vectors are dependant on the quantizer that is used. So changing the bitrate changes the quantizers, which in turn changes the motion vectors.
A small change is not noticable, but the more the first and second pass bitrates are different, the less efficient your encoding will be.

Northpack
20th March 2002, 23:03
Well that explains something. I'm just curious because I went over from DivX3/Nandub where the first pass takes place always at maximum bitrate.

Thus you would say a change in bitrate from first to second pass that takes no more than ~20 percent, will still ensure optimal quality?

Acaila
21st March 2002, 11:12
That's what I'm saying. But to get real optimal quality, use a 2nd pass bitrate that's identical to the 1st pass bitrate.

Yes, DivX3 and XviD uses a constant quantizer at 2 for the first pass, but both DivX4 and 5 already use bitrate scaling for the first pass. It can be confusing if you jump from DivX3 to DivX5 and expect things to work in the same way.