1. Introduction

This GstBin is a GStreamer source bin. This bin is a wrapper over uridecodebin with additional functionality of the file looping, rtsp reconnection and smart record.

The bin allows users to create simple gstreamer pipelines for AI multimedia analytics.

For more details on nvurisrcbin, please run gst-inspect-1.0 nvurisrcbin on a machine/docker container with DeepStream installed.

2. How to use nvurisrcbin in a pipeline

Below pipeline is a sample gstreamer pipeline which is configured to accept input source:

gst-launch-1.0 nvurisrcbin \
uri=file:///opt/nvidia/deepstream/deepstream/samples/streams/sample_1080p_h264.mp4 ! \
m.sink_0 nvstreammux name=m width=1280 height=720 batch-size=1 ! nvmultistreamtiler ! nveglglessink

3. Gst Properties

3.1 Gst Properties to configure nvurisrcbin

Gst-nvurisrcbin specific properties



Type and Range

Example Notes


Set extra decoder surfaces; Number of surfaces in addition to minimum decode surfaces given by the decoder

Integer, 1 to 4,294,967,295

num-extra-surfaces=1 (default)


Set GPU Device ID used by nvurisrcbin components like decoder (nvv4l2decoder) and nvvideoconvert

Integer, 1 to 4,294,967,295

gpu-id=0 (default)


Memory type for cuda decoder buffers, Memory type for CUDA decoder buffers. Represented internally by enum CudaDecMemType. 0 (memtype_device): Device 1 (memtype_pinned): Host Pinned 2 (memtype_unified): Unified

Integer, 0, 1, or 2

cudadec-memtype=2 (default)


Interval to drop the frames, e.g. a value of 5 means the decoder outputs every fifth frame, and others are dropped.

Integer, 1 to 30

Default: 0, dGPU / Jetson


Type of frames to skip during decoding. Represented internally by enum SkipFrame. 0 (decode_all): decode all frames 1 (decode_non_ref): skips non-ref frames (Applicable only on Jetson platform) 2 (decode_key): decode key frames

Integer, 0, 1, or 2

skip-frames=0 Default: 0 ,dGPU / Jetson


Transport Protocol to use for RTP

Enum RtpProtocol Default: 0, rtp-multi (0): rtp-multi - UDP + UDP Multicast + TCP (4): rtp-tcp - TCP Only

select-rtp-protocol=0 (default)


Loop file sources after EOS. Src type must be source-type-uri and uri starting with ‘file:/


file-loop=false (default)


Timeout in seconds to wait since last data was received from an RTSP source before forcing a reconnection. 0=disable timeout

Integer, 1 to 4,294,967,295



Jitterbuffer size in milliseconds; applicable only for RTSP streams.

Integer, 1 to 4,294,967,295

latency=100 (default)


UDP Buffer Size in bytes; applicable only for RTSP streams.

Integer, 1 to 4,294,967,295

udp-buffer-size=524288 (default)


Enable Smart Record and choose the type of events to respond to. Sources must be of type source-type-rtsp

(0):smart-rec-disable - Disable Smart Record (1):smart-rec-cloud  - Trigger Smart Record through cloud messages only (2):smart-rec-multi  - Trigger Smart Record through cloud and local events

smart-record=0 (default)


Path of directory to save the recorded file.


Absolute or relative path


By default, Smart_Record is the prefix. For unique file names every source must be provided with a unique prefix


Absolute or relative path


Size of video cache in seconds. DEPRECATED: Use ‘smart-rec-cache’ instead

Integer, 1 to 4,294,967,295

smart-rec-video-cache=0 (default)


Size of cache in seconds, applies to both audio and video cache

Integer, 1 to 4,294,967,295

smart-rec-cache=0 (default)


Container format of recorded video. MP4 and MKV containers are supported. Sources must be of type source-type-rtsp

(0): smart-rec-mp4 - MP4 container (1): smart-rec-mkv - MKV container

smart-rec-container=0 (default)


Smart record mode

(0):smart-rec-mode-av - Record audio and video if available (1):smart-rec-mode-video - Record video only if available (2):smart-rec-mode-audio - Record audio only if available

smart-rec-mode=0 (default)


In case a Stop event is not generated. This parameter will ensure the recording is stopped after a predefined default duration.

Integer, 1 to 4,294,967,295

smart-rec-default-duration=20 (default)