NvDsEventMsgMeta in DeepStream 5.0

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU) AGX
• DeepStream Version 5.0
• JetPack Version (valid for Jetson only) 4.4 DP
• TensorRT Version
• NVIDIA GPU Driver Version (valid for GPU only)

Hi, I’ve the working pipeline on ds4.0 with NvDsEventMsgMeta and gstexample.
If I run that pipeline on ds5.0 in gstexample i get wrong bbox coordinates. It’s seems like gstexample does’t recieved bboxes coordinates:
“frame”:1145, “tracking_id”:242, “bboxLeft”:1129219368.0, “bboxTop”:1125105936.0, “bboxWidth”:1121948958.0, “bboxHeight”:1120125723.0

What is the pipeline? Can you upload you codes or tell us how to reproduce the error?

Hi, @Fiona.Chen!
My pipeline is uridecodebin -> streammux -> pgie -> nvtrack -> nvvidconv -> nvosd -> dstexample -> sink.
I add NvDsEventMsgMeta after nvosd
gst_element_get_static_pad (nvosd, "src");

NvDsEventMsgMeta *msg_meta = (NvDsEventMsgMeta *) g_malloc0 (sizeof (NvDsEventMsgMeta));
if (g_hash_table_lookup(table, object_tracking_id)){
  zone_id = GPOINTER_TO_INT(g_hash_table_lookup(table, object_tracking_id));
  generate_event_msg_meta(msg_meta, obj_meta->class_id, obj_meta, frame_meta, zone_id);
  NvDsUserMeta *user_event_meta = nvds_acquire_user_meta_from_pool (batch_meta);
  if (user_event_meta) {
    user_event_meta->user_meta_data = (void *) msg_meta;
    user_event_meta->base_meta.batch_meta = batch_meta;
    user_event_meta->base_meta.meta_type = NVDS_EVENT_MSG_META;
    user_event_meta->base_meta.copy_func = (NvDsMetaCopyFunc) meta_copy_func;
    user_event_meta->base_meta.release_func = (NvDsMetaReleaseFunc) meta_free_func;
    // user_event_meta->base_meta.copy_func = (NvDsMetaCopyFunc) copy_user_meta;
    // user_event_meta->base_meta.release_func = (NvDsMetaReleaseFunc) release_user_meta;
    nvds_add_user_meta_to_frame (frame_meta, user_event_meta);
  } else {
      g_print ("Error in attaching event meta to buffer\n");
  }
static void generate_event_msg_meta (gpointer data, gint class_id,
    NvDsObjectMeta * obj_params, NvDsFrameMeta* frame_meta, gint zone_id)
{
  NvDsEventMsgMeta *meta = (NvDsEventMsgMeta *) data;
  GstClockTime ts_generated = 0;

  meta->objType = NVDS_OBJECT_TYPE_UNKNOWN; /**< object unknown */
  /* The sensor_id is parsed from the source group name which has the format TODO!!!
   * [source<sensor-id>]. */
  meta->sensorId = 1;
  meta->placeId = zone_id;
  meta->moduleId = 1;
  meta->frameId = frame_meta->frame_num;
  meta->ts = (gchar *) g_malloc0 (MAX_TIME_STAMP_LEN + 1);
  meta->objectId = (gchar *) g_malloc0 (MAX_LABEL_SIZE);

  strncpy(meta->objectId, obj_params->obj_label, MAX_LABEL_SIZE);
  generate_ts_rfc3339 (meta->ts, MAX_TIME_STAMP_LEN);

  meta->bbox.left = obj_params->rect_params.left;
  meta->bbox.top = obj_params->rect_params.top;
  meta->bbox.width = obj_params->rect_params.width;
  meta->bbox.height = obj_params->rect_params.height;
  /** tracking ID */
  meta->trackingId = obj_params->object_id;
  (void) ts_generated;

  if (class_id == PGIE_CLASS_ID_VEHICLE) {
    meta->type = NVDS_EVENT_MOVING;
    meta->objType = NVDS_OBJECT_TYPE_VEHICLE;
    meta->objClassId = PGIE_CLASS_ID_VEHICLE;
    meta->extMsg = NULL;
    meta->extMsgSize = 0;
  }
}

Into gstexample.cpp

for (l_user_meta = frame_meta->frame_user_meta_list; l_user_meta != NULL; l_user_meta = l_user_meta->next) 
{
  user_meta = (NvDsUserMeta *) (l_user_meta->data);
  user_meta_data = (NvDsEventMsgMeta *) (user_meta->user_meta_data);
  if (user_meta_data->objType == NVDS_OBJECT_TYPE_VEHICLE) {
    char trackingId[12] = {0};
    sprintf(trackingId, "%d", user_meta_data->trackingId);
    g_print("\nzone is %d bboxLeft %d\n", user_meta_data->placeId, user_meta_data->bbox.left);
}

result is zone is 1 bboxLeft 1129219368.0 on ds5.0 and zone is 1 bboxLeft 123.0 on ds4.0

Sorry for late response! I think you have not read the release note of DS5.0. The data type of bbox is changed from integer to floating. You need to print the coordination with correct format.
https://docs.nvidia.com/metropolis/deepstream/dev-guide/DeepStream_Development_Guide/baggage/structNvDsRect.html

1 Like