Opened 3 years ago

Last modified 3 years ago

#8995 new defect

overlay_qsv fails with "Inputs with different underlying QSV devices are forbidden"

Reported by: sebseb7 Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords: qsv
Cc: wenbin.chen@intel.com Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Summary of the bug:
How to reproduce:

% ffmpeg -init_hw_device qsv -hwaccel qsv -hwaccel_output_format nv12 -c:v h264_qsv -i in.mp4 -loop 1 -r 30 -i overlay.png -filter_complex '[1:v]hwupload=extra_hw_frames=64,format=qsv[ov];[0:v][ov]overlay_qsv,format=nv12' -c:v h264_qsv -y out.mp4
ffmpeg version from git bf19833ae26b054a111de79b5ab1681c00cd8d0a (11/20/2020)
built on ubuntu 18.04

output:

ffmpeg version N-99942-gbf19833ae2 Copyright (c) 2000-2020 the FFmpeg developers                                                                                                                                                   built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04)                                                                                                                                                                                   configuration: --pkg-config-flags=--static --enable-libmfx --enable-vaapi --cpu=native --enable-gpl --enable-openssl --enable-nonfree --extra-libs='-lpthread -lm -lz -ldl' --enable-opengl --enable-libxcb --enable-ffplay --enable-demuxer=dash --enable-libxml2 --enable-libx264                                                                                                                                                                               libavutil      56. 60.100 / 56. 60.100                                                                                                                                                                                           libavcodec     58.112.103 / 58.112.103                                                                                                                                                                                           libavformat    58. 64.100 / 58. 64.100                                                                                                                                                                                           libavdevice    58. 11.102 / 58. 11.102                                                                                                                                                                                           libavfilter     7. 90.100 /  7. 90.100                                                                                                                                                                                           libswscale      5.  8.100 /  5.  8.100                                                                                                                                                                                           libswresample   3.  8.100 /  3.  8.100                                                                                                                                                                                           libpostproc    55.  8.100 / 55.  8.100                                                                                                                                                                                         Input #0, h264, from 'in.mp4':                                                                                                                                                                                                    Duration: N/A, bitrate: N/A                                                                                                                                                                                                        Stream #0:0: Video: h264 (High), yuv420p(progressive), 1280x720 [SAR 1:1 DAR 16:9], 30 fps, 30 tbr, 1200k tbn, 60 tbc                                                                                                        Input #1, png_pipe, from 'overlay.png':                                                                                                                                                                                            Duration: N/A, bitrate: N/A                                                                                                                                                                                                        Stream #1:0: Video: png, rgba(pc), 1280x720 [SAR 11811:11811 DAR 16:9], 25 fps, 25 tbr, 25 tbn, 25 tbc                                                                                                                       Stream mapping:                                                                                                                                                                                                                    Stream #0:0 (h264_qsv) -> overlay_qsv:main                                                                                                                                                                                       Stream #1:0 (png) -> hwupload                                                                                                                                                                                                    format -> Stream #0:0 (h264_qsv)                                                                                                                                                                                               Press [q] to stop, [?] for help                                                                                                                                                                                                  [Parsed_overlay_qsv_2 @ 0x55d1a6a195c0] Inputs with different underlying QSV devices are forbidden.                                                                                                                              [Parsed_overlay_qsv_2 @ 0x55d1a6a195c0] Failed to configure output pad on Parsed_overlay_qsv_2                                                                                                                                   Error reinitializing filters!                                                                                                                                                                                                    Failed to inject frame into filter network: Invalid argument                                                                                                                                                                     Error while processing the decoded data for stream #0:0                                                                                                                                                                          Conversion failed! 

Attachments (1)

debuglog.txt (26.6 KB ) - added by sebseb7 3 years ago.
loglevel debug output

Download all attachments as: .zip

Change History (7)

comment:1 by sebseb7, 3 years ago

                                                                                                                                                                                      Input #0, h264, from 'in.mp4':
Duration: N/A, bitrate: N/A
Stream #0:0: Video: h264 (High), yuv420p(progressive), 1280x720 [SAR 1:1 DAR 16:9], 30 fps, 30 tbr, 1200k tbn, 60 tbc
Input #1, png_pipe, from 'overlay.png':
Duration: N/A, bitrate: N/A
Stream #1:0: Video: png, rgba(pc), 1280x720 [SAR 11811:11811 DAR 16:9], 25 fps, 25 tbr, 25 tbn, 25 tbc
Stream mapping:
Stream #0:0 (h264_qsv) -> overlay_qsv:main
Stream #1:0 (png) -> hwupload
format -> Stream #0:0 (h264_qsv)
Press [q] to stop, [?] for help
[Parsed_overlay_qsv_2 @ 0x55aebf3c95c0] Inputs with different underlying QSV devices are forbidden.
[Parsed_overlay_qsv_2 @ 0x55aebf3c95c0] Failed to configure output pad on Parsed_overlay_qsv_2
Error reinitializing filters!
Failed to inject frame into filter network: Invalid argument
Error while processing the decoded data for stream #0:0
Conversion failed!

Last edited 3 years ago by sebseb7 (previous) (diff)

by sebseb7, 3 years ago

Attachment: debuglog.txt added

loglevel debug output

comment:2 by Linjie.Fu, 3 years ago

Possibly you're using an incorrect cmdline, there are some references which do work, and you may want to try:
https://community.intel.com/t5/Media-Intel-oneAPI-Video/does-overlay-qsv-in-FFMPEG-support-alpha-channel/td-p/1173043

comment:3 by wenbin,chen, 3 years ago

Cc: wenbin.chen@intel.com added
Reproduced by developer: set

comment:4 by Carl Eugen Hoyos, 3 years ago

Keywords: qsv added
Version: unspecifiedgit-master

comment:5 by wenbin,chen, 3 years ago

you can try the following cmdline.

ffmpeg -hwaccel qsv -c:v h264_qsv -i in.mp4 -loop 1 -r 30 -hwaccel qsv -c:v mjpg_qsv -i overlay.jpg -filter_complex '[0:v][1:v]overlay_qsv,format=nv12' -c:v h264_qsv -y out.mp4

notice that you need to use mjpeg_qsv to transfer overlay.png to overlay.jpg first.

comment:6 by wenbin,chen, 3 years ago

there is another option to make cmd work:

ffmpeg -init_hw_device qsv -hwaccel_output_format nv12 -c:v h264_qsv -i in.mp4 -loop 1 -r 30 -i overlay.png -filter_complex '[0:v]hwupload=extra_hw_frames=64[temp];[1:v]hwupload=extra_hw_frames=64,format=qsv[ov];[temp][ov]overlay_qsv,format=nv12' -c:v h264_qsv -y out.mp4
Note: See TracTickets for help on using tickets.