In case your opencv frames are BGR, you would have to convert in the pipeline.
I am currently unable to try, but this may help:
gst = "appsrc ! queue ! videoconvert ! video/x-raw,format=RGBA ! nvvidconv ! nvegltransform ! nveglglessink "
vw = cv2.VideoWriter(gst, cv2.CAP_GSTREAMER, 0, 30, (FRAME_WIDTH, FRAME_HEIGHT))
Note the width and height (and fps) should be according to the frames you’re pushing into writer.
When it works, you can resize with nvvidconv adding caps with new size:
gst = "appsrc ! queue ! videoconvert ! video/x-raw,format=RGBA ! nvvidconv ! video/x-raw(memory:NVMM), width=DISPLAY_WIDTH, height=DISPLAY_HEIGHT ! nvegltransform ! nveglglessink "