Encode with MeGUI. It has the x264 as H.264 Encoder which is by far the best encoder for H.264.
And xvid is a bad codec. Same with Windows Media Video.
you set the x264 internal preset to "slow" and encoding mode to Constant Rate Factor. Set the rate Factor to 21 or even better 20 (lower values = better quality) and Upload high resolution.
My Fraps recordings are in 2048x1152 because I've a screen which has this resolution. And with that resolution Youtube will give you an awesome quality.
Look my video and switch quality to "original":
http://www.youtube.com/watch?v=sjfdO3detd0Youtube doesnt have a fixed bitrate or filesize too. They use for each resolution a specific quality factor too.
And also audio quality depends on the selected quality.
Dont use virtualdub. Virtualdub has only AVI Output and H.264 is not a codec which should be put in a AVI Container.
The quality outcome at youtube isnt FPS depended either. wth. that wouldnt make any sense

As better the quality your source video has as more quality remains after youtubes encode - thats simple logic^^