Hi all
In deepstream test5 app, i was get object image file by function nvds_obj_enc_process. But this function write obj to jpeg file in disk, so i can’t get this object to convert to base64.
How can i convert this image to base64 in deepstream test5 app ?
thank so much
i try with mp4 source with type=3 it working well, but change to rtsp source with type=4 it not working and get Segmentation fault ( core dumped ) at line:
Are you using deepstream-app? If so, you need to show us your deepstream-app config file. If you have modified deepstream-app source codes, you need to tell us where and how the codes are changed and why you change them in this way. In fact, your above description is vague and confused, we don’t understand what is happenning.E.g.you don’t tell us where your “enc_object2base64” function is invoked, and what your “base64” mean?
Create file deepstream_nvdsanalytics_meta.cpp with contain
Cutom makefile to include opencv and use deepstream_nvdsanalytics_meta.cpp in deepstream_test5_app_main.cMakefile (3.1 KB)
in deepstream_test5_app_main.c file i call extern char* enc_object2base64(GstBuffer * buf) and use this function in generate_event_msg_meta to get base64 string of image object decode. deepstream_test5_app_main.c (52.0 KB) deepstream_nvdsanalytics_meta.cpp (7.5 KB)
You transferred “GstBuffer *” to enc_object2base64(), but why you use this “GstBuffer *” as “NvBufSurface *” inside enc_object2base64()? It is wrong. “GstBuffer” is not “NvBufSurface”.
Look at this line in generate_event_msg_meta():
meta->videoPath = g_strdup(enc_object2base64(buf));
But you define enc_object2base64() as an “void” function, it does not return anything.
How could you pass the return value to “meta->videoPath”? Do you really understand what you are doing?
The last and most fatal error is that “in_mat” is defined in enc_object2base64() function, it will not be maintained outside this function. It will cause crash if the address of “in_mat” is been used in other places. The address means nothing outside enc_object2base64(), I don’t understand why you want to transfer this address to others. I think it is not a reasonable requirement for DeepStream or even for any c/c++ based application.