Basically it is the following command but with proper checks and for multiple files: ffmpeg -i input.video -vcodec libx265 -crf output.mp4