Please provide complete information as applicable to your setup.
• Hardware Platform (Jetson / GPU) dGPU • DeepStream Version 5.1 • JetPack Version (valid for Jetson only) • TensorRT Version • NVIDIA GPU Driver Version (valid for GPU only) 460.73 • Issue Type( questions, new requirements, bugs) • How to reproduce the issue ? (This is for bugs. Including which sample app is using, the configuration files content, the command line used and other details for reproducing) • Requirement details( This is for new requirement. Including the module name-for which plugin or for which sample application, the function description)
There are 30 streams running in one analytics group each detecting a scenario and creating an image and a smart record at each detected event. I need to populate the name of the image (which is running fine) and the name of the smart-record (not working as instead of getting/ setting the filename in NvDsStart I was constructing the same using fileprefix + CameraID + PID + Date .mp4 or mkv). Around 70% of the time I am able to predict the smart record file name but 30% of the time it misses. Since I need to write the Smart Record filename in the event I cannot wait for Smart Record to finish.
Is there an alternate way I can get the filename the moment I invoke the NvDsSRStart? https://forums.developer.nvidia.com/t/how-to-get-the-smart-record-file-name-in-the-call-back-function/179866/7
Please refer to /opt/nvidia/deepstream/deepstream/sources/includes/gst-nvdssr.h
/**
* \brief Starts the video recording.
*
* This function starts writing the cached video data to a file. It returns
* the session id which later can be used in NvDsSRStop() to stop the
* corresponding recording.
*
* Here startTime specifies the seconds before the current time and duration
* specifies the seconds after the start of recording.
* If current time is t1, content from t1 - startTime to t1 + duration will
* be saved to file. Therefore a total of startTime + duration seconds of data
* will be recorded.
*
* @param[in] ctx A pointer to a \ref NvDsSRContext.
* @param[out] sessionId A pointer to a \ref NvDsSRSessionId.
* @param[in] startTime Seconds before the current time. Should be less than video cache size.
* @param[in] duration Duration value in seconds after the start of recording.
* @param[in] userData A pointer to user specified data.
*
* @return NVDSSR_STATUS_OK if successful, or corresponding error otherwise.
*/
NvDsSRStatus NvDsSRStart (NvDsSRContext *ctx, NvDsSRSessionId *sessionId,
guint startTime, guint duration, gpointer userData);
When you use NvDsSRStart(), the filesink element is recorded in NvDsSRContext, you can get file name through filesink element.
NvDsSRContext is defined in /opt/nvidia/deepstream/deepstream/sources/includes/gst-nvdssr.h
typedef struct NvDsSRContext
{
/** parent bin element. */
GstElement *recordbin;
/** queue element to cache the content. */
GstElement *recordQue;
/** child bin to save the content to file. */
GstElement *encodebin;
/** filesink element */
GstElement *filesink;
/** flag to check the key frame. */
gboolean gotKeyFrame;
/** flag to check if recording is on */
gboolean recordOn;
/** flag to check if encodebin is reset */
gboolean resetDone;
/** flag to check if encodebin is in playing state. */
gboolean isPlaying;
/** initialization parameters */
NvDsSRInitParams initParams;
/** mutex to control the flow */
GMutex flowLock;
/** thread to reset the encodebin */
GThread *resetThread;
/** pointer to user provided data */
gpointer uData;
/** pointer to private data */
gpointer privData;
} NvDsSRContext;