Opened 2 years ago

Last modified 2 years ago

#8068 new enhancement

vaapi/nvdec/dxva2 hw decode failed for vp9 clips with resolution changing in Inter frame

Reported by: Linjie.Fu Owned by:
Priority: wish Component: avcodec
Version: git-master Keywords: vp9 vaapi
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:

VP9 allows resolution changes per frame. Currently in hardware decoder including vaapi/nvdec/dxva2, resolution change leads to hardware context destroy/recreate. This will cause reference frame surface lost if the resolution change happens in inter frame and produce garbage or lead to a decode failure.

Had some discussions in mail list already, but since it's a common issue exists for maybe all hardware codec, we may need a ticket to trace this and find a proper solution in general part in ffmpeg.

clips:
lena_resolution_change_on_inter_frame.ivf:
resolution changes on the 50th frame(inter frame)

lena.ivf:
resolution changes on 50th frame (key frame)

How to reproduce:

NVDEC: no runtime error, but has garbage after resolution changes.
%ffmpeg -v verbose -hwaccel nvdec -i ./lena_resolution_change_on_inter_frame.ivf  -f rawvideo out.yuv
ffmpeg version N-94373-g116303cd24 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 7 (Ubuntu 7.3.0-27ubuntu1~18.04)
  configuration: --prefix=/opt/media/ --enable-shared --enable-vaapi --enable-libmfx --enable-gpl --enable-libx264 --enable-libx265 --enable-cuda --enable-cuvid --enable-nvenc --enable-nonfree --enable-libnpp --extra-cflags=-I/usr/local/cuda/include --extra-ldflags=-L/usr/local/cuda/lib64
  libavutil      56. 32.100 / 56. 32.100
  libavcodec     58. 55.100 / 58. 55.100
  libavformat    58. 30.100 / 58. 30.100
  libavdevice    58.  9.100 / 58.  9.100
  libavfilter     7. 58.100 /  7. 58.100
  libswscale      5.  6.100 /  5.  6.100
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100
Input #0, ivf, from './lena_resolution_change_on_inter_frame.ivf':
  Duration: 00:00:04.00, start: 0.000000, bitrate: 237 kb/s
    Stream #0:0: Video: vp9 (Profile 0), 1 reference frame (VP90 / 0x30395056), yuv420p(tv), 352x288, 25 tbr, 25 tbn, 25 tbc
File 'out.yuv' already exists. Overwrite ? [y/N] y
Stream mapping:
  Stream #0:0 -> #0:0 (vp9 (native) -> rawvideo (native))
Press [q] to stop, [?] for help
[vp9 @ 0x555879049f80] NVDEC capabilities:
[vp9 @ 0x555879049f80] format supported: yes, max_mb_count: 262144
[vp9 @ 0x555879049f80] min_width: 128, max_width: 8192
[vp9 @ 0x555879049f80] min_height: 128, max_height: 8192
[graph 0 input from stream 0:0 @ 0x5558790b4700] w:352 h:288 pixfmt:nv12 tb:1/25 fr:25/1 sar:0/1 sws_param:flags=2
Output #0, rawvideo, to 'out.yuv':
  Metadata:
    encoder         : Lavf58.30.100
    Stream #0:0: Video: rawvideo, 1 reference frame (NV12 / 0x3231564E), nv12, 352x288, q=2-31, 30412 kb/s, 25 fps, 25 tbn, 25 tbc
    Metadata:
      encoder         : Lavc58.55.100 rawvideo
[vp9 @ 0x5558790a0540] NVDEC capabilities:
[vp9 @ 0x5558790a0540] format supported: yes, max_mb_count: 262144
[vp9 @ 0x5558790a0540] min_width: 128, max_width: 8192
[vp9 @ 0x5558790a0540] min_height: 128, max_height: 8192
[graph 0 input from stream 0:0 @ 0x5558790bb500] w:240 h:196 pixfmt:nv12 tb:1/25 fr:25/1 sar:0/1 sws_param:flags=2
[scaler_out_0_0 @ 0x5558790b8100] w:352 h:288 flags:'bicubic' interl:0
[scaler_out_0_0 @ 0x5558790b8100] w:240 h:196 fmt:nv12 sar:0/1 -> w:352 h:288 fmt:nv12 sar:0/1 flags:0x4
No more output streams to write to, finishing.
frame=  100 fps=0.0 q=-0.0 Lsize=   14850kB time=00:00:04.00 bitrate=30412.8kbits/s speed=16.4x
video:14850kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000000%
Input file #0 (./lena_resolution_change_on_inter_frame.ivf):
  Input stream #0:0 (video): 100 packets read (117502 bytes); 100 frames decoded;
  Total: 100 packets (117502 bytes) demuxed
Output file #0 (out.yuv):
  Output stream #0:0 (video): 100 frames encoded; 100 packets muxed (15206400 bytes);
  Total: 100 packets (15206400 bytes) muxed
[AVIOContext @ 0x55587899ce40] Statistics: 0 seeks, 59 writeouts
[AVIOContext @ 0x5558789937c0] Statistics: 118734 bytes read, 0 seeks


DXVA2: failed directly after resolution change.
% ffmpeg -hwaccel dxva2 -v debug -i lena_resolution_change_on_inter_frame.ivf -f rawvideo out.yuv
ffmpeg version N-94481-g5ac28e9cc1 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 9.1.1 (GCC) 20190716
  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-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
  libavutil      56. 33.100 / 56. 33.100
  libavcodec     58. 55.100 / 58. 55.100
  libavformat    58. 30.100 / 58. 30.100
  libavdevice    58.  9.100 / 58.  9.100
  libavfilter     7. 58.100 /  7. 58.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 '-hwaccel' ... matched as option 'hwaccel' (use HW accelerated decoding) with argument 'dxva2'.
Reading option '-v' ... matched as option 'v' (set logging level) with argument 'debug'.
Reading option '-i' ... matched as input url with argument 'lena_resolution_change_on_inter_frame.ivf'.
Reading option '-f' ... matched as option 'f' (force format) with argument 'rawvideo'.
Reading option 'out.yuv' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option v (set logging level) with argument debug.
Successfully parsed a group of options.
Parsing a group of options: input url lena_resolution_change_on_inter_frame.ivf.
Applying option hwaccel (use HW accelerated decoding) with argument dxva2.
Successfully parsed a group of options.
Opening an input file: lena_resolution_change_on_inter_frame.ivf.
[NULL @ 000001edb1d39240] Opening 'lena_resolution_change_on_inter_frame.ivf' for reading
[file @ 000001edb1d3a280] Setting default whitelist 'file,crypto'
[ivf @ 000001edb1d39240] Format ivf probed with size=2048 and score=98
[ivf @ 000001edb1d39240] Before avformat_find_stream_info() pos: 32 bytes read:32768 seeks:0 nb_streams:1
[vp9 @ 000001edb1d4b380] Format yuv420p chosen by get_format().
[ivf @ 000001edb1d39240] All info found
[ivf @ 000001edb1d39240] After avformat_find_stream_info() pos: 21114 bytes read:32768 seeks:0 frames:1
Input #0, ivf, from 'lena_resolution_change_on_inter_frame.ivf':
  Duration: 00:00:04.00, start: 0.000000, bitrate: 237 kb/s
    Stream #0:0, 1, 1/25: Video: vp9 (Profile 0), 1 reference frame (VP90 / 0x30395056), yuv420p(tv), 352x288, 0/1, 25 tbr, 25 tbn, 25 tbc
Successfully opened the file.
Parsing a group of options: output url out.yuv.
Applying option f (force format) with argument rawvideo.
Successfully parsed a group of options.
Opening an output file: out.yuv.
File 'out.yuv' already exists. Overwrite ? [y/N] y
[file @ 000001edb1d4bec0] Setting default whitelist 'file,crypto'
Successfully opened the file.
[AVHWDeviceContext @ 000001edb042ee80] Using D3D9Ex device.
detected 4 logical cores
Stream mapping:
  Stream #0:0 -> #0:0 (vp9 (native) -> rawvideo (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)
    Last message repeated 1 times
[vp9 @ 000001edb1d4d3c0] Format dxva2_vld chosen by get_format().
[vp9 @ 000001edb1d4d3c0] Format dxva2_vld requires hwaccel initialisation.
[vp9 @ 000001edb1d4d3c0] Decoder GUIDs reported as supported:
[vp9 @ 000001edb1d4d3c0] {ee27417f-5e28-4e65-beea-1d26b508adc9} 0
[vp9 @ 000001edb1d4d3c0] {bf22ad00-03ea-4690-8077-473346209b7e} 0
[vp9 @ 000001edb1d4d3c0] {e07ec519-e651-4cd6-ac84-1370cceec851} 0
[vp9 @ 000001edb1d4d3c0] {bcc5db6d-a2b6-4af0-ace4-adb1f787bc89} 0
[vp9 @ 000001edb1d4d3c0] {1b81bea4-a0c7-11d3-b984-00c04f2e73c5} 0
[vp9 @ 000001edb1d4d3c0] {1b81be68-a0c7-11d3-b984-00c04f2e73c5} 0
[vp9 @ 000001edb1d4d3c0] {d79be8da-0cf1-4c81-b82a-69a4e236f43d} 0
[vp9 @ 000001edb1d4d3c0] {f9aaccbb-c2b6-4cfc-8779-5707b1760552} 0
[vp9 @ 000001edb1d4d3c0] {705b9d82-76cf-49d6-b7e6-ac8872db013c} 0
[vp9 @ 000001edb1d4d3c0] {c528916c-c0af-4645-8cb2-372b6d4adc2a} 0
[vp9 @ 000001edb1d4d3c0] {8de911c4-c898-4364-9715-1de6b3fe773d} 0
[vp9 @ 000001edb1d4d3c0] {07cfaffb-5a2e-4b99-b62a-e4ca53b6d5aa} 0
[vp9 @ 000001edb1d4d3c0] {91cd2d6e-897b-4fa1-b0d7-51dc88010e0a} 0
[vp9 @ 000001edb1d4d3c0] {90b899ea-3a62-4705-88b3-8df04b2744e7} 0
[vp9 @ 000001edb1d4d3c0] {442b942a-b4d9-4940-bc45-a882e5f919f3} 0
[vp9 @ 000001edb1d4d3c0] {8c56eb1e-2b47-466f-8d33-7dbcd63f3df2} 0
[vp9 @ 000001edb1d4d3c0] {5b11d51b-2f4c-4452-bcc3-09f2a1160cc0} 0
[vp9 @ 000001edb1d4d3c0] {75fc75f7-c589-4a07-a25b-72e03b0383b3} 0 1
[vp9 @ 000001edb1d4d3c0] {107af0e0-ef1a-4d19-aba8-67a163073d13} 0 1
[vp9 @ 000001edb1d4d3c0] {463707f8-a1d0-4585-876d-83aa6d60b89e} 0
[vp9 @ 000001edb1d4d3c0] {a4c749ef-6ecf-48aa-8448-50a7a1165ff7} 1
[vp9 @ 000001edb1d4d3c0] {76988a52-df13-419a-8e64-ffcf4a336cf5} 0
[vp9 @ 000001edb1d4d3c0] {80a3a7bd-89d8-4497-a2b8-2126af7e6eb8} 1
[vp9 @ 000001edb1d4d3c0] {a74ccae2-f466-45ae-86f5-ab8be8af8483}
[vp9 @ 000001edb1d4d3c0] {1b81be94-a0c7-11d3-b984-00c04f2e73c5} 0
[vp9 @ 000001edb1d4d3c0] {1b81bea2-a0c7-11d3-b984-00c04f2e73c5} 0
[vp9 @ 000001edb1d4d3c0] {49761bec-4b63-4349-a5ff-87ffdf088466} 0
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)
    Last message repeated 2 times
[graph 0 input from stream 0:0 @ 000001edba70c380] Setting 'video_size' to value '352x288'
[graph 0 input from stream 0:0 @ 000001edba70c380] Setting 'pix_fmt' to value '23'
[graph 0 input from stream 0:0 @ 000001edba70c380] Setting 'time_base' to value '1/25'
[graph 0 input from stream 0:0 @ 000001edba70c380] Setting 'pixel_aspect' to value '0/1'
[graph 0 input from stream 0:0 @ 000001edba70c380] Setting 'sws_param' to value 'flags=2'
[graph 0 input from stream 0:0 @ 000001edba70c380] Setting 'frame_rate' to value '25/1'
[graph 0 input from stream 0:0 @ 000001edba70c380] w:352 h:288 pixfmt:nv12 tb:1/25 fr:25/1 sar:0/1 sws_param:flags=2
[AVFilterGraph @ 000001edb1d4e400] query_formats: 3 queried, 2 merged, 0 already done, 0 delayed
Output #0, rawvideo, to 'out.yuv':
  Metadata:
    encoder         : Lavf58.30.100
    Stream #0:0, 0, 1/25: Video: rawvideo, 1 reference frame (NV12 / 0x3231564E), nv12, 352x288, 0/1, q=2-31, 30412 kb/s, 25 fps, 25 tbn, 25 tbc
    Metadata:
      encoder         : Lavc58.55.100 rawvideo
Clipping frame in rate conversion by 0.000008
[vp9 @ 000001edb1d4d3c0] Format dxva2_vld chosen by get_format().
[vp9 @ 000001edb1d4d3c0] Format dxva2_vld requires hwaccel initialisation.
[vp9 @ 000001edb1d4d3c0] Decoder GUIDs reported as supported:
[vp9 @ 000001edb1d4d3c0] {ee27417f-5e28-4e65-beea-1d26b508adc9} 0
[vp9 @ 000001edb1d4d3c0] {bf22ad00-03ea-4690-8077-473346209b7e} 0
[vp9 @ 000001edb1d4d3c0] {e07ec519-e651-4cd6-ac84-1370cceec851} 0
[vp9 @ 000001edb1d4d3c0] {bcc5db6d-a2b6-4af0-ace4-adb1f787bc89} 0
[vp9 @ 000001edb1d4d3c0] {1b81bea4-a0c7-11d3-b984-00c04f2e73c5} 0
[vp9 @ 000001edb1d4d3c0] {1b81be68-a0c7-11d3-b984-00c04f2e73c5} 0
[vp9 @ 000001edb1d4d3c0] {d79be8da-0cf1-4c81-b82a-69a4e236f43d} 0
[vp9 @ 000001edb1d4d3c0] {f9aaccbb-c2b6-4cfc-8779-5707b1760552} 0
[vp9 @ 000001edb1d4d3c0] {705b9d82-76cf-49d6-b7e6-ac8872db013c} 0
[vp9 @ 000001edb1d4d3c0] {c528916c-c0af-4645-8cb2-372b6d4adc2a} 0
[vp9 @ 000001edb1d4d3c0] {8de911c4-c898-4364-9715-1de6b3fe773d} 0
[vp9 @ 000001edb1d4d3c0] {07cfaffb-5a2e-4b99-b62a-e4ca53b6d5aa} 0
[vp9 @ 000001edb1d4d3c0] {91cd2d6e-897b-4fa1-b0d7-51dc88010e0a} 0
[vp9 @ 000001edb1d4d3c0] {90b899ea-3a62-4705-88b3-8df04b2744e7} 0
[vp9 @ 000001edb1d4d3c0] {442b942a-b4d9-4940-bc45-a882e5f919f3} 0
[vp9 @ 000001edb1d4d3c0] {8c56eb1e-2b47-466f-8d33-7dbcd63f3df2} 0
[vp9 @ 000001edb1d4d3c0] {5b11d51b-2f4c-4452-bcc3-09f2a1160cc0} 0
[vp9 @ 000001edb1d4d3c0] {75fc75f7-c589-4a07-a25b-72e03b0383b3} 0 1
[vp9 @ 000001edb1d4d3c0] {107af0e0-ef1a-4d19-aba8-67a163073d13} 0 1
[vp9 @ 000001edb1d4d3c0] {463707f8-a1d0-4585-876d-83aa6d60b89e} 0
[vp9 @ 000001edb1d4d3c0] {a4c749ef-6ecf-48aa-8448-50a7a1165ff7} 1
[vp9 @ 000001edb1d4d3c0] {76988a52-df13-419a-8e64-ffcf4a336cf5} 0
[vp9 @ 000001edb1d4d3c0] {80a3a7bd-89d8-4497-a2b8-2126af7e6eb8} 1
[vp9 @ 000001edb1d4d3c0] {a74ccae2-f466-45ae-86f5-ab8be8af8483}
[vp9 @ 000001edb1d4d3c0] {1b81be94-a0c7-11d3-b984-00c04f2e73c5} 0
[vp9 @ 000001edb1d4d3c0] {1b81bea2-a0c7-11d3-b984-00c04f2e73c5} 0
[vp9 @ 000001edb1d4d3c0] {49761bec-4b63-4349-a5ff-87ffdf088466} 0
[vp9 @ 000001edb1d4d3c0] Failed to execute: 0x80070057
[vp9 @ 000001edb1d4dc40] Failed to execute: 0x80070057
[vp9 @ 000001edb1da9940] Failed to execute: 0x80070057
[vp9 @ 000001edb1dae9c0] Failed to execute: 0x8007005701.96 bitrate=29959.3kbits/s speed=2.96x
Error while decoding stream #0:0: Operation not permitted
[vp9 @ 000001edb1d96140] Failed to execute: 0x80070057
Error while decoding stream #0:0: Operation not permitted
[vp9 @ 000001edb1d4d3c0] Failed to execute: 0x80070057
Error while decoding stream #0:0: Operation not permitted
[vp9 @ 000001edb1d4dc40] Failed to execute: 0x80070057
Error while decoding stream #0:0: Operation not permitted
[vp9 @ 000001edb1da9940] Failed to execute: 0x80070057
Error while decoding stream #0:0: Operation not permitted
[vp9 @ 000001edb1dae9c0] Failed to execute: 0x80070057
Error while decoding stream #0:0: Operation not permitted
[vp9 @ 000001edb1d96140] Failed to execute: 0x80070057
Error while decoding stream #0:0: Operation not permitted
[vp9 @ 000001edb1d4d3c0] Failed to execute: 0x80070057
Error while decoding stream #0:0: Operation not permitted
[vp9 @ 000001edb1d4dc40] Failed to execute: 0x80070057
Error while decoding stream #0:0: Operation not permitted
[vp9 @ 000001edb1da9940] Failed to execute: 0x80070057
Error while decoding stream #0:0: Operation not permitted
[vp9 @ 000001edb1dae9c0] Failed to execute: 0x80070057
Error while decoding stream #0:0: Operation not permitted
[vp9 @ 000001edb1d96140] Failed to execute: 0x80070057
Error while decoding stream #0:0: Operation not permitted
[vp9 @ 000001edb1d4d3c0] Failed to execute: 0x80070057
Error while decoding stream #0:0: Operation not permitted
[vp9 @ 000001edb1d4dc40] Failed to execute: 0x80070057
Error while decoding stream #0:0: Operation not permitted
[vp9 @ 000001edb1da9940] Failed to execute: 0x80070057
Error while decoding stream #0:0: Operation not permitted
[vp9 @ 000001edb1dae9c0] Failed to execute: 0x80070057
Error while decoding stream #0:0: Operation not permitted
[vp9 @ 000001edb1d96140] Failed to execute: 0x80070057
Error while decoding stream #0:0: Operation not permitted
[vp9 @ 000001edb1d4d3c0] Failed to execute: 0x80070057
Error while decoding stream #0:0: Operation not permitted
[vp9 @ 000001edb1d4dc40] Failed to execute: 0x80070057
Error while decoding stream #0:0: Operation not permitted
[vp9 @ 000001edb1da9940] Failed to execute: 0x80070057
Error while decoding stream #0:0: Operation not permitted
[vp9 @ 000001edb1dae9c0] Failed to execute: 0x80070057
Error while decoding stream #0:0: Operation not permitted
[vp9 @ 000001edb1d96140] Failed to execute: 0x80070057
Error while decoding stream #0:0: Operation not permitted
[vp9 @ 000001edb1d4d3c0] Failed to execute: 0x80070057
Error while decoding stream #0:0: Operation not permitted
[vp9 @ 000001edb1d4dc40] Failed to execute: 0x80070057
Error while decoding stream #0:0: Operation not permitted
[vp9 @ 000001edb1da9940] Failed to execute: 0x80070057
Error while decoding stream #0:0: Operation not permitted
[vp9 @ 000001edb1dae9c0] Failed to execute: 0x80070057
Error while decoding stream #0:0: Operation not permitted
[vp9 @ 000001edb1d96140] Failed to execute: 0x80070057
Error while decoding stream #0:0: Operation not permitted
[vp9 @ 000001edb1d4d3c0] Failed to execute: 0x80070057
Error while decoding stream #0:0: Operation not permitted
[vp9 @ 000001edb1d4dc40] Failed to execute: 0x80070057
Error while decoding stream #0:0: Operation not permitted
[vp9 @ 000001edb1da9940] Failed to execute: 0x80070057
Error while decoding stream #0:0: Operation not permitted
[vp9 @ 000001edb1dae9c0] Failed to execute: 0x80070057
Error while decoding stream #0:0: Operation not permitted
[vp9 @ 000001edb1d96140] Failed to execute: 0x80070057
Error while decoding stream #0:0: Operation not permitted
[vp9 @ 000001edb1d4d3c0] Failed to execute: 0x80070057
Error while decoding stream #0:0: Operation not permitted
[vp9 @ 000001edb1d4dc40] Failed to execute: 0x80070057
Error while decoding stream #0:0: Operation not permitted
[vp9 @ 000001edb1da9940] Failed to execute: 0x80070057
Error while decoding stream #0:0: Operation not permitted
[vp9 @ 000001edb1dae9c0] Failed to execute: 0x80070057
Error while decoding stream #0:0: Operation not permitted
[vp9 @ 000001edb1d96140] Failed to execute: 0x80070057
Error while decoding stream #0:0: Operation not permitted
[vp9 @ 000001edb1d4d3c0] Failed to execute: 0x80070057
Error while decoding stream #0:0: Operation not permitted
[vp9 @ 000001edb1d4dc40] Failed to execute: 0x80070057
Error while decoding stream #0:0: Operation not permitted
[vp9 @ 000001edb1da9940] Failed to execute: 0x80070057
Error while decoding stream #0:0: Operation not permitted
[vp9 @ 000001edb1dae9c0] Failed to execute: 0x80070057
Error while decoding stream #0:0: Operation not permitted
[vp9 @ 000001edb1d96140] Failed to execute: 0x80070057
Error while decoding stream #0:0: Operation not permitted00 bitrate=30408.7kbits/s speed= 1.7x
[vp9 @ 000001edb1d4d3c0] Failed to execute: 0x80070057
Error while decoding stream #0:0: Operation not permitted
[vp9 @ 000001edb1d4dc40] Failed to execute: 0x80070057
Error while decoding stream #0:0: Operation not permitted
[vp9 @ 000001edb1da9940] Failed to execute: 0x80070057
Error while decoding stream #0:0: Operation not permitted
[vp9 @ 000001edb1dae9c0] Failed to execute: 0x80070057
Error while decoding stream #0:0: Operation not permitted
[vp9 @ 000001edb1d96140] Failed to execute: 0x80070057
Error while decoding stream #0:0: Operation not permitted
    Last message repeated 3 times
[out_0_0 @ 000001edba70d7c0] EOF on sink link out_0_0:default.
No more output streams to write to, finishing.
frame=   50 fps= 38 q=-0.0 Lsize=    7425kB time=00:00:02.00 bitrate=30412.8kbits/s speed=1.51x
video:7425kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000000%
Input file #0 (lena_resolution_change_on_inter_frame.ivf):
  Input stream #0:0 (video): 100 packets read (117502 bytes); 50 frames decoded;
  Total: 100 packets (117502 bytes) demuxed
Output file #0 (out.yuv):
  Output stream #0:0 (video): 50 frames encoded; 50 packets muxed (7603200 bytes);
  Total: 50 packets (7603200 bytes) muxed
50 frames successfully decoded, 50 decoding errors
[AVIOContext @ 000001edb1d4c000] Statistics: 0 seeks, 30 writeouts
[AVIOContext @ 000001edb1d42500] Statistics: 118734 bytes read, 0 seeks



VAAPI: no runtime errors, but has garbage.
% ffmpeg -hwaccel vaapi -y -v verbose -i lena_resolution_change_on_inter_frame.ivf -f rawvideo out.yuv
ffmpeg version N-94410-g36c1eb2 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.10) 20160609
  configuration: --enable-vaapi --prefix=/opt/X11R7/iHD/ffmpeg_mainline --enable-nonfree --enable-shared --enable-libmfx --enable-gpl --enable-libx264 --enable-libx265 --disable-optimizations --enable-debug=3 --disable-stripping --enable-libvorbis --enable-libvpx
  libavutil      56. 32.100 / 56. 32.100
  libavcodec     58. 55.100 / 58. 55.100
  libavformat    58. 30.100 / 58. 30.100
  libavdevice    58.  9.100 / 58.  9.100
  libavfilter     7. 58.100 /  7. 58.100
  libswscale      5.  6.100 /  5.  6.100
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100
Input #0, ivf, from 'lena_resolution_change_on_inter_frame.ivf':
  Duration: 00:00:04.00, start: 0.000000, bitrate: 237 kb/s
    Stream #0:0: Video: vp9 (Profile 0), 1 reference frame (VP90 / 0x30395056), yuv420p(tv), 352x288, 25 tbr, 25 tbn, 25 tbc
[AVHWDeviceContext @ 0x195b5c0] Trying to use DRM render node for device 0.
[AVHWDeviceContext @ 0x195b5c0] libva: VA-API version 1.6.0
[AVHWDeviceContext @ 0x195b5c0] libva: va_getDriverName() returns 0
[AVHWDeviceContext @ 0x195b5c0] libva: User requested driver 'iHD'
[AVHWDeviceContext @ 0x195b5c0] libva: Trying to open /opt/X11R7/iHD/vpg_driver/lib/dri//iHD_drv_video.so
[AVHWDeviceContext @ 0x195b5c0] libva: Found init function __vaDriverInit_1_6
[AVHWDeviceContext @ 0x195b5c0] libva: va_openDriver() returns 0
[AVHWDeviceContext @ 0x195b5c0] Initialised VAAPI connection: version 1.6
[AVHWDeviceContext @ 0x195b5c0] VAAPI driver: Intel iHD driver - 1.0.0.
[AVHWDeviceContext @ 0x195b5c0] Driver not found in known nonstandard list, using standard behaviour.
Stream mapping:
  Stream #0:0 -> #0:0 (vp9 (native) -> rawvideo (native))
Press [q] to stop, [?] for help
[graph 0 input from stream 0:0 @ 0x1a426c0] w:352 h:288 pixfmt:nv12 tb:1/25 fr:25/1 sar:0/1 sws_param:flags=2
Output #0, rawvideo, to 'out.yuv':
  Metadata:
    encoder         : Lavf58.30.100
    Stream #0:0: Video: rawvideo, 1 reference frame (NV12 / 0x3231564E), nv12, 352x288, q=2-31, 30412 kb/s, 25 fps, 25 tbn, 25 tbc
    Metadata:
      encoder         : Lavc58.55.100 rawvideo
[graph 0 input from stream 0:0 @ 0x1a472c0] w:240 h:196 pixfmt:nv12 tb:1/25 fr:25/1 sar:0/1 sws_param:flags=2
[scaler_out_0_0 @ 0x1a426c0] w:352 h:288 flags:'bicubic' interl:0
[scaler_out_0_0 @ 0x1a426c0] w:240 h:196 fmt:nv12 sar:0/1 -> w:352 h:288 fmt:nv12 sar:0/1 flags:0x4
No more output streams to write to, finishing.
frame=  100 fps=0.0 q=-0.0 Lsize=   14850kB time=00:00:04.00 bitrate=30412.8kbits/s speed=25.8x
video:14850kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000000%
Input file #0 (lena_resolution_change_on_inter_frame.ivf):
  Input stream #0:0 (video): 100 packets read (117502 bytes); 100 frames decoded;
  Total: 100 packets (117502 bytes) demuxed
Output file #0 (out.yuv):
  Output stream #0:0 (video): 100 frames encoded; 100 packets muxed (15206400 bytes);
  Total: 100 packets (15206400 bytes) muxed
[AVIOContext @ 0x196ae80] Statistics: 0 seeks, 59 writeouts
[AVIOContext @ 0x1962240] Statistics: 118734 bytes read, 0 seeks

For lena.ivf, the output is all good for vaapi/nvdec/dxva2, which could be taken as a contrast.

Attachments (2)

lena_resolution_change_on_inter_frame.ivf (116.0 KB ) - added by Linjie.Fu 2 years ago.
lena.ivf (123.7 KB ) - added by Linjie.Fu 2 years ago.

Download all attachments as: .zip

Change History (6)

by Linjie.Fu, 2 years ago

Attachment: lena.ivf added

comment:1 by Linjie.Fu, 2 years ago

Patch set could fix 1000+ dynamic resolution cases for vaapi,
https://patchwork.ffmpeg.org/patch/13839/
https://patchwork.ffmpeg.org/patch/13895/

(IMHO, similar methods may be needed for nvdec/dxva2)

comment:2 by Carl Eugen Hoyos, 2 years ago

Keywords: vp9 added; nvdec/vaapi/dxva2 removed
Priority: importantwish
Type: defectenhancement

comment:3 by Carl Eugen Hoyos, 2 years ago

Keywords: vaapi added

comment:4 by Linjie.Fu, 2 years ago

Since NVDEC and DXVA2 encountered the same issue, any comments fo this?

Note: See TracTickets for help on using tickets.