Scaling videos of variable size to a fixed aspect ratio
Use

ffmpeg -i "input.mov" -vf 
          "scale='if(gt(a*sar,16/9),640,360*iw*sar/ih)':'if(gt(a*sar,16/9),640*ih/iw/sar,360)',
          pad=640:360:(ow-iw)/2:(oh-ih)/2,setsar=1"
       -vcodec libx264 -b:v 1600k -bufsize:v 1600k -r 30000/1001 output.mp4


The scale filters use the conditional if(a,b,c) expression i.e. if a then b else c. I check if the video is wider than 16:9. If yes, I scale the width to 640 and scale height to preserve proportion. If not, I scale height to 360, and keep width proportional. Then the result is padded out to 640x360. The setsar is used to make sure ffmpeg registers the video as square-pixel.