How to overlay two videos with alpha channel?

We have tried two methods to accomplish this task.

  1. One is using the nvcompositor, but it seems not support the input src of nvcamerasrc.
gst-launch-1.0 nvcompositor name=comp ! nvoverlaysink nvcamerasrc ! "video/x-raw(memory:NVMM), width=3840, height=2160, format=I420" !  comp. videostestsrc ! comp. -e
  1. The other is nvoverlaysink to composite two videos, but it seems not support alpha channel.
gst-launch-1.0 nvcamerasrc ! "video/x-raw(memory:NUMM), width=3840, height=2160, format=I420" ! nvoverlaysink overlay=1 sync=false & gst-launch-1.0 filesrc location=test.mov ! queue ! decodebin ! nvvidconv ! "video/x-raw(memory:NVMM),format=I420" ! nvoverlaysink overlay=2 sync=false

test.mov is coded by PNG, Timecode with alpha channel.

Our goal is to overlay a transparent video to the video stream captured from the onboard camera (nvcamerasrc), but we don’t how to do that. Help!

Hi sdyww10,

Please try below command and change overlay to 0 and 1:

sudo service lightdm stop

sdyww10,

Sorry that nvcompositor does not nvcamerasrc as source file currently. I think you need to use cuda to write your app at this moment.

Sorry for inconvenience.