Adding unique display meta to each stream in a tiled OSD (python)

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson/GPU) Jetson
• DeepStream Version 5.1
• JetPack Version (valid for Jetson only) Tegra 5.1 / GCID: 26202423 / Board: t186ref
• TensorRT Version 7.1.3
• NVIDIA GPU Driver Version (valid for GPU only)
• Issue Type( questions, new requirements, bugs) Question about Frame/Display metadata for tiled displays in python apps
• Requirement details( This is for new requirement. Including the module name-for which plugin or for which sample application, the function description) pyds.nvds_acquire_display_meta_from_pool(batch_meta)

Hello,

I have a pipeline with 6 RTSP streams and a tiled OSD. I was doing testing with just one stream and was using the display meta(display_meta=pyds.nvds_acquire_display_meta_from_pool(batch_meta)) to add text/shapes onto the display with positional relationship to the obj indentified on in the frame - example below:

while l_obj is not None:
try:
#Meta data supplied by inference engine
obj_meta=pyds.NvDsObjectMeta.cast(l_obj.data)
if obj_meta.rect_params.left < 0:
obj_meta.rect_params.left = 1
if obj_meta.rect_params.top < 0:
obj_meta.rect_params.top = 1
if obj_meta.rect_params.width < 0:
obj_meta.rect_params.width = 1
if obj_meta.rect_params.height < 0:
obj_meta.rect_params.height = 1

          obj_meta.rect_params.border_color.set(0, 0, 1, 1)
          obj_meta.rect_params.border_width = 5

          for i in range(display_meta.num_lines):
              if i >= 2:
                  display_meta.line_params[i].y1 = int(obj_meta.rect_params.top)
                  y2 = int(int(obj_meta.rect_params.top)+int(obj_meta.rect_params.height))
                  display_meta.line_params[i].y2 = int(y2)
                  display_meta.line_params[i].line_width = 5
          display_meta.line_params[2].line_color.set(1, 1, 0, 1.0) # Set to Yellow 
          display_meta.line_params[3].line_color.set(1, 0, 0, 1.0) # Set to Red     

How would I go about adding unique displayMeta to each frame of the batch meta/tiled display?

Thanks for your help

please refer to osd_sink_pad_buffer_probe of deepstream_test_1.py, it will loop every frame of batch, then call “pyds.nvds_add_display_meta_to_frame(frame_meta, display_meta)” to add one displaymeta to each frame.