Skip to navigation

Gst-nvurisrcbin

View as Markdown

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

PropertyMeaningType and RangeExample Notes
num-extra-surfacesSet extra decoder surfaces; Number of surfaces in addition to minimum decode surfaces given by the decoderInteger,
1 to 4,294,967,295
num-extra-surfaces=1 (default)
gpu-idSet GPU Device ID used by nvurisrcbin components like decoder (nvv4l2decoder) and nvvideoconvertInteger,
1 to 4,294,967,295
gpu-id=0 (default)
cudadec-memtypeMemory 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=0 (default)
drop-frame-intervalInterval 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
dec-skip-framesType 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
select-rtp-protocolTransport Protocol to use for RTPEnum RtpProtocol Default: 0, rtp-multi
(0): rtp-multi - UDP + UDP Multicast + TCP
(4): rtp-tcp - TCP Only
select-rtp-protocol=0 (default)
file-loopLoop file sources after EOS. Src type must be source-type-uri and uri starting with ‘file:/‘booleanfile-loop=false (default)
rtsp-reconnect-intervalTimeout in seconds to wait since last data was received from an RTSP source before forcing a reconnection. 0=disable timeoutInteger,
1 to 4,294,967,295
rtsp-reconnect-interval=10
rtsp-reconnect-attemptsMaximum number of times a reconnection is attempted. Setting it to -1 means reconnection will be attempted infinitely. Valid when type of source is 4 and rtsp-reconnect-interval-sec is a non-zero positive value.Integer, >=-1rtsp-reconnect-attempts=4
latencyJitterbuffer size in milliseconds; applicable only for RTSP streams.Integer,
1 to 4,294,967,295
latency=100 (default)
udp-buffer-sizeUDP Buffer Size in bytes; applicable only for RTSP streams.Integer,
1 to 4,294,967,295
udp-buffer-size=524288 (default)
smart-recordEnable 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)
smart-rec-dir-pathPath of directory to save the recorded file.stringAbsolute or relative path
smart-rec-file-prefixBy default, Smart_Record is the prefix. For unique file names every source must be provided with a unique prefixstringAbsolute or relative path
smart-rec-video-cacheSize of video cache in seconds. DEPRECATED: Use ‘smart-rec-cache’ insteadInteger,
1 to 4,294,967,295
smart-rec-video-cache=0 (default)
smart-rec-cacheSize of cache in seconds, applies to both audio and video cacheInteger,
1 to 4,294,967,295
smart-rec-cache=0 (default)
smart-rec-containerContainer 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-rec-modeSmart 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)
smart-rec-default-durationIn 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)
async-handlingBoolean property so that will handle Asynchronous state changesbooleanasync-handling=true(default)
disable-audioDisable audio path mode at init timebooleandisable-audio=true(default)
ipc-buffer-timestamp-copyCopy buffer timestamp for nvunixfdsrc pluginbooleanipc-buffer-timestamp-copy=false(default)
ipc-connection-attemptsMax number of attempts for connection (-1 = unlimited)Integer. Range: -1 - 2147483647 Default: -1ipc-connection-attempts=-1(default)
ipc-connection-intervalconnection interval between connection attempts in micro secondsUnsigned Integer64. Range: 0 - 18446744073709551615ipc-connection-interval=1000000(default)
ipc-socket-pathThe path to the control socket used to control the shared memory transport. This may be modified during the NULL->READY transitionStringipc-socket-path=null(default)
low-latency-modeSet low latency mode for bitstreams having I and IPPP frames on decoderbooleanlow-latency-mode=false(default)
drop-on-latencyTells the jitterbuffer to never exceed the given latency in sizebooleandrop-on-latency=true(default)
message-forwardForwards all children messagesbooleanmessage-forward=false(default)
uriURI of the file or RTSP sourceStringuri=file:///opt/nvidia/deepstream/deepstream/samples/streams/sample_1080p_h264.mp4
typeType of source. Use type=2 (rtsp) to enable smart record featuresEnum,
0 (auto): select source type based on URI scheme
1 (uri): any URI supported by GStreamer
2 (rtsp): RTSP, supports smart recording
type=2
buffer-modeControls the buffering algorithm in useEnum,
0 (unknown): only use RTP timestamps
1 (slave): slave receiver to sender clock
2 (buffer): low/high watermark buffering
3 (auto): choose mode depending on whether the stream is live
4 (synced): synchronized sender and receiver clocks
buffer-mode=0
leakyWhere the internal queue leaks, if at allEnum,
0 (no-leak)
1 (upstream-leak)
2 (downstream-leak)
leaky=0
max-size-buffersMaximum number of buffers in the internal queueInteger,
0 to 4,294,967,295
max-size-buffers=0
disable-passthroughDisables passthrough mode at init time; applicable to nvvideoconvert onlyBooleandisable-passthrough=0
smart-rec-status (read-only)Boolean indicating whether Smart Record is currently activeBoolean
init-rtsp-reconnect-intervalTimeout in seconds to wait before forcing a reconnection when an error is received from the RTSP source; 0 disables the timeoutInteger,
0 to 4,294,967,295
init-rtsp-reconnect-interval=0
source-idUnique ID for the input sourceInteger,
-1 to 2,147,483,647
source-id=0
extract-sei-type5-dataExtracts and attaches SEI type5 unregistered data on the output buffer when setBooleanextract-sei-type5-data=0
sei-uuidSets the SEI UUID on the decoderString
simulate-fps-interval-msFrame interval in milliseconds used to simulate FPS (e.g., 33 for 30 FPS); 0 disables simulationInteger,
0 to 1000
simulate-fps-interval-ms=0
ipc-frame-copyPublishes this source’s decoded frames over IPC (nvunixfdsink), tapped right after the decoder. Socket: /tmp/nvds_ipc_<source-id>.sockBooleanipc-frame-copy=0