Opened 8 months ago

Last modified 8 months ago

#7654 new defect

hevc_amf does not honor -level option

Reported by: Tupsi Owned by:
Priority: minor Component: avcodec
Version: git-master Keywords: amf
Cc: 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)

err.txt (1.1 MB) - added by Tupsi 8 months ago.

Download all attachments as: .zip

Change History (5)

comment:1 Changed 8 months ago by Tupsi

I manged to catch a glimpse of the error with -loglevel trace (I hope, no clue about C sorry)

[AVFilterGraph @ 000001561e8dcb80] query_formats: 4 queried, 3 merged, 0 already done, 0 delayed
[hevc_amf @ 000001561e500380] AMFDeviceDX11Impl: 2019-01-04 18:59:02.231     1E58 [AMFDeviceDX11Impl]   Debug: InitDX11() created HW DX11.1 device
[hevc_amf @ 000001561e500380] AMFDeviceDX11Impl: 2019-01-04 18:59:03.117     1E58 [AMFDeviceDX11Impl]   Debug: InitDX11() created HW DX11 device
[hevc_amf @ 000001561e500380] AMF initialisation succeeded via D3D11.
[hevc_amf @ 000001561e500380] EncoderUVEHEVCImpl: 2019-01-04 18:59:03.133     1E58 [EncoderUVEHEVCImpl]    Info: SetProperty HevcUsage:0
[hevc_amf @ 000001561e500380] EncoderUVEHEVCImpl: 2019-01-04 18:59:03.133     1E58 [EncoderUVEHEVCImpl]    Info: SetProperty HevcFrameSize:1916,1076
[hevc_amf @ 000001561e500380] EncoderUVEHEVCImpl: 2019-01-04 18:59:03.134     1E58 [EncoderUVEHEVCImpl]    Info: SetProperty HevcFrameRate:24000,1001
[hevc_amf @ 000001561e500380] EncoderUVEHEVCImpl: 2019-01-04 18:59:03.134     1E58 [EncoderUVEHEVCImpl]    Info: SetProperty HevcProfile:1
[hevc_amf @ 000001561e500380] EncoderUVEHEVCImpl: 2019-01-04 18:59:03.134     1E58 [EncoderUVEHEVCImpl]    Info: SetProperty HevcTier:1
[hevc_amf @ 000001561e500380] EncoderUVEHEVCImpl: 2019-01-04 18:59:03.134     1E58 [EncoderUVEHEVCImpl]    Info: SetProperty HevcProfileLevel:-99
[hevc_amf @ 000001561e500380] PropertyStorageExImpl: 2019-01-04 18:59:03.135     1E58 [PropertyStorageExImpl]   Error: c:\constructicon\builds\gfx\six\18.50\drivers\amf\stable\public/common/PropertyStorageExImpl.h(286):AMF_ERROR 4 : AMF_INVALID_ARG: Property=HevcProfileLevel
[hevc_amf @ 000001561e500380] EncoderUVEHEVCImpl: 2019-01-04 18:59:03.135     1E58 [EncoderUVEHEVCImpl] Warning: SetProperty HevcProfileLevel failed in AMFPropertyStorageExImpl with return code:0x4, and will not set driver either, but return ok for now!
[hevc_amf @ 000001561e500380] EncoderUVEHEVCImpl: 2019-01-04 18:59:03.135     1E58 [EncoderUVEHEVCImpl]    Info: SetProperty HevcQualityPreset:0

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.

comment:2 Changed 8 months ago by Tupsi

  • Component changed from ffmpeg to avcodec

comment:3 Changed 8 months ago by cehoyos

  • Keywords amf added; hevc_amf level removed
  • Priority changed from normal to minor

Please provide your (simplified) command line together with the complete, uncut console output to make this a valid ticket.

Changed 8 months ago by Tupsi

comment:4 Changed 8 months ago by Tupsi

added debug log as attachment.

simplified commandline is:

ffmpeg.exe -i .\input.mkv -c:v hevc_amf -level:v 5.0 output.mkv

Note: See TracTickets for help on using tickets.