Media (Intel® oneAPI Video Processing Library, Intel Media SDK)
Access community support with transcoding, decoding, and encoding in applications using media tools like Intel® oneAPI Video Processing Library and Intel® Media SDK
Announcements
The Intel sign-in experience has changed to support enhanced security controls. If you sign in, click here for more information.

does overlay_qsv in FFMPEG support alpha channel?

wong__ham
Beginner
1,847 Views

when I use overlay_qsv in ffmpeg to display logo, overlay_qsv not able to transparent background, no matter PNG, APNG , gif or DVB source picture subtitle, for picture subtitle, The best I can do is  adjust tranparent level on subitle layer by alpha value, is this is ffmpeg coding issue or intel hardware can't handle it? as all above content can work 100% fine with ffmpeg fitler overlay, I just don't know this was due to my config problem or what. please kindly advise

 

ffmpeg -hwaccel qsv -qsv_device 1 -c:v h264_qsv -re -i "test.ts" -loop 1 -i "Logo.png" ^
-filter_complex "[1:v]format=nv12,hwupload=extra_hw_frames=10[watermark]; ^
[0:v][watermark]overlay_qsv=x=30:y=30" -vcodec h264_qsv -q:v 20 -acodec copy -y test.mp4

ffmpeg -hwaccel qsv -qsv_device 1 -c:v h264_qsv -re -i "http://192.168.101.2:7522/upnp/channelstream/transcode/3713217898725769217.ts" -ignore_loop 0 -i "lg-wave-ball-preloader.gif" ^
-filter_complex "[0:v]deinterlace_qsv,scale_qsv=-1:720,vpp_qsv=denoise=20,fps=25[bg]; ^
[1:v]format=yuv420p,hwupload=extra_hw_frames=10,scale_qsv=-1:50[logo]; ^
[0:s:0]format=yuv420p,hwupload=extra_hw_frames=10,scale_qsv=-1:720[sub]; ^
[bg][logo]overlay_qsv=x=30:y=30[bg2] ; [bg2]overlay_qsv=alpha=100" ^
-vcodec h264_qsv -look_ahead 0 -q:v 20 -acodec copy -y test.ts

 

0 Kudos
4 Replies
Durga_Bhavani__Vayil
1,847 Views
ffmpeg -hwaccel qsv -qsv_device 1 -c:v h264_qsv -re -i "test.ts" -loop 1 -i "Logo.png" ^
-filter_complex "[1:v]hwupload=extra_hw_frames=10[watermark]; ^
[0:v][watermark]overlay_qsv=x=30:y=30" -vcodec h264_qsv -q:v 20 -acodec copy -y test.mp4

 

Remove format then you will get PNG overlay.

 

Having format=nv12 or yuv420p is internally changing original png image properties.

 

 

Durga_Bhavani__Vayil
1,847 Views
ffmpeg -hwaccel qsv -qsv_device 1 -c:v h264_qsv -re -i "test.ts" -loop 1 -i "Logo.png" ^
-filter_complex "[1:v]hwupload=extra_hw_frames=10[watermark]; ^
[0:v][watermark]overlay_qsv=x=30:y=30" -vcodec h264_qsv -q:v 20 -acodec copy -y test.mp4

This will give png image overlay exactly.

Having format=nv12 or yuv420p leads to converting internal properties of png image.

SebGreen
Beginner
1,684 Views

this gives me:

[Parsed_overlay_qsv_1 @ 0x55d29768aa40] Inputs with different underlying QSV devices are forbidden. [Parsed_overlay_qsv_1 @ 0x55d29768aa40] Failed to configure output pad on Parsed_overlay_qsv_1 Error reinitializing filters! Failed to inject frame into filter network: Invalid argument

any idea?

SebGreen
Beginner
1,683 Views

ffmpeg -init_hw_device qsv -hwaccel qsv -hwaccel_output_format qsv -c:v h264_qsv -re -i input.mp4 -loop 1 -r 30 -i overlay.png -filter_complex '[1:v]hwupload=extra_hw_frames=10[ov];[0:v][ov]overlay_qsv' -c:v h264_qsv -y output.mp4


Reply