Transparency through DRM planes

I’ve got two separate gstreamer streams, one of which is a simple video stream, the other is a UI element via appsrc. I can run both at once with each one in a separate plane using nvdrmvideosink and overlay one over the other, but if I add an alpha to the UI video stream using RGBA I still can’t see the video under it. It does get darker in the areas where I add the alpha.

Is it possible to alpha blend two separate gstreamer streams through nvdrmvideosink and different planes?

Yes, ideally I’d use nvcompositor to blend the videos, but I’m having issues getting appsrc to work with any compositor and the planes route would save a lot of time… if it’s possible.

A better approach is to use nvcompositor plugins. For linking with appsrc, it should work like:

appsrc ! video/x-raw ! nvvidconv ! nvcompositor ! ...

Please share more information about the failure. Let’s try to resolve it and use nvcompositor for compositing buffers.

I appreciate the help, I finally got unstuck with the appsrc problem. In this case, I wasn’t setting timestamps properly in my appsrc. Now I’m stuck on scaling (rotation works!), the nvcompositor pipelines get complex quickly and I’m not sure how to read them.

    << "nvcompositor name=comp "
    << " sink_0::xpos=0 sink_0::ypos=0 sink_0::width="<< W <<" sink_0::height="<< H
    << " sink_1::xpos=0 sink_1::ypos=0 sink_1::width="<< W <<" sink_1::height="<< H
    << " ! nvvidconv flip-method=3 ! "
    << "nvdrmvideosink conn-id=1 sync=false videotestsrc pattern=snow is-live=true ! "
    << Caps << " ! comp. appsrc name=mysource is-live=true ! nvvidconv ! queue ! "
    << Caps << " ! comp.";

The above works great for the most part; the appsrc has parts that set the alpha to transparent and I can see the snow test pattern behind it.

One tricky part is my display is rotated, it’s a 1200 x 1920 screen that’s designed around portrait, but we’re using in landscape mode. The
nvvidconv flip-method=3
line solves that part, but getting that working was pure trial and error.

The really tricky part is that the display (or something) is a bit buggy, so if I try to display at the full resolution the screen blinks in and out. I have to set it to a slightly lower resolution, and I haven’t figured out how with nvcompositor. nvvidconv with caps set to a certain resolution behind it works perfectly for simple pipelines, for example:
nvvidconv flip-method=3 ! video/x-raw(memory:NVMM),format=NV12,width=1080,height=1860
would normally be fine.

I can replace nvdrmvideosink with nvoverlysink, but for some reason I can’t get as close to the edge of the screen by setting the same resolution with the “overlay-h” and “overlay-w” parameters as I can with nvvidconv and caps.

The resolution is special and not sure if it can work as expected. You may do trials with simple pipeline like:

videotestsrc ! nvvidconv ! nvoverlaysink(or nvdrmvideosink)

The nvdrmvideosink is open source. You may check the source and check if you can add properties like overlay-w and overlay-h.

Source code is in

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.