[gstreamer] Is there an osd plugin that can support nvmm type

I found that the textoverlay plugin can not support nvmm type data, although in gst-inspect, the Capabilities description mentions textoverlay support for video / x-raw (ANY).

This command can not run successfully

DISPLAY=:0 gst-launch-1.0 -v nvcamerasrc ! 'video/x-raw(memory:NVMM), format=I420, width=1920, height=1080, framerate=30/1'\
! nvvidconv flip-method=2 ! 'video/x-raw(memory:NVMM), format=I420, width=1920, height=1080, framerate=30/1' \
! textoverlay silent=false text-x=5 text-y=5 text-width=100 text-height=100 text=OSD \
! omxh265enc bitrate=2000000 ! 'video/x-h265, stream-format=(string)byte-stream' \
! h265parse ! mpegtsmux alignment=7 ! udpsink port=5000 async=false sync=false host=192.165.53.23

In my application, I need to use tee video is divided into two ways, for encoding and preview, if do not use nvmm type, [b]cpu occupancy rate will be very high

[/b]1, Use nvvidconv, convert nvmm to video / x-raw, then add textoverlay, command and cpu occupancy

gst-launch-1.0 nvcamerasrc fpsRange="20 30" intent=3 ! 'video/x-raw(memory:NVMM), format=I420, width=3840, height=2160, framerate=25/1' \
! nvvidconv flip-method=2 ! 'video/x-raw(memory:NVMM), width=(int)3840, height=(int)2160, format=(string)I420, framerate=(fraction)25/1' \
! tee name=t \
! queue ! nvvidconv ! 'video/x-raw' \
! textoverlay silent=false text-x=5 text-y=5 text-width=100 text-height=100 text=OSD \
! omxh265enc control-rate=2 bitrate=4000000 ! 'video/x-h265, stream-format=(string)byte-stream' \
! h265parse ! rtph265pay mtu=1300 ! application/x-rtp,encoding-name=H265,payload=98 \
! udpsink host=192.165.53.23 port=4000 sync=false async=false \
t. \
! queue ! nvvidconv ! 'video/x-raw(memory:NVMM), format=I420, width=1280, height=720, framerate=25/1' ! nvvidconv ! 'video/x-raw' ! ximagesink 

RAM 1078/3995MB (lfb 657x4MB) cpu [39%,47%,61%,32%]@1734 GR3D 49%@76 EDP limit 0
RAM 1078/3995MB (lfb 657x4MB) cpu [27%,74%,43%,27%]@1734 GR3D 25%@76 EDP limit 0
RAM 1078/3995MB (lfb 657x4MB) cpu [34%,72%,32%,29%]@1734 GR3D 15%@76 EDP limit 0
RAM 1078/3995MB (lfb 657x4MB) cpu [35%,51%,57%,28%]@1734 GR3D 46%@76 EDP limit 0
RAM 1078/3995MB (lfb 657x4MB) cpu [52%,44%,38%,32%]@1734 GR3D 40%@76 EDP limit 0
RAM 1078/3995MB (lfb 657x4MB) cpu [48%,42%,57%,24%]@1734 GR3D 57%@76 EDP limit 0
RAM 1077/3995MB (lfb 657x4MB) cpu [39%,36%,61%,33%]@1734 GR3D 46%@76 EDP limit 0
RAM 1077/3995MB (lfb 657x4MB) cpu [28%,30%,39%,65%]@1734 GR3D 45%@76 EDP limit 0

2,No conversion, command and cpu occupancy

gst-launch-1.0 nvcamerasrc fpsRange="20 30" intent=3 ! 'video/x-raw(memory:NVMM), format=I420, width=3840, height=2160, framerate=25/1' \
! nvvidconv flip-method=2 ! 'video/x-raw(memory:NVMM), width=(int)3840, height=(int)2160, format=(string)I420, framerate=(fraction)25/1' \
! tee name=t \
! queue \
! omxh265enc control-rate=2 bitrate=4000000 ! 'video/x-h265, stream-format=(string)byte-stream' \
! h265parse ! rtph265pay mtu=1300 ! application/x-rtp,encoding-name=H265,payload=98 \
! udpsink host=192.165.53.23 port=4000 sync=false async=false \
t. \
! queue ! nvvidconv ! 'video/x-raw(memory:NVMM), format=I420, width=1280, height=720, framerate=25/1' ! nvvidconv ! 'video/x-raw' ! ximagesink 

RAM 1042/3995MB (lfb 159x4MB) cpu [29%,25%,50%,15%]@614 GR3D 33%@76 EDP limit 0
RAM 1042/3995MB (lfb 159x4MB) cpu [13%,28%,53%,15%]@518 GR3D 45%@76 EDP limit 0
RAM 1042/3995MB (lfb 159x4MB) cpu [19%,21%,48%,17%]@614 GR3D 47%@76 EDP limit 0
RAM 1042/3995MB (lfb 159x4MB) cpu [22%,26%,50%,18%]@518 GR3D 20%@76 EDP limit 0

Hi li_lin,

Please take a look at NVOSD mentioned in https://developer.nvidia.com/embedded/dlc/l4t-documentation-28-1 -> API -> Sample Applications.

Hi vickyy:

Thank you for your reply.
Can mmapi achieve V4L2 device OSD + encode + preview?

Hi li_lin,

Yes, You can plot a bound box and text by using nvosd and mmapi. Please see this topic for preview case.

https://devtalk.nvidia.com/default/topic/1021210/unable-to-display-text-using-nvosd_put_text-/