NvMsgConv Custom Payload to send image and its metadata through message broker

hi,

i have problem to send batch metadata through message broker, Basically nvstreamuxer forms batch now i would like to send batch frame with bounding boxes, so far i know that NvDsStreamMeta gives the batch images but i am unable to parse the individual frame/buffer and its metadata such as bounding boxes associated with each frame/buffer. following is the script i have written. Any help would be appreciated. thanks in advance,

GstBuffer *buf = (GstBuffer *) info->data;

NvDsStreamMeta* stream_meta = gst_buffer_get_nvstream_meta(buf);
if (stream_meta!=NULL)
{
    for (auto n=0; n<stream_meta->num_filled; n++) {
            streamid = stream_meta->stream_id[n];
        // auto index = stream_meta->surface_index[n];
            g_pointer hostmem = (g_uint8)g_malloc(nvbuff->size)
            cudaMemcpy(hostmem, nvbuff->allocated_mem[index*size], nvbuff->size)
            
        }
}

Hi

NvDsStreamMeta is used for internal batch streams processing. And we don’t public gstnvstreammeta.h

I think you should use NvDsFrameMeta/NvDsLineMeta/… in gstnvdsmeta.h. You can use the API in this head file to add/get/update “NvDsMeta”.

In sources/gst-plugins/gst-nvmsgconv/gstnvmsgconv.c gst_nvmsgconv_transform_ip(), it will convert “NvDsMeta” to json payload (NVDS_META_PAYLOAD) metadata

In sources/gst-plugins/gst-nvmsgbroker, gst_nvmsgbroker_render() will send NVDS_META_PAYLOAD metadata payload.

hi,

Thanks for reply i have actually resolved the issue. you are right i am using NvDsFrameMeta, but now i am facing a different issue when i use a single source to send metadata through kafka i am able to do that but when i want to send meta-data for more than one source then i am unable to send the meta-data information. For single source i am using deepstream-app4 while for multiple uri’s i have done changes in deepstream-360 app. I don’t know what to do

i am unable to send the meta-data information.
Can you elaborate your problem?
gst-nvmsgconv and gst-nvmsgbroker source code is there. You can debug by yourself firtly.

I am also struggling with the problem of sending raw images through NvMsgConv. Have you solved the problem? can you share your result? Thanks in advance.

Hi @czxis,

Well kafka is not intended for that purpose, if you want to send an image you have to write another plugin for that which could ideally send an image or write it to specific location. i was not able to send an image or may be you can send but its not for what kafka is used, do changes in the Nvmsgconv library to change the payload embed your image there.

I need a different schema for nvmsgconv. But it always takes the NvDsEventMsgMeta which has fields that I don’t require. Also I want to add new fields. Can someone suggest a way to start?

1 Like