After acquiring display meta from the pool and filling it's text params, not able to see it on scree...

Hello everyone,

I would like to ask that, I want to display the count text on each frame.

Therefore in my custom plugin, I have added the display meta to the frame meta after populating the display meta structure with the text i want. However, frame is rendered at the end without my added display meta for the text.

My current logic to achieve that is mentioned below:

In my gst-plugin which is of GSTBaseTransform type , I am reading each framemeta present in a batch which is being received in my plugin’s transform_ip () function.

My logic of adding the display meta to each frame is :

static void
attach_displaymetadata_full_frame (GstMyCount * mycount, NvDsFrameMeta * frame_meta, guint Source_id,
gdouble scale_ratio, guint batch_id)
NvDsBatchMeta *batch_meta = frame_meta->base_meta.batch_meta;
NvDsDisplayMeta *display_meta = NULL;
display_meta = nvds_acquire_display_meta_from_pool(batch_meta);

nvds_acquire_meta_lock (batch_meta);

  NvOSD_TextParams & text_params = display_meta->text_params[0];
  text_params.x_offset = 500;
  text_params.y_offset = 500;
   // Font face, size and color
  text_params.font_params.font_name = (char *)"Serif";
  text_params.font_params.font_size = 11;
  text_params.font_params.font_color = (NvOSD_ColorParams) {1, 1, 1, 1};
  // display_text required heap allocated memory
  text_params.display_text = g_strdup ("Count");

// Set black background for the text
text_params.set_bg_clr = 1;
text_params.text_bg_clr = (NvOSD_ColorParams) {0, 0, 0, 1};

nvds_add_display_meta_to_frame( frame_meta, display_meta);

nvds_release_meta_lock (batch_meta);


Notice: data is getting added to the framemeta(checked) but not being rendered on the display.

Looking forward to get some help from the nvidia’s deepstream library maintainers, as to what am i missing here.

Could you refer deepstream_test1_app.c->osd_sink_pad_buffer_probe?

One guess is maybe the coordinate out of the on screen window size, how about your output resolution?

Thanks bcao for pointing me towards the right direction, but the actual issue was : As after acquiring display_meta from the meta pool of the batch_meta, one needs to set display_meta->num_labels = 1; , as before filling in the display meta’s text_params for the entire frame, one should specify how many string labels will it be displaying beforehand.