Can deepstream nvosd display icons,bitmaps,jpegs on screen

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU) Jetson TX2
• DeepStream Version 4.0
• JetPack Version (valid for Jetson only) Jetson 4.3

Hello,

I was wondering if deepstream NVOSD can display icons on the video stream? For example, I have a series of icons that are type png, and I want to display it on the video. Is there a sample available for me to refer to?

No, nvdsosd only draws text, rectangles and lines. You will need another GStreamer element to overlay images.

That’s what I thought.

Is there a way to have the text or lines in nvdosd to have an outline color? For example, have the body of the text be black, but the outline to be white to improve visibility when displayed on top of the video?

1 Like

Regarding the outline, there is no such configuration. You can change the font color and size. I suppose you could add a second text with font size n+1 and a different color, but I don’t think that would look nice.

But I think that is not needed since nvdsosd already adds a black box behind white text.

You can set a custom background color if you like @mxy :
https://docs.nvidia.com/metropolis/deepstream/4.0/dev-guide/DeepStream_Development_Guide/baggage/struct__NvOSD__TextParams.html

We wanted to have a different outline to the text instead of using a solid background rectangle. The ‘powers that be’ feel that the rectangle looks ugly. But it’s okay, we have other solutions to do the text I suppose.

If you are looking for an aesthetic overlay that has somewhat good performance in Jetson please check our Gstreamer QT Overlay.

Pros:

  • Uses Qt for the overlay, any elements present in QML can be added as an overlay
  • All the elements on the QML can be changed during runtime and new elements can be added
  • Can also be used as a GUI by catching Qt events

Cons:

  • It uses CPU and requires a memory copy, so It has lower performance than nvdsosd. We are working in a solution to avoid the memory copy and operate with the GPU over NVMM, but this is still in its very early stages of development.
  • The parsing and drawing of DeepStream meta is not implemented. We can easily add this since we have experience working with it.
  • This project is not open source and you would need to buy a license.

Please contact us if you are interested in getting an evaluation version of the element or if you have any questions about it.

Would the ridgerun plugin be compatible with deepstream? Could I use a hybrid deepstream/ridgerun solution to improve CPU performance?

The RidgeRun plugin is compatible with DeepStream’s, you can use it like this if all you want is to add to the overlay already done by nvdsosd:

... ! nvdsosd ! nvvideoconvert ! qtoverlay ! ...

However, a memory copy is still needed to convert NVMM to regular memory, and this is the operation that will likely cause less performance. QtOverlay’s rendering should be negligible in comparison. I am almost sure that the following pipelines should have similar performance:

... ! nvdsosd(drawing rectangles and text) ! nvvideoconvert ! qtoverlay(drawing something else)! ...

... ! nvvideoconvert ! qtoverlay(drawing rectangles, text, and something else) ! ...

In the end, it would be up to you if you use nvdsosd or qtoverlay to draw rectangles and text, but qtoverlay would give you all the options to format text available in Qt.

Note: Even though the general performance would drop from switching to GstQtOverlay, the bottleneck of a DeepStream pipeline would still be the detection element. The overhead from one memory copy is small compared to the inference time of a detection model.

1 Like

Yes, DeepStream do not support it at this moment. You can have a buffer or RGBA matrix of required logo and use these values to overwrite content of OSD output buffer in probe function wich needs to be implemented on source pad of OSD component (simiar as @mdegans’s solution).

Thanks!