That's very complicated and depends on your resolution, framerate, (de)interlacing, filtering, and the type of material. Give us the specifics and we can make suggestions. I'd start with this one: use
XviD instead, with these settings:
In the Profile @ Level settings, check Adaptive Quantization, GMC, and Closed GOV, and uncheck Packed Bitstream. In the Advanced Settings box, check Use Chroma Motion and under Quantization tab change all the 1's to 2's but leave all the 31's alone, then check Trellis Quantization. On the Motion tab setting the Motion Search Precision and VHQ Mode to higher numbers will increase quality but slow down encoding time. Back on the main config page select either a Target Size or Target Bitrate.
You're guaranteed better quality at any bitrate or any number of passes than with DivX.
