#7654 closed defect (fixed)
hevc_amf does not honor -level option
Reported by: | Tupsi | Owned by: | |
---|---|---|---|
Priority: | minor | Component: | avcodec |
Version: | git-master | Keywords: | amf |
Cc: | cornofear@yahoo.ca, Marton Balint | Blocked By: | |
Blocking: | Reproduced by developer: | no | |
Analyzed by developer: | no |
Description
Summary of the bug:
How to reproduce:
% ffmpeg -i input.mkv -c:v hevc_amf -quality quality -level 50 -c:s copy -c:a copy output.mkv ffmpeg version N-92917-gb9523f2fd3 Copyright (c) 2000-2019 the FFmpeg developers built with gcc 8.2.1 (GCC) 20181201 configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
the resulting .mkv still has
Video ID : 1 Format : HEVC Format/Info : High Efficiency Video Coding Format profile : Main@L6.2@Main Codec ID : V_MPEGH/ISO/HEVC
show with ffprobe. 6.2 seems to be the auto level which currently is the highest. I tried all sorts of integer but it always ends in the same.
ffmpeg -h encoder=hevc_amf shows the following about level
-level <int> E..V..... Set the encoding level (default auto) (from 0 to 186) (default auto) auto E..V..... 1.0 E..V..... 2.0 E..V..... 2.1 E..V..... 3.0 E..V..... 3.1 E..V..... 4.0 E..V..... 4.1 E..V..... 5.0 E..V..... 5.1 E..V..... 5.2 E..V..... 6.0 E..V..... 6.1 E..V..... 6.2 E..V.....
so I even tried numbers like 50 in the hopes it means "5.1", as I do not understand how the 14 current options listed above are represented by integer number between 0 und 186 (which says so in the help). I tried both left the labels 5.0, 5.1, 4.0, even 1.0 as well as differnt integer numbers in between 0 and 186. Everything ends in Main@L6.2
Attachments (1)
Change History (19)
comment:1 by , 6 years ago
comment:2 by , 6 years ago
Component: | ffmpeg → avcodec |
---|
comment:3 by , 6 years ago
Keywords: | amf added; hevc_amf level removed |
---|---|
Priority: | normal → minor |
Please provide your (simplified) command line together with the complete, uncut console output to make this a valid ticket.
by , 6 years ago
comment:4 by , 6 years ago
added debug log as attachment.
simplified commandline is:
ffmpeg.exe -i .\input.mkv -c:v hevc_amf -level:v 5.0 output.mkv
follow-up: 9 comment:5 by , 5 years ago
Keywords: | hevc_amf added |
---|---|
Priority: | minor → normal |
I have the same issue, developers should have a look at the following example:
https://github.com/GPUOpen-LibrariesAndSDKs/AMF/blob/master/amf/public/samples/CPPSamples/common/EncoderParamsHEVC.cpp
The integer values for the levels are
AMF_LEVEL_1 = 30,
AMF_LEVEL_2 = 60,
AMF_LEVEL_2_1 = 63,
AMF_LEVEL_3 = 90,
AMF_LEVEL_3_1 = 93,
AMF_LEVEL_4 = 120,
AMF_LEVEL_4_1 = 123,
AMF_LEVEL_5 = 150,
AMF_LEVEL_5_1 = 153,
AMF_LEVEL_5_2 = 156,
AMF_LEVEL_6 = 180,
AMF_LEVEL_6_1 = 183,
AMF_LEVEL_6_2 = 186
Furthermore the encoded file is badly seekable and the following parameter is needed as well:
-gops_per_idr 1
This should be standard.
comment:6 by , 5 years ago
Keywords: | hevc_amf removed |
---|---|
Priority: | normal → minor |
comment:7 by , 5 years ago
Priority: | minor → critical |
---|
The problem is still unresolved, so I changed priority to critical for better response. Similar problem appears in hevc_nvenc encoder - there are fixed level 5.1: https://www.voukoder.org/forum/thread/407-profile-level-option-not-work-on-amf-hevc/?postID=2549#post2549
comment:8 by , 5 years ago
Priority: | critical → minor |
---|
comment:9 by , 5 years ago
Replying to lolmaster5000:
I have the same issue, developers should have a look at the following example:
https://github.com/GPUOpen-LibrariesAndSDKs/AMF/blob/master/amf/public/samples/CPPSamples/common/EncoderParamsHEVC.cpp
The integer values for the levels are
AMF_LEVEL_1 = 30,
AMF_LEVEL_2 = 60,
AMF_LEVEL_2_1 = 63,
AMF_LEVEL_3 = 90,
AMF_LEVEL_3_1 = 93,
AMF_LEVEL_4 = 120,
AMF_LEVEL_4_1 = 123,
AMF_LEVEL_5 = 150,
AMF_LEVEL_5_1 = 153,
AMF_LEVEL_5_2 = 156,
AMF_LEVEL_6 = 180,
AMF_LEVEL_6_1 = 183,
AMF_LEVEL_6_2 = 186
Furthermore the encoded file is badly seekable and the following parameter is needed as well:
-gops_per_idr 1
This should be standard.
I noticed that the ffmpeg file reports the correct level:int numbers at least, but it seems the whole -level:v is completly ignored if you try to use it and so always 6.2 is used (as I doubt somehow the default "auto" is actually working), because I just tried to encode an ancient dvd at its still sitting at 6.2.
With your gops_per_idr note I totally agree. The file is not usuable with the default, which is 60.
comment:10 by , 5 years ago
Priority: | minor → important |
---|
Still nothing changed.
I checked, and AMF HEVC encoder in HandBrake works much better and all options are being passed. So here we have an unrelated library from that in FFmpeg. The problem, of course, is in FFmpeg itself.
comment:11 by , 5 years ago
Priority: | important → minor |
---|
comment:12 by , 5 years ago
Cc: | added |
---|
follow-up: 17 comment:13 by , 5 years ago
Cc: | added |
---|---|
Resolution: | → invalid |
Status: | new → closed |
The command line is wrong.
-level 5.0 should be used, not -level 50.
Closing as invalid.
comment:14 by , 5 years ago
Resolution: | invalid |
---|---|
Status: | closed → reopened |
ffmpeg -h encoder=hevc_amf
-level <int> E..V...... Set the encoding level (default auto) (from 0 to 186) (default auto)
"from 0 to 186"
this needs to be fixed
comment:15 by , 5 years ago
0 to 186 is the numeric representation of the named constants "5.0" and similar. What we might do is not write the minimum and maximum integer value of the numeric representation because it seems to be misleading. Is this what you prefer?
comment:16 by , 5 years ago
In the original ticket Tupsi said:
'so I even tried numbers like 50 in the hopes it means "5.1", as I do not understand how the 14 current options listed above are represented by integer number between 0 und 186 (which says so in the help). I tried both left the labels 5.0, 5.1, 4.0, even 1.0 as well as differnt integer numbers in between 0 and 186.'
To avoid this problem, I'd suggest changing the help text to list the constants 'auto, 1.0, 2.0 etc,'
Even better would be to use the following code by AMD to parse this value: https://github.com/GPUOpen-LibrariesAndSDKs/AMF/blob/master/amf/public/samples/CPPSamples/common/EncoderParamsHEVC.cpp
comment:17 by , 5 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Replying to cus:
The command line is wrong.
-level 5.0 should be used, not -level 50.
Closing as invalid.
You did not take the time to read my whole ticket, because then you would have seen, that I also tried 5.0 and not only the 50 mentioned in the commandline example.
Doesnt matter, as I just downloaded a half current version from zeranoe (git from 20200628) and can clarify, that it is indead NOW working as intended, meaning, if you you use -level 5.1 you get Main@L5.1 and not the highest possible as it was before.
So whoever changed that to the better, THANK YOU for understanding the ticket and fixing it :-)
@cornofear
I just even tried -level 156 which according to the help should get me Main@L5.2 and it did! So both options work now, entering the human version as well as the machine version.
So I would suggest to close the ticket.
comment:18 by , 5 years ago
Ok, makes sense now. This was the fix then: c96837043e2e0a6449e0e6eb3d4119a834f9a0da
I manged to catch a glimpse of the error with -loglevel trace (I hope, no clue about C sorry)
you see there, that the encoder wants the profile_level set to -99 (while I tried 5.0 and then 186). Whatever you enter after -level gives you -99 here and the error afterwards.
From what it looks like, my current driver does not support the profile_level option any more?
hope that helps in the bug hunting.