We look at a representative command for each vendor and point out how they differ from the software command. The option numbers are examples and need to be re-tuned for each machine.
The examples below show the shape of the command. The input file and bitrate numbers are just placeholders, so change them to fit your own hardware and video. Option names can vary with the ffmpeg version and driver, so if you get stuck, check your build's own help first, for example ffmpeg -h encoder=hevc_nvenc.
ffmpeg -i input.mp4 -c:v libx265 -preset slow -crf 22 -c:a copy output.mp4ffmpeg -i input.mp4 -c:v hevc_nvenc -preset p5 -rc vbr -cq 28 -b:v 0 -c:a copy output.mp4-preset p1 to p7: the higher the number, the slower it is and the more it favors quality. The -cq value is not on the same scale as x265's -crf. The same number won't give the same quality, so you have to measure to pick a value. HEVC encoding requires that GPU generation to support HEVC encoding; if it doesn't, use h264_nvenc.
ffmpeg -i input.mp4 -c:v hevc_qsv -preset slower -global_quality 25 -c:a copy output.mp4ffmpeg -i input.mp4 -c:v hevc_amf -quality quality -b:v 6M -c:a copy output.mp4ffmpeg -i input.mp4 -c:v hevc_videotoolbox -b:v 6M -tag:v hvc1 -c:a copy output.mp4-tag:v hvc1 is a tag commonly added so that Apple devices and QuickTime-family players recognize HEVC stored in MP4.
ffmpeg -vaapi_device /dev/dri/renderD128 -i input.mp4 -vf 'format=nv12,hwupload' -c:v h264_vaapi -qp 24 -c:a copy output.mp4The commands above are written on one line. If you split a long command across lines, in bash the line break must come immediately after the \ at the end of the line. If you put a space or a # comment after the \, the command breaks off there and fails. Put your notes on a separate line above the command.
If assembling commands is a hassle, it's easy to build the software baseline with the ffmpeg command builder, then swap in only the encoder name and quality option from the examples above.
An ffmpeg filter that uploads frames from CPU memory to GPU memory. Used in VAAPI encoding and elsewhere.
NVENC's quality-target option. Similar in idea to CRF, but the values are on a different scale.
The quality-target option of the Quick Sync encoder. Lower values mean higher quality.
What happens if you change -c:v libx265 -crf 22 to -c:v hevc_nvenc -cq 22?