• Jetson Xavier NX
• DeepStream Version: 5
• JetPack Version 4.4
I have added new nvdsmeta_schema.h and for adding base64 encoded cropped image to my event.
I getting my cropped image buffer from deepstream_image_meta_test by adding the probe to pgie to attach the cropped image meta data.
typedef struct NvDsCropImageObject {
/** Pointer to the JPEG Encoded Object */
gchar *base64_img;
} NvDsCropImageObject;
// deepstream_test5_app_main.c
// the way How i encode the cropped image buffers.
obj->base64_img = g_base64_encode((gchar *)enc_jpeg_image->outBuffer, enc_jpeg_image->outLen);
meta->extMsg = obj;
meta->extMsgSize = sizeof(NvDsCropImageObject);
Then I added the following code to convert the data to nvmsgconv.cpp in generate_object_object function by converting to json for sending to AMQP broker.
case NVDS_OBJECT_TYPE_CUSTOM:{
// g_print("NVDS_CROP_IMAGE_META!\n");
if (meta->extMsgSize) {
NvDsCropImageObject *dsObj = (NvDsCropImageObject *)meta->extMsg;
// gchar *base64_img = (gchar *)meta->extMsg;
jobject = json_object_new ();
// g_print("set binary!!\n");
json_object_set_string_member (jobject, "base64", dsObj->base64_img);
// g_print("set binary! done!\n");
json_object_set_object_member (objectObj,"image", jobject);
// g_print("NVDS_CROP_IMAGE_META DONE!\n");
break;
}
}
However, I got the following error after receiving 2 times from amqp client code.
malloc_consolidate(): invalid chunk size
Am I missing something by adding to extMsg? I know that by adding extMsg need to handle the meta_copy_func and meta_free_func. So I added my custom NvDsCropImageObject in meta_copy_func and meta_free_func. but it still not working. Anyone can help me with this?