Your command will do it but the chief draw of x264 is the ability to provide high compression while maintaining subjective visual transparency. x264 will be of modest use if you keep to strict lossless mode. I suggest trying the following command:
ffmpeg -i input -c:v libx264 -preset veryslow -crf 18 output.mp4
If you don't like the quality, lower the CRF value.