Change $file to the file you wanta to convert and $file-h264 is the name of the converted file.
ffmpeg -i $file -c:v libx264 -profile:v high -preset slow -tune -film -crf 18 $file-h264.mp4
Of course you can adapter the -c:v libx264 to any other format you might want.
Here is a handy script to mass convert to h264:
for file in `ls *.mp4`; do
echo ffmpeg -i $file -c:v libx264 -profile:v high -preset slow -tune -film -crf 18 $file-h264.mp4
done
ffmpeg, convert, format, eg, wanta, converted, libx, preset, crf, mp, adapter, ls, echo,