How to send a message with custom data via nvmsgconv

Hello, I am trying to write a script which sends data gathered from video feed run threw DeepStream to Kafka in Azure EventHubs and I ran into an issue. I am using Python I would like to send a custom message which would contain data about the vehicle which passed by the camera as such (current speed, average speed, highest speed, …). I would like to send them in a JSON format. For the seding of the message I am using nvmsgconv in my pipeline. Unfortunately I can’t find anywhere how to add those custom data to the message. How to also configure the .txt config file of the nvmsgconv? The output that would be send to kafka should look something like this: {“messageId”:1234, “data”:{“average_speed”:38, “max_speed”:45}}

Here is the current code which unfortunately doesn’t work (it doesn’t output anything like that is in this code):

            user_event_meta = pyds.nvds_acquire_user_meta_from_pool(batch_meta)
            if user_event_meta:
                data = {
                    "custom_objects": obj_count
                }
                json_data = json.dumps(data)
                buffer = ctypes.create_string_buffer(json_data.encode("utf-8"))
                # Create a PyCapsule that wraps our C buffer.
                ctypes.pythonapi.PyCapsule_New.restype = ctypes.py_object
                capsule = ctypes.pythonapi.PyCapsule_New(buffer, None, None)
                msg_meta = pyds.alloc_nvds_event_msg_meta(user_event_meta)
                msg_meta.extMsg = capsule
                user_event_meta.user_meta_data = msg_meta
                user_event_meta.base_meta.meta_type = pyds.NvDsMetaType.NVDS_EVENT_MSG_META
                pyds.nvds_add_user_meta_to_frame(frame_meta, user_event_meta)
                print("Event generated\n")

            else:
                print("Error in attaching event meta to buffer\n")

Please provide complete information as applicable to your setup.
• Hardware Platform (Jetson / GPU)
• DeepStream Version
• JetPack Version (valid for Jetson only)
• TensorRT Version
• NVIDIA GPU Driver Version (valid for GPU only)
• Issue Type( questions, new requirements, bugs)
• How to reproduce the issue ? (This is for bugs. Including which sample app is using, the configuration files content, the command line used and other details for reproducing)
• Requirement details( This is for new requirement. Including the module name-for which plugin or for which sample application, the function description)

I am using X86 Nvidia GPU, DeepStream 7.1, CUDA version 12.6, Driver version is 560.35.05. I need to know how to send the custom message, so I need to get the right code and config to do it

Please refer to payload-with-custom-objects for how to add custom information.
As the doc shown, the low-level lib only handles some standard types of objects (Vehicle, Person, Face, etc.) and generates the Json String, if you want to use NvDsEventMsgMeta to add new information, please modify generate_object_object of \opt\nvidia\deepstream\deepstream\sources\libs\nvmsgconv\deepstream_schema\dsmeta_payload.cpp to customize. please refer to this topic.