NvDsEventMsgMeta and the nvmsgconv output

• Hardware Platform (Jetson / GPU) : GPU
• DeepStream Version : 7.0
• TensorRT Version : 8.6.1
• NVIDIA GPU Driver Version (valid for GPU only) : 535.171.04
• Issue Type( questions, new requirements, bugs) : questions

Hello,

I have a few questions about nvmsgconv and the metadata system. I am trying to add a JSON string to the NvDsEventMsgMeta, so that I can use nvmsgconv to relay important information downstream.

I have used the code shared here by @miguel.taylor to add the desired metadata to each frame, but as soon as I put my custom string to be msg_meta.otherAttrs, I seem to lose the string, and the value of msg_meta.otherAttrs is a number (e.g. 139954732925728), so in the following function in the 5th line meta_str is a string, but after the 5th line, msg_meta.otherAttrs is a number:

def _add_custom_meta_to_buffer(meta_str, batch_meta, frame_meta):
    user_event_meta = pyds.nvds_acquire_user_meta_from_pool(batch_meta)
    msg_meta = pyds.alloc_nvds_event_msg_meta(user_event_meta)
    msg_meta = pyds.NvDsEventMsgMeta.cast(msg_meta)
    msg_meta.otherAttrs = meta_str

Besides this problem, I have another question about nvmsgconv. I have set it up after the element which adds the above metadata to the pipeline, but I do not see any fields from the NvDsEventMsgMeta in the debug file dump that can be created with debug-payload-dir.

Could you help me to:

  • Add the string to otherAttrs correctly,
  • and make it appear in the nvmsgconv output?

Thank you for your help!

after finding otherAttrs in DeepStream 7.0 SDK, this value is not add to Json string. For a workaround, you can set string meta_str to meta->videoPath, which will be added to Json string. nvmsgconv plugin and low-level lib are opensource. please refer to the code generate_event_message of opt\nvidia\deepstream\deepstream-7.0\sources\libs\nvmsgconv\deepstream_schema\eventmsg_payload.cpp.

Hello @fanzh,
Sorry for the late answer, I have managed to get it working.

My solution for the second question:
In the end I have added this line to the generate_event_message function of the eventmsg_payload.cpp file:

json_object_set_string_member (rootObj, “otherAttrs”, meta->otherAttrs);

My solution for the first question:

I have modified the add_custom_meta_to_buffer function from the mentioned previous issue:

user_event_meta = pyds.nvds_acquire_user_meta_from_pool(batch_meta)
msg_meta = pyds.alloc_nvds_event_msg_meta(user_event_meta)
msg_meta = pyds.NvDsEventMsgMeta.cast(msg_meta)
msg_meta.otherAttrs = meta_str

One thing to note is that msg_meta.otherAttrs contains a pointer to the string now, so do not be surprised if its value here is not the expected string, pyds will handle it internally to set the string in the nvmsgconv message.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.