How to save full frame from usrMetaData?

Please provide complete information as applicable to your setup.

**• Hardware Platform (Jetson / GPU): Orin NX
**• DeepStream Version: 6.2
**• JetPack Version (valid for Jetson only): 5.1
**• TensorRT Version: 8.5.2.2
**• NVIDIA GPU Driver Version (valid for GPU only): Orin NX
**• Issue Type( questions, new requirements, bugs): Questions
**• Requirement details( This is for new requirement. Including the module name-for which plugin or for which sample application, the function description): deepstream_app & deepstream_image_meta_test

I used the image-saving feature in deepstream_image_meta_test.c and put it into the gie_primary_processing_done_buf_prob() function of deepstream-app. However, my userMetalist is always null. How can I get the buffer of the image?

gint frame_number = 0, frame_count = 0;
 NvDsMetaList *l_frame = NULL;
  for (l_frame = batch_meta->frame_meta_list; l_frame != NULL;
      l_frame = l_frame->next) {
    NvDsFrameMeta *frame_meta = (NvDsFrameMeta *) (l_frame->data);
    int offset = 0;
  /* To verify  encoded metadata of cropped frames, we iterate through the
    * user metadata of each frame and if a metadata of the type
    * 'NVDS_CROP_IMAGE_META' is found then we write that to a file as
    * implemented below.
    */
    char fileFrameNameString[FILE_NAME_SIZE];
    const char *osd_string = "OSD";

    /* For Demonstration Purposes we are writing metadata to jpeg images of
      * the first 10 frames only.
      * The files generated have an 'OSD' prefix. */
    if (frame_number < 11) {
      NvDsUserMetaList *usrMetaList = frame_meta->frame_user_meta_list;
      FILE *file;
      int stream_num = 0;
      LOG_ERR("fn %s", usrMetaList);
      while (usrMetaList != NULL) {
        NvDsUserMeta *usrMetaData = (NvDsUserMeta *) usrMetaList->data;
        if (usrMetaData->base_meta.meta_type == NVDS_CROP_IMAGE_META) {
          snprintf (fileFrameNameString, FILE_NAME_SIZE, "%s_frame_%d_%d.jpg",
              osd_string, frame_number, stream_num++);
          NvDsObjEncOutParams *enc_jpeg_image =
              (NvDsObjEncOutParams *) usrMetaData->user_meta_data;
          /* Write to File */
          file = fopen (fileFrameNameString, "wb");
          LOG_ERR("write %s", fileFrameNameString);
          fwrite (enc_jpeg_image->outBuffer, sizeof (uint8_t),
              enc_jpeg_image->outLen, file);
          fclose (file);
        }
        usrMetaList = usrMetaList->next;
      }
    }
      frame_number++;
  }

here is a topic to save the full frame: How to encode multiple images using the same objectMeta inside obj_meta_list - #5 by fanzh

When I use nvds_obj_enc_process() to save images, I encounter frame rate drops, as I mentioned in another post about Frame rate drops when saving jpg files in Deepstream 6.2 SDK - Intelligent Video Analytics / DeepStream SDK - NVIDIA Developer Forums

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.