VIdeoPath in kafka messages

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU) : RTX6000
• DeepStream Version : 6.2
• TensorRT Version
• NVIDIA GPU Driver Version (valid for GPU only)
• Issue Type( questions, new requirements, bugs) : Hi everyone. I have been trying to get the videoPath in the kafka messages when we turn on the smart record. I have added the VideoPath in the msgconv for minimal schema. But when I use the smart record plugin, video clip gets saved but I don’t see any path in the kafka messages. Can someone help me in this. Thanks

please check if the user data was added. msgconv plugin and low level lib is opensource, you can add log to check.
please refer to this topic for how to add user data.

1 Like

Thanks @fanzh for your response. My doubt is from where I can access the videopath so I can add it in the minimal schema?

I am trying to fetch videoPath from NvDsEventMsgMeta and adding in the generate_dsmeta_message_minimal schema. but when smart record is on and I am able to save clips of events, I don’t see the videoPath in the kafka messages

In issue description, you said "I have added the VideoPath in the msgconv for minimal schema. ". did you add videopath in msgconv?

No. I didn’t add there. I looked in the source code but I was a bit confused where to add the videoPath.

In deespstream_test5_app_main.c In the function “generate_event_msg_meta” I am trying to add the videopath like following:
static void
generate_event_msg_meta (AppCtx * appCtx, 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)
NvDsEventMsgMeta *meta = (NvDsEventMsgMeta *) data;
GstClockTime ts_generated = 0;
NvDsSrcParentBin *pBin = &appCtx->pipeline.multi_src_bin;
NvDsSRContext *srCtx = NULL;
srCtx = (NvDsSRContext *) pBin->sub_bins[sensor_id].recordCtx;
gchar *video_file_name_direct;
if (srCtx != NULL){
if (srCtx->recordOn)
GValue val = G_VALUE_INIT;
g_object_get_property(G_OBJECT (srCtx->filesink), “location”, &val);
video_file_name_direct = gst_value_serialize (&val);
g_print ("\n Smart Record : %s ", video_file_name_direct);
g_free (video_file_name_direct);
g_value_unset (&val);

meta->objType = NVDS_OBJECT_TYPE_UNKNOWN; /**< object unknown /
The sensor_id is parsed from the source group name which has the format

  • [source]. */
    meta->sensorId = sensor_id;
    meta->placeId = sensor_id;
    meta->moduleId = sensor_id;
    meta->frameId = frame_meta->frame_num;
    meta->ts = (gchar *) g_malloc0 (MAX_TIME_STAMP_LEN + 1);
    meta->objectId = (gchar *) g_malloc0 (MAX_LABEL_SIZE);
    meta->videoPath = (gchar *) g_malloc0 (1024);
    strncpy (meta->objectId, obj_params->obj_label, MAX_LABEL_SIZE);
    strncpy (meta->videoPath,video_file_name_direct,1024);

But its giving segmenation fault

can you add log or use gdb to debug? which code line cause the error?

I am sharing the test5 main file plus the gdb output. in the app config I am using payload 0 for kafka and using yolov8 model with 4 classes
deepstream_test5_app_main(1).c (54.1 KB)

can you narrow down this issue? can the app print video_file_name_direct and meta->videoPath normally?

Yes I can print the result on terminal for the video path. but when I try to add that path to meta->videoPath, thats when segmentation fault happens

the meta->videoPath remains null :
Smart Record : /home/bulk/ds_configs/recorded_videos/cam0_0_00000_20230823-073820_8328.mp4
META PATH : (null)
Smart Record : /home/bulk/ds_configs/recorded_videos/cam0_0_00000_20230823-073820_8328.mp4
META PATH : (null)

after this code, can the app print meta->videoPath normally?

No, i does not. before it segmentation fault occurs

I added 1.txt code to test5, and I can’t reproduce this issue, please refer to the log test.txt. please narrow down the issue.
1.txt (436 Bytes)
test.txt (2.6 KB)

Hi @fanzh. I got it to work. we added file path in objectmeta and then added in code to parse it in msgconv.Now I have question regarding specific recording. Is there a way we can supress specific class recording. I have one class named “X” which I don’t want to record

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

smart recording will record the whole frame, if there are X class objects and notX class objects in a frame, what do you expect to record?

1 Like

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