Usage of nvcompositor vs videocompositor

I am trying to use videocompositor to overlay 2 BGRA video feeds. This is my sample pipeline:

gst-launch-1.0 v4l2src device=/dev/video2 ! video/x-raw,format=YUY2,width=2560,height=720,framerate=30/1 ! compositor name=comp sink_0::alpha=1 sink_1::alpha=0.5 ! xvimagesink   videotestsrc !   video/x-raw,format=I420, framerate=\(fraction\)5/1, width=320, height=240 ! comp.

I was wondering how I would use nvcompositor instead of videocompositor here for improved performance on the Jetson.

I was also wondering if there’s a way to create a stream (maybe using appsink/appsrc) in opencv so that I can create a feed of text and shapes to overlay my video stream.

You would try something like:

gst-launch-1.0 \
nvcompositor name=comp \
 sink_0::xpos=0 sink_0::ypos=0 sink_0::width=2560 sink_0::height=720 sink_0::zorder=1 sink_0::alpha=1\
 sink_1::xpos=0 sink_1::ypos=0 sink_1::width=2560 sink_1::height=720 sink_1::zorder=2 sink_1::alpha=0.1\
 ! 'video/x-raw(memory:NVMM),format=RGBA' ! nv3dsink    \
v4l2src device=/dev/video2 ! video/x-raw,format=YUY2,width=2560,height=720,framerate=30/1 ! nvvidconv ! 'video/x-raw(memory:NVMM),format=RGBA' ! comp.sink_0    \
videotestsrc ! videoconvert ! video/x-raw,format=RGBA ! nvvidconv ! 'video/x-raw(memory:NVMM),format=RGBA,width=2560,height=720' ! comp.sink_1

How would I implement this with xvimagesink? I tried replacing the sinks and taking out the nvvidconv because xvimagesink0 can't handle caps video/x-raw(memory:NVMM), format=(string)RGBA.