0

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!

1 Answer 1

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.

3
  • Thanks, that makes sense! What has greater effect, the crf or the preset? For example using the fast preset but crf 25? Also, do you think there is a big difference between the presets, and what is the difference in quality like between crf 25 and 28? Thanks again!
    – Rocco
    Commented Dec 13, 2021 at 23:18
  • 1
    you bet. regarding the crf's and presets, there's a ton of nuances here: quality of source file, gpu vs cpu transcoding, etc. as for the difference in presets, there's definitely a difference when it comes to processing time. i prefer cpu transcoding (better quality than gpu, but slower), so i tend to lean slightly more to quality than speed. that said, anything slower than "slow" to me is too long. would sometimes take a day or more just to do one file depending on size. crf has to do with bitrate. with "slow" set at 25, i feel like its a better quality at an optimum bitrate and file size.
    – jpaige5408
    Commented Dec 14, 2021 at 5:40
  • 1
    That's great, thanks for giving some more info on CRFs and presets, I'll have a play around and see what's best!
    – Rocco
    Commented Dec 14, 2021 at 19:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .