Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#8386 closed defect (fixed)

AMF encoders not working

Reported by: Adrianwo Owned by:
Priority: important Component: avcodec
Version: git-master Keywords: amf crash abort regression
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

AMF encoders doesn't work properly now, on any video input (on example as written below, an AviSynth+ script) always generating error "Assertion !avpkt->data
avpkt->buf failed at src/libavcodec/encode.c:438". Tested on Vega 11 graphics integrated in AMD Ryzen 5 3400G processor with newest drivers (version 19.11.3), running Windows 10 Home version 1909.

How to reproduce:

ffmpeg -report -hwaccel d3d11va -i "D:\QTGMCAvi.avs" -c:v hevc_amf -b:v 4000000 -aspect 4:3 -c:a ac3 -b:a 640000 -metadata:s:a:0 "language=ru-RU" "D:\sonpoltv1.mkv"
ffmpeg version git-2019-11-19-0321bde Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 9.2.1 (GCC) 20191010
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --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-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
  libavutil      56. 36.100 / 56. 36.100
  libavcodec     58. 62.100 / 58. 62.100
  libavformat    58. 35.100 / 58. 35.100
  libavdevice    58.  9.101 / 58.  9.101
  libavfilter     7. 66.100 /  7. 66.100
  libswscale      5.  6.100 /  5.  6.100
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100
Splitting the commandline.
Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'.
Reading option '-hwaccel' ... matched as option 'hwaccel' (use HW accelerated decoding) with argument 'd3d11va'.
Reading option '-i' ... matched as input url with argument 'D:\QTGMCAvi.avs'.
Reading option '-c:v' ... matched as option 'c' (codec name) with argument 'hevc_amf'.
Reading option '-b:v' ... matched as option 'b' (video bitrate (please use -b:v)) with argument '4000000'.
Reading option '-aspect' ... matched as option 'aspect' (set aspect ratio (4:3, 16:9 or 1.3333, 1.7777)) with argument '4:3'.
Reading option '-c:a' ... matched as option 'c' (codec name) with argument 'ac3'.
Reading option '-b:a' ... matched as option 'b' (video bitrate (please use -b:v)) with argument '640000'.
Reading option '-metadata:s:a:0' ... matched as option 'metadata' (add metadata) with argument 'language=ru-RU'.
Reading option 'D:\sonpoltv1.mkv' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option report (generate a report) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input url D:\QTGMCAvi.avs.
Applying option hwaccel (use HW accelerated decoding) with argument d3d11va.
Successfully parsed a group of options.
Opening an input file: D:\QTGMCAvi.avs.
[NULL @ 000001b90a42b840] Opening 'D:\QTGMCAvi.avs' for reading
[file @ 000001b90a42c880] Setting default whitelist 'file,crypto'
[avisynth @ 000001b90a42b840] Format avisynth probed with size=2048 and score=50
[avisynth @ 000001b90a42b840] Before avformat_find_stream_info() pos: 0 bytes read:128 seeks:0 nb_streams:2
[avisynth @ 000001b90a42b840] All info found
[avisynth @ 000001b90a42b840] After avformat_find_stream_info() pos: 0 bytes read:128 seeks:0 frames:3
Guessed Channel Layout for Input Stream #0.1 : stereo
Input #0, avisynth, from 'D:\QTGMCAvi.avs':
  Duration: 01:24:43.52, start: 0.000000, bitrate: N/A
    Stream #0:0, 2, 1/50: Video: rawvideo (I420 / 0x30323449), yuv420p, 720x576, 50 fps, 50 tbr, 50 tbn, 50 tbc
    Stream #0:1, 1, 1/48000: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
Successfully opened the file.
Parsing a group of options: output url D:\sonpoltv1.mkv.
Applying option c:v (codec name) with argument hevc_amf.
Applying option b:v (video bitrate (please use -b:v)) with argument 4000000.
Applying option aspect (set aspect ratio (4:3, 16:9 or 1.3333, 1.7777)) with argument 4:3.
Applying option c:a (codec name) with argument ac3.
Applying option b:a (video bitrate (please use -b:v)) with argument 640000.
Applying option metadata:s:a:0 (add metadata) with argument language=ru-RU.
Successfully parsed a group of options.
Opening an output file: D:\sonpoltv1.mkv.
[file @ 000001b90a4c5200] Setting default whitelist 'file,crypto'
Successfully opened the file.
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> hevc (hevc_amf))
  Stream #0:1 -> #0:1 (pcm_s16le (native) -> ac3 (native))
Press [q] to stop, [?] for help
cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
[rawvideo @ 000001b90a42fc00] PACKET SIZE: 622080, STRIDE: 1080
detected 8 logical cores
[graph 0 input from stream 0:0 @ 000001b90a4cc940] Setting 'video_size' to value '720x576'
[graph 0 input from stream 0:0 @ 000001b90a4cc940] Setting 'pix_fmt' to value '0'
[graph 0 input from stream 0:0 @ 000001b90a4cc940] Setting 'time_base' to value '1/50'
[graph 0 input from stream 0:0 @ 000001b90a4cc940] Setting 'pixel_aspect' to value '0/1'
[graph 0 input from stream 0:0 @ 000001b90a4cc940] Setting 'sws_param' to value 'flags=2'
[graph 0 input from stream 0:0 @ 000001b90a4cc940] Setting 'frame_rate' to value '50/1'
[graph 0 input from stream 0:0 @ 000001b90a4cc940] w:720 h:576 pixfmt:yuv420p tb:1/50 fr:50/1 sar:0/1 sws_param:flags=2
[format @ 000001b90a4ccf40] Setting 'pix_fmts' to value 'nv12|yuv420p|d3d11|dxva2_vld'
[AVFilterGraph @ 000001b90a42f5c0] query_formats: 4 queried, 3 merged, 0 already done, 0 delayed
[hevc_amf @ 000001b90a432540] AMFDeviceDX11Impl: 2019-11-19 23:21:59.461     1824 [AMFDeviceDX11Impl]   Debug: InitDX11() created HW DX11.1 device

[hevc_amf @ 000001b90a432540] AMFDeviceDX11Impl: 2019-11-19 23:21:59.461     1824 [AMFDeviceDX11Impl]   Debug: InitDX11() created HW DX11 device

[hevc_amf @ 000001b90a432540] AMF initialisation succeeded via D3D11.
[hevc_amf @ 000001b90a432540] EncoderUVEHEVCImpl: 2019-11-19 23:21:59.461     1824 [EncoderUVEHEVCImpl]    Info: SetProperty HevcUsage:0

[hevc_amf @ 000001b90a432540] EncoderUVEHEVCImpl: 2019-11-19 23:21:59.461     1824 [EncoderUVEHEVCImpl]    Info: SetProperty HevcFrameSize:720,576

[hevc_amf @ 000001b90a432540] EncoderUVEHEVCImpl: 2019-11-19 23:21:59.461     1824 [EncoderUVEHEVCImpl]    Info: SetProperty HevcFrameRate:50,1

[hevc_amf @ 000001b90a432540] EncoderUVEHEVCImpl: 2019-11-19 23:21:59.461     1824 [EncoderUVEHEVCImpl]    Info: SetProperty HevcProfile:1

[hevc_amf @ 000001b90a432540] EncoderUVEHEVCImpl: 2019-11-19 23:21:59.461     1824 [EncoderUVEHEVCImpl]    Info: SetProperty HevcTier:0

[hevc_amf @ 000001b90a432540] EncoderUVEHEVCImpl: 2019-11-19 23:21:59.461     1824 [EncoderUVEHEVCImpl]    Info: SetProperty HevcProfileLevel:-99

[hevc_amf @ 000001b90a432540] PropertyStorageExImpl: 2019-11-19 23:21:59.461     1824 [PropertyStorageExImpl]   Error: c:\constructicon\builds\gfx\six\19.30\drivers\amf\stable\public/common/PropertyStorageExImpl.h(286):AMF_ERROR 4 : AMF_INVALID_ARG: Property=HevcProfileLevel

[hevc_amf @ 000001b90a432540] EncoderUVEHEVCImpl: 2019-11-19 23:21:59.461     1824 [EncoderUVEHEVCImpl] Warning: SetProperty HevcProfileLevel failed in AMFPropertyStorageExImpl with return code:0x4, and will not set driver either, but return ok for now!

[hevc_amf @ 000001b90a432540] EncoderUVEHEVCImpl: 2019-11-19 23:21:59.461     1824 [EncoderUVEHEVCImpl]    Info: SetProperty HevcQualityPreset:10

[hevc_amf @ 000001b90a432540] AMFEncoderHEVC: 2019-11-19 23:21:59.461     1824 [AMFEncoderHEVC]    Info: UVEHEVCApplySpeedQualityPreset is 10

[hevc_amf @ 000001b90a432540] EncoderUVEHEVCImpl: 2019-11-19 23:21:59.461     1824 [EncoderUVEHEVCImpl]    Info: SetProperty HevcMaxNumRefFrames:-1

[hevc_amf @ 000001b90a432540] EncoderUVEHEVCImpl: 2019-11-19 23:21:59.461     1824 [EncoderUVEHEVCImpl] Warning: SetProperty HevcMaxNumRefFrames failed in AMFPropertyStorageExImpl with return code:0x5, and will not set driver either, but return ok for now!

[hevc_amf @ 000001b90a432540] EncoderUVEHEVCImpl: 2019-11-19 23:21:59.461     1824 [EncoderUVEHEVCImpl]    Info: SetProperty HevcAspectRatio:16,15

[hevc_amf @ 000001b90a432540] EncoderUVEHEVCImpl: 2019-11-19 23:21:59.461     1824 [EncoderUVEHEVCImpl]    Info: SetProperty HevcGOPSPerIDR:60

[hevc_amf @ 000001b90a432540] EncoderUVEHEVCImpl: 2019-11-19 23:21:59.461     1824 [EncoderUVEHEVCImpl]    Info: SetProperty HevcGOPSize:250

[hevc_amf @ 000001b90a432540] EncoderUVEHEVCImpl: 2019-11-19 23:21:59.461     1824 [EncoderUVEHEVCImpl]    Info: SetProperty HevcDeBlockingFilter:false

[hevc_amf @ 000001b90a432540] EncoderUVEHEVCImpl: 2019-11-19 23:21:59.461     1824 [EncoderUVEHEVCImpl]    Info: SetProperty HevcHeaderInsertionMode:0

[hevc_amf @ 000001b90a42f440] Rate control turned to CBR
[hevc_amf @ 000001b90a432540] EncoderUVEHEVCImpl: 2019-11-19 23:21:59.461     1824 [EncoderUVEHEVCImpl]    Info: SetProperty HevcRateControlMethod:3

[hevc_amf @ 000001b90a432540] EncoderUVEHEVCImpl: 2019-11-19 23:21:59.461     1824 [EncoderUVEHEVCImpl]    Info: SetProperty HevcRateControlPreAnalysisEnable:false

[hevc_amf @ 000001b90a432540] EncoderUVEHEVCImpl: 2019-11-19 23:21:59.461     1824 [EncoderUVEHEVCImpl]    Info: SetProperty HevcEnableVBAQ:false

[hevc_amf @ 000001b90a432540] EncoderUVEHEVCImpl: 2019-11-19 23:21:59.461     1824 [EncoderUVEHEVCImpl]    Info: SetProperty HevcHalfPixel:true

[hevc_amf @ 000001b90a432540] EncoderUVEHEVCImpl: 2019-11-19 23:21:59.461     1824 [EncoderUVEHEVCImpl]    Info: SetProperty HevcQuarterPixel:true

[hevc_amf @ 000001b90a432540] EncoderUVEHEVCImpl: 2019-11-19 23:21:59.461     1824 [EncoderUVEHEVCImpl]    Info: SetProperty HevcEnforceHRD:false

[hevc_amf @ 000001b90a432540] EncoderUVEHEVCImpl: 2019-11-19 23:21:59.461     1824 [EncoderUVEHEVCImpl]    Info: SetProperty HevcFillerDataEnable:false

[hevc_amf @ 000001b90a432540] EncoderUVEHEVCImpl: 2019-11-19 23:21:59.461     1824 [EncoderUVEHEVCImpl]    Info: SetProperty HevcTargetBitrate:4000000

[hevc_amf @ 000001b90a432540] EncoderUVEHEVCImpl: 2019-11-19 23:21:59.461     1824 [EncoderUVEHEVCImpl]    Info: SetProperty HevcPeakBitrate:4000000

[hevc_amf @ 000001b90a432540] AMFEncoderHEVC: 2019-11-19 23:21:59.461     1824 [AMFEncoderHEVC]    Info: UVEHEVCApplySpeedQualityPreset is 10

[hevc_amf @ 000001b90a432540] EncoderUVEHEVCImpl: 2019-11-19 23:21:59.461     1824 [EncoderUVEHEVCImpl]    Info: SetProperty HevcSliceControlSize:108

[hevc_amf @ 000001b90a432540] EncoderUVEHEVCImpl: 2019-11-19 23:21:59.477     1824 [EncoderUVEHEVCImpl]    Info: SetProperty HevcSliceControlSize:108

[hevc_amf @ 000001b90a432540] EncoderUVEHEVCImpl: 2019-11-19 23:21:59.477     1824 [EncoderUVEHEVCImpl]    Info: SetProperty HevcMaxAUSize:0

[hevc_amf @ 000001b90a432540] EncoderUVEHEVCImpl: 2019-11-19 23:21:59.477     1824 [EncoderUVEHEVCImpl]    Info: SetProperty HevcMinQP_I:2

[hevc_amf @ 000001b90a432540] EncoderUVEHEVCImpl: 2019-11-19 23:21:59.477     1824 [EncoderUVEHEVCImpl]    Info: SetProperty HevcMaxQP_I:31

[hevc_amf @ 000001b90a432540] EncoderUVEHEVCImpl: 2019-11-19 23:21:59.477     1824 [EncoderUVEHEVCImpl]    Info: SetProperty HevcMinQP_P:2

[hevc_amf @ 000001b90a432540] EncoderUVEHEVCImpl: 2019-11-19 23:21:59.477     1824 [EncoderUVEHEVCImpl]    Info: SetProperty HevcMaxQP_P:31

[hevc_amf @ 000001b90a432540] EncoderUVEHEVCImpl: 2019-11-19 23:21:59.477     1824 [EncoderUVEHEVCImpl]    Info: SetProperty HevcRateControlSkipFrameEnable:false

Clipping frame in rate conversion by 0.000008
[hevc_amf @ 000001b90a432540] AMFEncoderHEVC: 2019-11-19 23:21:59.477     1824 [AMFEncoderHEVC]   Trace: SubmitInput() End: frame pts=0 inputFrames=1, TaskID=2

cur_dts is invalid st:0 (0) [init:1 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
cur_dts is invalid st:1 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
[graph_1_in_0_1 @ 000001b90a4d2e40] Setting 'time_base' to value '1/48000'
[graph_1_in_0_1 @ 000001b90a4d2e40] Setting 'sample_rate' to value '48000'
[graph_1_in_0_1 @ 000001b90a4d2e40] Setting 'sample_fmt' to value 's16'
[graph_1_in_0_1 @ 000001b90a4d2e40] Setting 'channel_layout' to value '0x3'
[graph_1_in_0_1 @ 000001b90a4d2e40] tb:1/48000 samplefmt:s16 samplerate:48000 chlayout:0x3
[format_out_0_1 @ 000001b90a4d3d40] Setting 'sample_fmts' to value 'fltp'
[format_out_0_1 @ 000001b90a4d3d40] Setting 'channel_layouts' to value '0x4|0x3|0x103|0x7|0x603|0x33|0x107|0x607|0x37|0xc|0xb|0x10b|0xf|0x60b|0x3b|0x10f|0x60f|0x3f'
[format_out_0_1 @ 000001b90a4d3d40] auto-inserting filter 'auto_resampler_0' between the filter 'Parsed_anull_0' and the filter 'format_out_0_1'
[AVFilterGraph @ 000001b90a4d7500] query_formats: 4 queried, 6 merged, 3 already done, 0 delayed
[auto_resampler_0 @ 000001b90a4d4140] [SWR @ 000001b90a4dca00] Using s16p internally between filters
[auto_resampler_0 @ 000001b90a4d4140] ch:2 chl:stereo fmt:s16 r:48000Hz -> ch:2 chl:stereo fmt:fltp r:48000Hz
[matroska @ 000001b90a42eb00] get_metadata_duration returned: 0
Output #0, matroska, to 'D:\sonpoltv1.mkv':
  Metadata:
    encoder         : Lavf58.35.100
    Stream #0:0, 0, 1/1000: Video: hevc (hevc_amf), yuv420p(progressive), 720x576 [SAR 16:15 DAR 4:3], q=2-31, 4000 kb/s, 50 fps, 1k tbn, 50 tbc
    Metadata:
      encoder         : Lavc58.62.100 hevc_amf
    Stream #0:1(ru-RU), 0, 1/1000: Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, stereo, fltp, 640 kb/s
    Metadata:
      encoder         : Lavc58.62.100 ac3
cur_dts is invalid st:0 (0) [init:1 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
cur_dts is invalid st:1 (0) [init:1 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
[rawvideo @ 000001b90a42fc00] PACKET SIZE: 622080, STRIDE: 1080
[hevc_amf @ 000001b90a432540] AMFEncoderHEVC: 2019-11-19 23:21:59.492     1824 [AMFEncoderHEVC]   Trace: SubmitInput() End: frame pts=1 inputFrames=2, TaskID=3

[hevc_amf @ 000001b90a432540] AMFEncoderHEVC: 2019-11-19 23:21:59.492     1824 [AMFEncoderHEVC]   Debug: QueryOutput() End: frame pts=0 outputFrames=1

Assertion !avpkt->data || avpkt->buf failed at src/libavcodec/encode.c:438

Change History (2)

comment:1 by James, 5 years ago

Analyzed by developer: set
Priority: criticalimportant
Resolution: fixed
Status: newclosed

comment:2 by Carl Eugen Hoyos, 5 years ago

Analyzed by developer: unset
Keywords: amf crash abort regression added
Note: See TracTickets for help on using tickets.