NVIDIA DeepStream SDK API Reference

6.2 Release

Detailed Description

Specifies APIs relating to smart recording.

Data Structures

struct  NvDsSRInitParams
 Holds initializtion paramerters required to create NvDsSRContext. More...
 
struct  NvDsSRContext
 Holds information about smart record instance. More...
 
struct  NvDsSRRecordingInfo
 Hold information about video recorded. More...
 

Typedefs

typedef struct NvDsSRRecordingInfo NvDsSRRecordingInfo
 Hold information about video recorded. More...
 
typedef gpointer(* NvDsSRCallbackFunc) (NvDsSRRecordingInfo *info, gpointer userData)
 
typedef guint32 NvDsSRSessionId
 
typedef struct NvDsSRInitParams NvDsSRInitParams
 Holds initializtion paramerters required to create NvDsSRContext. More...
 
typedef struct NvDsSRContext NvDsSRContext
 Holds information about smart record instance. More...
 

Enumerations

enum  NvDsSRContainerType {
  NVDSSR_CONTAINER_MP4,
  NVDSSR_CONTAINER_MKV
}
 Specifies container types. More...
 
enum  NvDsSRStatus {
  NVDSSR_STATUS_OK,
  NVDSSR_STATUS_INVALID_VAL,
  NVDSSR_STATUS_INVALID_OP,
  NVDSSR_STATUS_ERROR,
  NVDSSR_STATUS_CUSTOM1 = 100,
  NVDSSR_STATUS_CUSTOM2 = 101,
  NVDSSR_STATUS_CUSTOM3 = 102
}
 Specifies API return status. More...
 

Functions

NvDsSRStatus NvDsSRCreate (NvDsSRContext **ctx, NvDsSRInitParams *params)
 Creates the instance of smart record. More...
 
NvDsSRStatus NvDsSRStart (NvDsSRContext *ctx, NvDsSRSessionId *sessionId, guint startTime, guint duration, gpointer userData)
 Starts the video recording. More...
 
NvDsSRStatus NvDsSRStop (NvDsSRContext *ctx, NvDsSRSessionId sessionId)
 Stops the previously started recording. More...
 
NvDsSRStatus NvDsSRDestroy (NvDsSRContext *ctx)
 Destroys the instance of smart record. More...
 

Typedef Documentation

◆ NvDsSRCallbackFunc

typedef gpointer(* NvDsSRCallbackFunc) (NvDsSRRecordingInfo *info, gpointer userData)

Definition at line 45 of file gst-nvdssr.h.

◆ NvDsSRContext

typedef struct NvDsSRContext NvDsSRContext

Holds information about smart record instance.

◆ NvDsSRInitParams

Holds initializtion paramerters required to create NvDsSRContext.

◆ NvDsSRRecordingInfo

Hold information about video recorded.

Definition at line 43 of file gst-nvdssr.h.

◆ NvDsSRSessionId

typedef guint32 NvDsSRSessionId

Definition at line 47 of file gst-nvdssr.h.

Enumeration Type Documentation

◆ NvDsSRContainerType

Specifies container types.

Enumerator
NVDSSR_CONTAINER_MP4 
NVDSSR_CONTAINER_MKV 

Definition at line 52 of file gst-nvdssr.h.

◆ NvDsSRStatus

Specifies API return status.

Enumerator
NVDSSR_STATUS_OK 
NVDSSR_STATUS_INVALID_VAL 
NVDSSR_STATUS_INVALID_OP 
NVDSSR_STATUS_ERROR 
NVDSSR_STATUS_CUSTOM1 
NVDSSR_STATUS_CUSTOM2 
NVDSSR_STATUS_CUSTOM3 

Definition at line 60 of file gst-nvdssr.h.

Function Documentation

◆ NvDsSRCreate()

NvDsSRStatus NvDsSRCreate ( NvDsSRContext **  ctx,
NvDsSRInitParams params 
)

Creates the instance of smart record.

This function creates the instance of smart record and returns the pointer to an allocated NvDsSRContext. The params structure must be filled with initialization parameters required to create the instance.

recordbin of NvDsSRContext is smart record bin which must be added to the pipeline. It expects encoded frames which will be muxed and saved to the file. Add this bin after parser element in the pipeline.

Call NvDsSRDestroy() to free resources allocated by this function.

Parameters
[out]ctxAn indirect pointer to the smart record instance.
[in]paramsA pointer to a NvDsSRInitParams structure.
Returns
NVDSSR_STATUS_OK if successful, or corresponding error otherwise.

◆ NvDsSRDestroy()

NvDsSRStatus NvDsSRDestroy ( NvDsSRContext ctx)

Destroys the instance of smart record.

This function releases the resources previously allocated by NvDsSRCreate().

Parameters
[in]ctxA pointer to a NvDsSRContext to be freed.
Returns
NVDSSR_STATUS_OK if successful, or corresponding error otherwise.

◆ NvDsSRStart()

NvDsSRStatus NvDsSRStart ( NvDsSRContext ctx,
NvDsSRSessionId sessionId,
guint  startTime,
guint  duration,
gpointer  userData 
)

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.

Parameters
[in]ctxA pointer to a NvDsSRContext.
[out]sessionIdA pointer to a NvDsSRSessionId.
[in]startTimeSeconds before the current time. Should be less than video cache size.
[in]durationDuration value in seconds after the start of recording.
[in]userDataA pointer to user specified data.
Returns
NVDSSR_STATUS_OK if successful, or corresponding error otherwise.

◆ NvDsSRStop()

NvDsSRStatus NvDsSRStop ( NvDsSRContext ctx,
NvDsSRSessionId  sessionId 
)

Stops the previously started recording.

Parameters
[in]ctxA pointer to a NvDsSRContext.
[in]sessionIdId of seesion to stop.
Returns
NVDSSR_STATUS_OK if successful, or corresponding error otherwise.