Please provide complete information as applicable to your setup.
• Hardware Platform (Jetson / GPU)
Jetson Orin NX
• DeepStream Version
7.1
• JetPack Version (valid for Jetson only)
6.2
• Issue Type( questions, new requirements, bugs)
Question
Hello I’m using NVDS Smart Recording in my custom deep stream project and creating my contexts per source as such before pipeline starts, I also link them to the
“”"
NvDsSRInitParams sr_params = {0};
sr_params.containerType = NVDSSR_CONTAINER_MP4;
sr_params.cacheSize = 30;
sr_params.defaultDuration = 10;
sr_params.callback = smart_record_callback;
gchar *unique_prefix = generate_unique_filename();
sr_params.fileNamePrefix = unique_prefix;
if (NvDsSRCreate(&smart_record_ctx[source_id], &sr_params) !=
NVDSSR_STATUS_OK) {
g_printerr(“[preallocate_demux_outputs] Failed to create SR ctx for src %u\n”,
source_id);
g_free(unique_prefix);
return false;
}
g_free(unique_prefix);
…
GstElement *queue_sr = gst_element_factory_make(“queue”, NULL);
GstElement *capsfilter_sr = gst_element_factory_make(“capsfilter”, NULL);
GstCaps *caps = gst_caps_from_string(“video/x-h264, stream-format=(string)byte-stream, alignment=(string)au”);
g_object_set(G_OBJECT(capsfilter_sr), “caps”, caps, NULL);
gst_caps_unref(caps);
GstElement *enc_sr = gst_element_factory_make(“nvv4l2h264enc”, NULL);
GstElement *parse_sr = gst_element_factory_make(“h264parse”, NULL);
gst_bin_add_many(GST_BIN(pipeline),
queue_sr, enc_sr, parse_sr, capsfilter_sr,
smart_record_ctx[source_id]->recordbin,
NULL);
… later linking this to nvosd’s after demux element.
“”"
then in my probe after ml Im starting a video recording per detection:
“”"
if (NvDsSRStart(smart_record_ctx[source_id], &session_id, start_time, duration, GUINT_TO_POINTER(source_id)) == NVDSSR_STATUS_OK) {…}
“”"
and my callback is:
“”"
static gpointer smart_record_callback(NvDsSRRecordingInfo *info, gpointer userData) {
g_print(" [Callback] Smart record done. Session: %u File: %s/%s\n",
info->sessionId, info->dirpath, info->filename);
guint source_id = GPOINTER_TO_UINT(userData);
g_print(" [Callback] Source ID: %u\n", source_id);
// use source id to flag recording for particular source as ended
return nullptr;
}
“”"
however Im mostly getting:
RunUserCallback:207: No video stream found
in my console logs. On random occasions callback did work though, but mostly it fails with this. However videos are saved and Im able to play them back on VLC just fine. I need callback to time allow next video to be recorded and also trigger image saving once for each video.
Thanks in advence.