Smart RecordΒΆ

group gstreamer_nvdssr

Specifies APIs relating to smart recording.

Typedefs

typedef struct NvDsSRRecordingInfo NvDsSRRecordingInfo

Hold information about video recorded.

typedef gpointer (*NvDsSRCallbackFunc)(NvDsSRRecordingInfo *info, gpointer userData)
typedef guint32 NvDsSRSessionId
typedef struct NvDsSRInitParams NvDsSRInitParams

Holds initializtion paramerters required to create NvDsSRContext.

typedef struct NvDsSRContext NvDsSRContext

Holds information about smart record instance.

Enums

enum NvDsSRContainerType

Specifies container types.

Values:

enumerator NVDSSR_CONTAINER_MP4
enumerator NVDSSR_CONTAINER_MKV
enum NvDsSRStatus

Specifies API return status.

Values:

enumerator NVDSSR_STATUS_OK
enumerator NVDSSR_STATUS_INVALID_VAL
enumerator NVDSSR_STATUS_INVALID_OP
enumerator NVDSSR_STATUS_ERROR
enumerator NVDSSR_STATUS_CUSTOM1
enumerator NVDSSR_STATUS_CUSTOM2
enumerator NVDSSR_STATUS_CUSTOM3

Functions

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.

Return

NVDSSR_STATUS_OK if successful, or corresponding error otherwise.

Parameters
  • [out] ctx: An indirect pointer to the smart record instance.

  • [in] params: A pointer to a NvDsSRInitParams structure.

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.

Return

NVDSSR_STATUS_OK if successful, or corresponding error otherwise.

Parameters
  • [in] ctx: A pointer to a NvDsSRContext.

  • [out] sessionId: A pointer to a NvDsSRSessionId.

  • [in] startTime: Seconds before the current time. Should be less than video cache size.

  • [in] duration: Duration value in seconds after the start of recording.

  • [in] userData: A pointer to user specified data.

NvDsSRStatus NvDsSRStop(NvDsSRContext *ctx, NvDsSRSessionId sessionId)

Stops the previously started recording.

Return

NVDSSR_STATUS_OK if successful, or corresponding error otherwise.

Parameters
  • [in] ctx: A pointer to a NvDsSRContext.

  • [in] sessionId: Id of seesion to stop.

NvDsSRStatus NvDsSRDestroy(NvDsSRContext *ctx)

Destroys the instance of smart record.

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

Return

NVDSSR_STATUS_OK if successful, or corresponding error otherwise.

Parameters

struct NvDsSRInitParams
#include <gst-nvdssr.h>

Holds initializtion paramerters required to create NvDsSRContext.

struct NvDsSRContext
#include <gst-nvdssr.h>

Holds information about smart record instance.

struct NvDsSRRecordingInfo
#include <gst-nvdssr.h>

Hold information about video recorded.