Hi all
This is my step to custom deepstream test5 app for generate base64 from opencv mat frame and GstBuffer:
-
Creat deepstream_nvdsanalytics_meta.cpp deepstream_nvdsanalytics_meta.cpp (6.6 KB)
In this file i creat a function enc_object2base64(GstBuffer * buf){…} to read GstBuffer and return base64 string. -
Edit Makefile to use OpenCV and deepstream_nvdsanalytics_meta.cpp in deepstream_test5_app_main.c Makefile (3.1 KB).
-
Custom deepstream_test5_app_main.c deepstream_test5_app_main.c (52.0 KB)
extern char* enc_object2base64(GstBuffer * buf); static void generate_event_msg_meta (gpointer data, gint class_id, gboolean useTs, GstClockTime ts, gchar * src_uri, gint stream_id, guint sensor_id, NvDsObjectMeta * obj_params, float scaleW, float scaleH, NvDsFrameMeta * frame_meta, GstBuffer * buf) { ... meta->videoPath = g_strdup(enc_object2base64(buf)); ... }
Problem: When i set source in config file is an uri=file:/…/…/test/video-test.mp4 or uri=rtsp://xxx.yyy.zzz:abcd/axis-media/media.amp?videocodec=h264 so project working well. But with source is an: uri=rtsp://xxx.xxx.xxx:yyyy/stream/jpeg i get error
Bus error (core dumped)
in enc_object2base64(GstBuffer * buf){…} at line:
cv::imencode(“.jpg”,bgr_frame,encode_buffer);
[source0]
enable=1
#Type - 1=CameraV4L2 2=URI 3=MultiURI
type=3
#uri=file:/…/…/test/video-test.mp4
#uri=rtsp://xxx.yyy.zzz:abcd/axis-media/media.amp?videocodec=h264
uri=rtsp://xxx.xxx.xxx:yyyy/stream/jpeg
num-sources=1
gpu-id=0
nvbuf-memory-type=0
So I think the problem is with the memory of the cv :: imencode function and the memory of the decode mjpeg video stream, help me
this is my old post How to convert object image to base64 but it not clear.
• Hardware Platform Jetson
• DeepStream 5.0
• JetPack Version 4.4
• Issue Type bugs