Image save problem: Segmentation fault in nvds_obj_enc_process

Please provide complete information as applicable to your setup.

• Hardware Platform: Jetson AGX Orin)
• DeepStream Version: 6.1
• JetPack Version: 5.0.2.
• TensorRT Version: 8.4.1
• Issue Type: Question

I am trying to use the image save feature.

I am calling nvds_obj_enc_process like this:
nvds_obj_enc_process(*img_save_instance->obj_enc_ctx, &userData, ip_surf, obj_meta, frame_meta);

I am getting a segmentation fault in this function call and it never returns.

Following the samples, this is my initialization of userData:

        NvDsObjEncUsrArgs userData = { 0 };
        /* To be set by user */
        userData.saveImg = save_img;
        userData.attachUsrMeta = attach_user_meta;
        /* Set if Image scaling Required */
        userData.scaleImg = FALSE;
        userData.scaledWidth = 0;
        userData.scaledHeight = 0;
        /* Preset */
        userData.objNum = num_rects;
        /* Quality */
        userData.quality = 80;

In this case, userData.fileNameImg will be initialized to 0.
If I do this instead: userData.fileNameImg[0] = '\0',

This function now returns, with this error: Error: Scaled object dimensions cannot be non-positive. Object not encoded.

The seg faut now occurs on the call to nvds_obj_enc_finish:
nvds_obj_enc_finish(*img_save_instance->obj_enc_ctx);

I don’t have the source code to nvds_obj_enc_process so I cannot figure out where this error is coming from. This image save feature was working as expected in Deepstream 5. Any help is appreciated, thanks.

Could you run our demo test to verify if that works well?

sources\apps\sample_apps\deepstream-image-meta-test

Also we recommend that you upgrade to our latest version 7.0.

There is no update from you for a period, assuming this is not an issue anymore. Hence we are closing this topic. If need further support, please open a new one. Thanks

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