Log in

View Full Version : how to encode with xvid in two passes


roise_r
15th August 2006, 08:54
pls someone explain to me once and for all how to encode with xvid in two passes, couse i cant get it! i get all cofused with that stats file. what is its meaning and how do i use it... so what i am asking if someone pls explain to me the sequance of the action taken to encode footage in two pass, in the most popular regular way... first i have to encode the footage in two pass - first pass, after it's done, i have to reopen VDM choose again all those settings, and then configure the xvid codec to use the firsts pass stats file and start encoding AGAIN with two pass - second pass...? do i have to use the same options, ... what will happen if i change, add or remove some filter for the second pass, or change the bitrate, wouldn't that result in some kind of error...?

Blue_MiSfit
15th August 2006, 09:33
It sounds like you have read the guides etc and are still genuinely confused so I will help :)

It's really simple :)

Setup the encode however you want with regards to the settings. Just make sure you select 2pass (first pass) mode. When you go to file->save as, make sure you check the box "dont run this job...". This will queue the first pass.

Now go into the XviD config again, and switch the mode to 2 pass (second pass). All other settings should stay the same. Set the apropriate bitrate / filesize, and then file->save as the same way as before.

Now push F4, or go into file->job control. You will see the two jobs queued. Click start, and VDM will run the first pass, automatically generating the stats file. Then it will run the second pass, automatically reading the stats file and using it apropriately.

That's the long and the short of it :D Job control is really cool!

BTW, since you sounded interested, the stats file is basically the notes that XviD makes when it runs the first pass. Precisely what information it contains is unknown to me, but I would asume it includes frametype decisions, and information about how compressable the frames are etc. Basically, it just records the results of the first pass, so that the second pass can allocate bitrate in the most effecient manor.

You don't want to change anything in your filter chain or the encoder settings (there are some exceptions to this, but they are seldom used in my experience) between the first and second pass. This renders all the hard work that XviD did in the first pass null, or at least makes it less valuble!

Also, you don't set a bitrate in the first pass. It's just a quick "lets see what we have here" sort of thing.

If you need more help or clarification don't hesitate to ask! I may have some of these details wrong, it's been awhile since I've thought about things on a low level like this... Nowadays I use MeGUI with x264 and Nero AAC and let it take care of all this mucking about!


~MiSfit

roise_r
15th August 2006, 09:53
Nowadays I use MeGUI with x264 and Nero AAC and let it take care of all this mucking about!


yes, i heard that this x264 is supossed to be better then xvid or divx all togather but unfortunately i cannot get it running with my stand alone dvd player, but thanks for the info, and for the job control hint... :)

P.S. What is the difference if i use the same output .avi file for the second pass as the one i used in the first pass, in the guide it says, "use different file" ? does it really matter, or the second pass will just overwrite it?

sysKin
15th August 2006, 14:41
Okay simplest:

first i have to encode the footage in two pass - first pass
Yes.
after it's done, i have to reopen VDM choose again
No, there's no reason to close and reopen VDM. You could though, no difference either way.
all those settings,
Even if you did close it, settings remain. The only setting that you need to change is encoding mode to "two pass"
and then configure the xvid codec to use the firsts pass stats file
No configuration needed, the same (unchanged) setting was used to create the stats file and then re-used to read from it.
and start encoding AGAIN with two pass - second pass...?
Yes.
do i have to use the same options, ... what will happen if i change, add or remove some filter for the second pass, or change the bitrate, wouldn't that result in some kind of error...?
If you change filter, resolution and the like, your second pass will be inefficient, lowering quality.
Bitrate -- bitrate you can't change because you didn't set any bitrate for 1st pass (it's not bitrate based and there's no room for bitrate there).
Some settings you can change freely, like VHQ and other speed/quality switches, but if in doubt it's a good idea not to change anything at that point.
Changing som e settings, like lowering number of b-frames, will have disastrous effect.

Blue_MiSfit
15th August 2006, 21:02
Listen to syskin :)

most standalones don't like x264 because x264 is an H.264 (MPEG-4 AVC) codec, whereas XviD and DivX are MPEG-4 ASP codecs. The two are quite different, and set top players that decode ASP generally don't decode AVC. Someday!

When you run the first pass, it generally only outputs a "dummy" avi file. If you overwrite this file with the real second pass, nothing bad will happen. No worries! :)

~MiSfit

rjc7394
16th August 2006, 02:35
Here's a good outline:

http://forum.doom9.org/showthread.php?p=796900#post796900

roise_r
18th August 2006, 09:38
Here's a good outline:

http://forum.doom9.org/showthread.php?p=796900#post796900

Thanks everyone... i think i've got the hang of it. as for that link, thanks to rjc7394, but i think that is way to technical for me right now... i will stick only at setting the bitrate for now, later i may get in deeper setting b-frames, VHS for bframes, I frames and all... :)