x264vfw is outdated and isn't maintained like its cli variant.
export lossless into virtualdub
Learn how to use the external encoder feature on version 1.10.3
x264 + NeroAAC > Mp4box
x264
--crf 18 --profile high --preset placebo --level 4.1 --tune animation --bframes 2 --me esa --deblock -3:-1 --cplxblur 0 --qblur 0 --subme 10 --trellis 2 --aq-mode 2 --psy-rd 0.1:0.0 --nr 500 --keyint 15 --demuxer raw --input-res %(width)x%(height) --fps %(fpsnum)/%(fpsden) -o "%(tempvideofile)" -
NeroAAC (use virtualdub's audio resampling to 44k to 48k)
-cbr 320000 -lc -ignorelength -if - -of "%(tempaudiofile)"
Mp4Box
-no-sys -inter 500 -add "%(tempvideofile)" -add "%(tempaudiofile)" "%(outputname)" -fps %(fps)
https://support.google.com/youtube/answer/1722171?hl=en
or use handbrake.
Only the final recording should be in lossy x264.