Skip to navigation

Gst-nvdsframeselector

View as Markdown

The Gst-nvdsframeselector plugin is a GStreamer transform element that reduces a video stream to a smaller set of representative frames. It caches a configurable window of received frames and selects a subset from each window using one of three algorithms: BASIC equidistant selection, RANGE_BASED SAD (sum of absolute differences) selection, or optical-flow-based motion selection (default), the last of which adaptively favors frames with more motion.

Inputs and Outputs

  • Inputs

    • GStreamer buffer containing NV12/RGBA frame(s)
  • Control parameters

    • gpu-id, selects the GPU ID
    • enable, cache-size, selection-count, frame-selection-algorithm, and the optical-flow/SAD tuning properties described below
  • Output

    • GStreamer buffer containing only the selected representative frame(s); non-selected frames are dropped

Features

The following table summarizes the features of the plugin.

Gst-nvdsframeselector plugin features

FeatureDescriptionRelease
Equidistant frame selectionSelects evenly spaced frames from each cache window (BASIC algorithm)DS 9.2
SAD-based range selectionSelects frames using sum-of-absolute-differences scoring within each cache window (RANGE_BASED algorithm)DS 9.2
Optical-flow motion-based selectionAdaptively selects frames favoring higher motion using optical flow analysis (default algorithm)DS 9.2
Bypass modePasses all frames through without selection when enabledDS 9.2

Gst Properties

The following table describes the Gst properties of the Gst-nvdsframeselector plugin. Use gst-inspect-1.0 nvdsframeselector to view the complete, current property list and defaults.

Gst-nvdsframeselector plugin gst properties

PropertyMeaningType and RangeExample Notes
gpu-idDevice ID of the GPU used for processingInteger,
0 to 4,294,967,295
gpu-id=0
enableEnables or disables frame selectionBooleanenable=1
cache-sizeNumber of received frames retained before a selection decisionInteger,
1 to 4,294,967,295
cache-size=30
selection-countNumber of frames selected from each cache windowInteger,
1 to 4,294,967,295
selection-count=5
percentage-thresholdPercentage threshold for frame filtering (0.0-100.0%, where 100% = max pixel difference of 255)Double,
0.0 to 100.0
percentage-threshold=10.0
averaging-framesNumber of frames to average for normalizationInteger,
1 to 4,294,967,295
averaging-frames=5
exclusion-range+/- range value for frame exclusion in the selection algorithmInteger,
0 to 4,294,967,295
exclusion-range=2
frame-selection-algorithmAlgorithm to use for frame selection: 0=BASIC equidistant, 1=RANGE_BASED SAD, 2=optical flow (default)Enumframe-selection-algorithm=2
bypass-modePasses all frames through without selection when enabledBooleanbypass-mode=0
optical-flow-intervalAnalyzes every Nth received frame for optical flow; 0 automatically targets an approximately 0.5-second optical-flow intervalInteger,
0 to 4,294,967,295
optical-flow-interval=0
enable-motion-detectionEnables optical-flow-based motion detection for adaptive frame selectionBooleanenable-motion-detection=1
source-fpsNative stream FPS; set when the input has been decimated before this element, so motion is normalized correctlyDoublesource-fps=30.0
of-tightenTighten factor applied to the motion-scaled frame count before the minimum clamp (e.g. 0.5 halves the count, dropping the weakest frames); overridable at runtime via env NVDS_FSELECT_OF_TIGHTENDouble,
0.0 to 1.0 (exclusive of 0.0)
of-tighten=0.5
equidistant-outputWhen TRUE, outputs evenly spaced frames from the chunk instead of motion-ranked frames; the count is still determined by the configured selection algorithmBooleanequidistant-output=0