[FFmpeg-devel] Fix Profile level option on AMF HEVC.

sitan Liu nst799610810 at gmail.com
Fri Oct 11 13:37:24 EEST 2019


Hello there! I want to share a ffmpeg patch about hevc_amf encoding. When I
use AMD AMF as the ffmpeg encoder, the Profile Level and Max Reframes I set
do not take effect. Even if I set the video output level to 4.1, the
resulting video file is always level 6.2. It should be noted that this
problem only occurs in hevc_amf, and h264_amf is all right. After looking
at the full ffmpeg log I found the cause of the error and gave a solution.
During the period I referred to the official documentation of AMD AMF. The
HEVC Profile Level preset given by AMD is 6.2. Due to the wrong If
statement, ffmpeg did not pass the correct Profile Level to the hardware,
so it was output with the default 6.2. The error of Max Reframes is also a
similar reason. I made a simple correction with reference to the
documentation and some of the code for h264_amf. After that I recompiled
ffmpeg for verification, and it turned out that my approach was correct.
Please help me review this part of the code and merge if possible. This is
very helpful for my video editing with my AMD gfx. This is my first time
published here. Please understand if the format is incorrect. Thank you
very much!

My Pull request: https://github.com/nyanmisaka/FFmpeg/pull/1

Little change in libavcodec/amfenc_hevc.c:
[image: image.png]

Two posts containing this bug:
https://trac.ffmpeg.org/ticket/7654
https://www.voukoder.org/forum/thread/407-profile-level-option-not-work-on-amf-hevc/


AMD AMF Doc:
https://github.com/GPUOpen-LibrariesAndSDKs/AMF/blob/master/amf/doc/AMF_Video_Encode_HEVC_API.pdf
<https://trac.ffmpeg.org/ticket/7654>
[image: image.png]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 114314 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20191011/ac4b511c/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 48191 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20191011/ac4b511c/attachment-0001.png>


More information about the ffmpeg-devel mailing list