Sending custom object to backend server from DeepStream

I need to send custom object (2-D array) data to backend server from Deepstream code.
Deepstream-test4 uses Gst-nvmsgconv and Gst-nvmsgbroker plugins.

nvmsgconv has NvDsEventMsgMeta structure with extMsg field.
Then payload is generated for metadata inside NvDsEventMsgMeta structure.
(1)My first query is how can I attach 2D array data to NvDsEventMsgMeta’s extMsg field?
Since I need to send only that 2D array object,
(2)how can I get payload only with 2D object without any other metadata.
I don’t need to send other metadatas like box, location, coordinate etc.
Is it possible to modify in nvmsgconv.cpp file?

Which sample should I see to attach custom object to NvDsEventMsgMeta?

There is custom object type in DeepStream. You can use this type.
Is the custom object (2-D array) generated by inference network? If so, you need to make sure the custom object type is “NVDS_OBJECT_TYPE_CUSTOM”.

  1. You can handle NVDS_OBJECT_TYPE_CUSTOM type NvDsEventMsgMeta with you own object data structure.
  2. And for this object type, you can implement your own extMsg field handling inside nvmsgconv.cpp(generate_object_object).

Yes say 2D array is put into NVDS_OBJECT_TYPE_CUSTOM, then how to attach/implement extMsg inside NvDsEventMsgMeta. Same as getting meta from probing gst_buffer_get_nvds_batch_meta?

So I need some modification inside nvmsgconv.cpp so that only NVDS_OBJECT_TYPE_CUSTOM is converted to JSON to send to backend?

Which sample does this attachment?

Refer to osd_sink_pad_buffer_probe() and generate_event_msg_meta() in deepstream_test4_app.c, create new NvDsEventMsgMeta, fill the content and give it to new NvDsUserMeta. Then attach the NvDsUserMeta to frame meta with nvds_add_user_meta_to_frame().
Yes, nvmsgconv.cpp should be modified.

Thank you.