Encoding on CPU can be done via:
ffmpeg -i input.mp4 -vcodec h264 -crf 23 -acodec copy h264.mp4
GPU's alternative for the codec is
h264_nvenc. How can I pass the same options to it?
I googled and came to following command:
ffmpeg -i input.mp4 -vcodec h264_nvenc -rc constqp -qp 23 -acodec copy h264_nvenc.mp4
But the file I get is much larger. And with other options quality is much worther.