Understanding GstNvDsOsd drawing limitations

• Hardware Platform (Jetson / GPU) Jetson Nano
• DeepStream Version 4.0.2
• JetPack Version (valid for Jetson only) 4.3

Hi all,

We are working with DeepStream metadata and the nvdsosd element. We basically have a custom GStreamer element that receives JSON-encoded metadata as property and adds it to the current buffer metadata. The process is pretty straight forward and overall it is working fine, the overlay recognizes the metadata we are adding and draws it fine:

  • A python app generates a new meta that wants to be drawn in the buffer.
  • Then encodes the metadata in JSON format and sets it in a property of our custom element. For example:
{"text_params":[{"display_text":"WATCH","x_offset":542,"y_offset":48,"font_name":"Serif","font_size":20,"font_color_green":1,"font_color_red":1,"font_color_blue":1,"font_color_alpha":1,"set_bg_clr":1,"bg_color_red":1,"bg_color_blue":0,"bg_color_green":0,"bg_color_alpha":1}],"rect_params":[{"left":122,"top":238,"width":20,"height":20,"border_width":0,"has_bg_color":1,"bg_color_red":0,"bg_color_green":1,"bg_color_blue":0,"bg_color_alpha":1}]}

The problem is that certain conditions are causing nvdsosd to simply crash with a segmentation fault. Here is what we have found so far:

  • Adding more than 16 rect_params to an NvDsDisplayMeta will cause the error.
  • Adding more than 25 text_params to an NvDsDisplayMeta will cause the error.
  • Adding more than 17 line_params to an NvDsDisplayMeta will cause the error.
  • There is an interaction between line_params and text_params. If I add 25 text_params I can only add 1 line_params without causing the error.

We want to know:

  • What is causing these errors?
  • Are these hardware limitations?
  • Is there a workaround?
  • I haven’t tried with multiple NvDsDisplayMeta, maybe that can help?
  • Are there other limitations in nvdsosd that I didn’t list before?

Thank you,
Miguel

1 Like

Max elements in NvDsDisplayMeta are set to 16. The structure of NvDsDisplayMeta is defined in deepstream-5.0\sources\includes\nvdsmeta.h
If more than 16 elements are needed, need to create new display_meta for the extra elements with nvds_acquire_display_meta_from_pool() function.

1 Like