I need to overlay a transparent logo on a videostream.
With software compositor it works this way:
gst-launch-1.0 compositor name=mix sink_0::zorder=1 sink_1::alpha=1.0 sink_1::zorder=2 ! nvvidconv ! nvegltransform ! nveglglessink videotestsrc ! video/x-raw,format=RGBA,width=1920,height=1080 ! queue ! mix.sink_0 filesrc location=di-logo.png ! pngdec ! alphacolor ! video/x-raw,format=RGBA ! imagefreeze ! mix.sink_1
I get correct result but it loads the CPU heavy.
So I’d want to use the nvcompositor to offload:
gst-launch-1.0 \
nvcompositor name=mix sink_0::zorder=1 sink_1::alpha=1.0 sink_1::zorder=2 ! nvvidconv ! nvegltransform ! nveglglessink \
videotestsrc ! video/x-raw,format=RGBA,width=1280,height=720 ! nvvidconv ! queue ! mix.sink_0 \
filesrc location=di-logo.png ! pngdec ! alphacolor ! video/x-raw,format=RGBA ! imagefreeze ! nvvidconv ! mix.sink_1
But with nvcompositor the png renders with square black background around it instead of being transparent. So this is different/unexpected behavior.
Is there a way to work-around this ?