[FFmpeg-trac] #11292(avcodec:open): AMD Hardware Encoding is Broken in versions >= 7.1

FFmpeg trac at avcodec.org
Mon Nov 11 18:16:26 EET 2024


#11292: AMD Hardware Encoding is Broken in versions >= 7.1
------------------------------------+-----------------------------------
             Reporter:  TanMan      |                    Owner:  (none)
                 Type:  defect      |                   Status:  open
             Priority:  important   |                Component:  avcodec
              Version:  git-master  |               Resolution:
             Keywords:              |               Blocked By:
             Blocking:              |  Reproduced by developer:  0
Analyzed by developer:  0           |
------------------------------------+-----------------------------------
Comment (by Roman):

 1. The correct command line is expect to be:

    `ffmpeg.exe -i input.mp4 -c:v h264_amf -b:v 1M -max_rate 1.6M out.mp4`

 2. If the command line is without `-max_rate`, then there is a warning
 message “rate control mode is `PEAK_CONSTRAINED_VBR`, but rc_max_rate is
 not set”. The encoding will still work normally, and the default max_rate
 of 1.5x  (1.5 * bitrate) will be applied.

    `ffmpeg.exe -i input.mp4 -c:v h264_amf -b:v 1M  out.mp4`

 3. If the command line is without `-b:v 1M`, then a default bitrate of
 20Mbps will be applied.

    `ffmpeg.exe -i input.mp4 -c:v h264_amf   out.mp4`

 4. Considering the reported case plus `-maxrate`,

    `ffmpeg  -i input -c:v hevc_amf -maxrate 2000k output`

 Since the command line does not specify the bitrate `-b:v`, then the
 default bitrate of 20M will be applied by AMF.
 Since the `-maxrate 2000k` is smaller than the default bitrate of 20M,
 then the `-maxrate 2000k` will be ignored and won’t take effect.
 As a result, a large file will be produced where the actual bitrate is
 20M.

 A patch will be submitted to remove the warning message “rate control mode
 is `PEAK_CONSTRAINED_VBR`, but rc_max_rate is not set”. It brought a
 little confusion.

 For the bitrate parameter `-b:v`, we previously set it to 2M in FFmpeg,
 but it has now been changed to -1. In AMF, the default value is 20M. This
 explains the difference seen between past and present behavior.
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/11292#comment:6>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list