how to write a sink plugin to save image without use eglsink?


I want to write a sink plugin to crop image from source buffer and save, I don’t want to use eglsink to show. if there are some demos to reference ?


We have implemented ‘Encode + File Save’

Please refer to source code of deepstream-app.


I have another question:

When In nvinfer plugin callback function, I added object meta to frame

nvds_add_obj_meta_to_frame(frame_meta, object_meta, NULL);

So if I have to do release function in my sink plugins like below use “nvds_remove_obj_meta_from_frame(frame_meta, obj_meta);”:

for (l_obj = frame_meta->obj_meta_list; l_obj != NULL;
             l_obj = l_obj->next){
            obj_meta = (NvDsObjectMeta *) (l_obj->data);
            _FaceDetectInfo fdi;
            fdi.bbox.left = obj_meta->rect_params.left;
   = obj_meta->;
            fdi.bbox.width = obj_meta->rect_params.width;
            fdi.bbox.height = obj_meta->rect_params.height;
            fdi.bbox.score = obj_meta->confidence;
            fdi.objID = obj_meta->object_id;
            g_print ("obj_meta address is %d.\n", obj_meta);
            g_print ("obj_meta left address is %d.\n", fdi.bbox.left);
            g_print ("obj_meta top address is %d.\n",;
            g_print ("obj_meta width address is %d.\n", fdi.bbox.width);
            g_print ("obj_meta height address is %d.\n", fdi.bbox.height);
//            NvDsUserMetaList *usr_data = obj_meta->obj_user_meta_list;
//            g_print ("usr_data address is %d.\n", usr_data);
//            NvDsUserMeta *data = (NvDsUserMeta *)(usr_data->data);
//            _FacePts *pts = (_FacePts *)(data->user_meta_data);
//            fdi.facePts.score = pts->score;
//            fdi.facePts.ptsNum = pts->ptsNum;
            nvds_remove_obj_meta_from_frame(frame_meta, obj_meta);

and when I even I used this function, and frame has not any object anymore, there always exists two object address in frame, if this is a bug?


Please refer to this post