2

I am trying to compress some of my video collections with ffmpeg, and I wish to accelerate it with my RX 6900XT.

For libx265, I know that I can use the following command:

ffmpeg -i input.mp4 -v:c libx265 -crf 24 output.mp4

However, the -crf flag is ignored by hevc_amf encoder.

I tried ffmpeg -h encoder=hevc_amf, and it seems that there are flags like -rc cqp to set a constant quantization parameter, CQP, which behaves similar to CRF (it seems that CRF is still a little bit more advanced allowing variable QP during the process), but I don't know how to specify a reasonable value for that option, and I wish to know if there are better approaches that work similarly to the CRF option for libx265?

1
  • 1
    I haven't used the AMF codec, but according to the help the quality is set with the -quality <value> (from 0 to 10) option, in addition to -rc cqp. Why not experimenting by yourself about the values ? There's apparently no CRF-like mode, the GPU encoders are usually much less flexible than x264/x265
    – PierU
    Commented Sep 13, 2022 at 6:48

3 Answers 3

3

hevc_amf does not have a -qp option, so you can not use what was said above, but you can use -qp_i and -qp_p together with -rc.

ffmpeg -i input.mp4 -c:v hevc_amf -rc cqp -qp_i 24 -qp_p 24 output.mp4

0

You can use -rc 0 and -qp 30 for example. The -qp parameter can be from 0 to 52, where 0 is the best quality and 52 is the worst.

2
  • Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented Dec 27, 2022 at 3:47
  • 1
    Someone else has already given this same answer but with much more detail. Nothing wrong with answering late, but make sure you have new and useful information to add when you do. Commented Dec 27, 2022 at 4:36
-2

You can play with -crf [0 - 51], 17-18 no loss, 28 default] for 8 bit

[use -qp 0 ] for 10 bit

Read More: https://trac.ffmpeg.org/wiki/Encode/H.264#crf

or , select a -preset

-preset [fast, ultrafast, superfast, veryfast, faster, fast, medium, slow, slower, veryslow]

or a -tune

-tune [animation, grain, fastdecode, zerolatency]

Read more: https://trac.ffmpeg.org/wiki/Encode/H.265#Ratecontrolmodes

3
  • 1
    thanks for reply, yet these options only apply to H264 or H265 codecs, for hevc_amf these does not apply, and that is the reason that I asked.
    – wang1zhen
    Commented Sep 20, 2022 at 7:42
  • Thanks for clarifying, I thought that with hevc_amf, they work the same Commented Sep 22, 2022 at 19:05
  • This doesn't answer the question and should be retracted
    – adfaklsdjf
    Commented Aug 12, 2023 at 2:49

You must log in to answer this question.

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