FFmpeg command line options

I have found a command on this blog which works great to encode videos using H.265/HEVC in an Apple-compatible way:

ffmpeg -i input -c:v libx265 -preset fast -crf 28 -tag:v hvc1 -c:a aac -ac 2 -b:a 224k output

The command works perfectly and is exactly what I was looking for. However, while the blog describes most of the options used in the command, the I can't seem to find what -crf 28 does, or why it is necessary in the command.

Does anybody know what -crf 28 relates to as I've been unable to find an explanation online?

Thanks in advance!


Solution 1:

crf stands for Constant Rate Factor. Metrics are the same for x264 and x265, but the scale is slightly different. More info can be found on this here

https://trac.ffmpeg.org/wiki/Encode/H.265

i find a good balance at using

-crf 25 -preset slow

Generally the lower the number, the better the quality but the longer it will take.