I ought to have done this for myself a long time ago anyway. Of course it depends on the file you’re encoding, but this tends to work:

ffmpeg.exe -y -i input.avi -f flv -qscale 5 -r 25 -ar 44100 -ab 96 -s 500×374 output.flv

Full FFmpeg documentation can be found here.