Please provide complete information as applicable to your setup.
• Hardware Platform Jetson Xavier AGX
• DeepStream Version 5.1
• JetPack Version 4.5.1
• TensorRT Version 7.1.3
Hello! I am trying to make a plugin which is similar to tiler but with crops. It works well with just sink but when I add nvdsosd, its giving error:
nvbufsurface: error in mapping
libnvosd (93):(ERROR) : Buffer mapping failed
ERROR from element nvdsosd0: Unable to draw rectangles
I copy the original object meta as following:
batch_meta_out = nvds_create_batch_meta(1);
if (batch_meta_out == NULL) {
GST_ERROR ("Error: Could not create batch meta");
goto error;
}
batch_meta_out->base_meta.batch_meta = batch_meta_out;
batch_meta_out->base_meta.copy_func = nvds_batch_meta_copy_func;
batch_meta_out->base_meta.release_func = nvds_batch_meta_release_func;
batch_meta_out->max_frames_in_batch = 1;
frame_meta_out = nvds_acquire_frame_meta_from_pool(batch_meta_out);
for (l_frame = batch_meta->frame_meta_list; l_frame != NULL;
l_frame = l_frame->next) {
NvDsFrameMeta *frame_meta = (NvDsFrameMeta *) (l_frame->data);
for (l_obj = frame_meta->obj_meta_list; l_obj != NULL; l_obj = l_obj->next) {
obj_meta = (NvDsObjectMeta *) (l_obj->data);
obj_meta_out = nvds_acquire_obj_meta_from_pool(batch_meta_out);
obj_meta_out->unique_component_id = obj_meta->unique_component_id;
obj_meta_out->class_id = obj_meta->class_id;
obj_meta_out->confidence = obj_meta->confidence;
obj_meta_out->parent = NULL;
g_strlcpy(obj_meta_out->obj_label, obj_meta->obj_label, MAX_LABEL_SIZE);
obj_meta_out->rect_params.top = obj_meta->rect_params.top;
obj_meta_out->rect_params.left = obj_meta->rect_params.left + offset;
obj_meta_out->rect_params.width = obj_meta->rect_params.width;
obj_meta_out->rect_params.height = obj_meta->rect_params.height;
//g_print("%f %f %f %f\n", obj_meta_out->rect_params.top,
// obj_meta_out->rect_params.left,
// obj_meta_out->rect_params.width,
// obj_meta_out->rect_params.height);
nvds_add_obj_meta_to_frame(frame_meta_out, obj_meta_out, NULL);
}
offset += 1000;
}
nvds_add_frame_meta_to_batch(batch_meta_out, frame_meta_out);
Any idea what I am missing here?