Please provide complete information as applicable to your setup.
• Hardware Platform (Jetson / GPU)
• DeepStream Version 6.0
I’m using the smart recorder well. But it only runs when the type is rtsp, so I’m going to change it.
I set the source0 type to 3(multi-uri) in config txt and changed the create_uridecode_src_bin() part in deepstream_source_bin.c.
The changed parts are as follows.
static gboolean
create_uridecode_src_bin (NvDsSourceConfig * config, NvDsSrcBin * bin)
{
...
NvDsSRContext *ctx = NULL;
...
if (config->smart_record) {
NvDsSRInitParams params = {0};
params.containerType = (NvDsSRContainerType) config->smart_rec_container;
if (config->file_prefix)
params.fileNamePrefix = g_strdup_printf ("%s_%d", config->file_prefix, config->camera_id);
params.dirpath = config->dir_path;
params.cacheSize = config->smart_rec_cache_size;
params.defaultDuration = config->smart_rec_def_duration;
params.callback = smart_record_callback;
if (NvDsSRCreate (&ctx, ¶ms) != NVDSSR_STATUS_OK) {
NVGSTDS_ERR_MSG_V ("Failed to create smart record bin");
g_free (params.fileNamePrefix);
goto done;
}
g_free (params.fileNamePrefix);
gst_bin_add (GST_BIN(bin->bin), ctx->recordbin);
bin->recordCtx = (gpointer) ctx;
}
NVGSTDS_LINK_ELEMENT (bin->fakesink_queue, bin->fakesink);
if (config->dewarper_config.enable) {
gst_bin_add_many (GST_BIN (bin->bin), bin->dewarper_bin.bin, NULL);
NVGSTDS_LINK_ELEMENT (bin->tee, bin->dewarper_bin.bin);
NVGSTDS_LINK_ELEMENT (bin->dewarper_bin.bin, bin->cap_filter);
} else {
link_element_to_tee_src_pad (bin->tee, bin->cap_filter);
}
NVGSTDS_LINK_ELEMENT (bin->cap_filter, bin->nvvidconv);
NVGSTDS_LINK_ELEMENT (bin->nvvidconv, bin->cap_filter1);
link_element_to_tee_src_pad (bin->tee, bin->fakesink_queue);
if (ctx){
g_print("\n\nin ctx!!\n\n");
link_element_to_tee_src_pad(bin->tee, ctx->recordbin);
}
g_object_set (G_OBJECT (bin->fakesink), "sync", FALSE, "async", FALSE, NULL);
g_object_set (G_OBJECT (bin->fakesink), "enable-last-sample", FALSE, NULL);
ret = TRUE;
GST_CAT_DEBUG (NVDS_APP,
"Decode bin created. Waiting for a new pad from decodebin to link");
done:
...
For your information, the smart record activation part was taken from the create_rtsp_src_bin part.
I think there will be no problem attaching ctx->recordbin to the bin->tee , but the error appears as follows.
** ERROR: <cb_newpad:235>: Failed to link decodebin to pipeline
** INFO: <bus_callback:180>: Pipeline running
ERROR from qtdemux0: Internal data stream error.
Debug info: qtdemux.c(6073): gst_qtdemux_loop (): /GstPipeline:pipeline/GstBin:multi_src_bin/GstBin:src_sub_bin0/GstURIDecodeBin:src_elem/GstDecodeBin:decodebin0/GstQTDemux:qtdemux0:
streaming stopped, reason not-linked (-1)
How to run the smart recorder in uri (file) instead of rtsp?