No worries! I’m just happy you pointed me in the right direction and forced me to really think this one over.
I’ve finally manged to get the pipeline I need: By nesting two compositors and using the alpha plugin I’m able to mask the v4l2 source and place it on top of the background:
gst-launch-1.0 \
v4l2src device=/dev/video11 ! queue ! videoconvert ! videoscale ! videorate ! video/x-raw,format=I420,framerate=30/1,width=1920,height=1080 ! alphacomp.sink_0 \
filesrc location=masking_image.png ! pngdec ! imagefreeze ! video/x-raw,format=RGBA,framerate=30/1 ! alphacomp.sink_1 \
compositor name=alphacomp ! alpha method=green ! comp.sink_1 \
filesrc location=background.png ! pngdec ! imagefreeze ! video/x-raw,format=RGBA,framerate=30/1 ! comp.sink_0 \
compositor name=comp \
sink_0::zorder=1 sink_1::zorder=2 \
! autovideoconvert ! autovideosink
This yields the following output:
It’s probably not the most elegant or resource efficient solution. So if someone knows how to shorten this or use alphacombine properly please leave a comment!