NVIDIA的DeepStream SDK reference application使用samples/configs/deepstream-app文件夾下樣例配置文件進行配置以下信息:
- 組件是否開啓
- 改變組件配置和行爲
- 定製其他與管道和組件無關的應用程序配置
配置文件使用的格式由freedesktop(X窗口系統的桌面環境之間的互操作性和基礎技術共享的項目。)指定。https://specifications.freedesktop.org/desktop-entry-spec/latest
配置組
組 | 配置組 |
---|---|
application | 與指定組件無關的配置 |
tiled-display | 平鋪顯示 |
source | 源配置。多個源時,命名:[source0] ,[source1] , ... |
streammux | streammux(混流)組件的配置和更改 |
primary-gie | GIE推理引擎的相關配置 |
secondary-gie | 次級推理引擎的相關配置。多個次級推理命名:[secondary-gie0] , [secondary-gie1] ,... |
tracker | 目標跟組的相關配置 |
osd | OSD(on-screen display)組件相關配置。包括每一幀上顯示的文本和矩形框 |
sink | sink組件的相關配置。表示了輸出(如顯示、文件渲染、編碼、文件保存)。一個管道可以包含多個sink。組的命名須爲[sink0], [sink1], ... |
tests | 診斷和debug。該組爲測試用。 |
Application Group
例子:
[application]
enable-perf-measurement=1
perf-measurement-interval-sec=5
#gie-kitti-output-dir=streamscl
講解:
鍵 | 含義 | 類型 | 示例 | 平臺 |
---|---|---|---|---|
enable-perf-measurement | 是否開啓應用程序的性能測試 | 布爾 | enable-perf-measurement=1 |
dGPU Jetson |
perf-measurement-interval-sec | 性能指標測試時間間隔(秒) | 整型,>0 | perf-measurement-interval-sec=5 |
dGPU Jetson |
gie-kitti-output-dir | 存儲了主檢測器輸出結果(KITTI數據格式)的路徑名(已經存在) | 字符串 | gie-kitti-output-dir=/home/ubuntu/kitti_data |
dGPU Jetson |
kitti-track-output-dir |
存儲跟蹤器的輸出結果的路徑 (沒有輸出結果?含義?) |
字符串 | kitti-track-output-dir=/home/ubuntu/kitti_data_tracker |
dGPU Jetson |
Tiled-dispaly Group
例子:
[tiled-display]
enable=1
rows=2
columns=2
#width=3072
#height=2048
width=4000
height=3000
gpu-id=0
#(0): nvbuf-mem-default - Default memory allocated, specific to particular platform
#(1): nvbuf-mem-cuda-pinned - Allocate Pinned/Host cuda memory, applicable for Tesla
#(2): nvbuf-mem-cuda-device - Allocate Device cuda memory, applicable for Tesla
#(3): nvbuf-mem-cuda-unified - Allocate Unified cuda memory, applicable for Tesla
#(4): nvbuf-mem-surface-array - Allocate Surface Array memory, applicable for Jetson
nvbuf-memory-type=0
講解:
鍵 | 含義 | 類型 | 示例 | 平臺 |
---|---|---|---|---|
enable | 是否平鋪展示 | 布爾 | enable=1 |
dGPU Jetson |
rows | 平鋪2D數組行數 | 整型,>0 | rows=2 |
dGPU Jetson |
columns | 平鋪2D列數 | 整型,>0 | rows=2 |
dGPU Jetson |
width | 平鋪寬,單位像素 | 整型,>0 | width=1280 |
dGPU Jetson |
height | 高,單位像素 | 整型,>0 | height=720 |
dGPU Jetson |
gpu-id | 多gpu時,使用的gpu編號 | 整型,≥0 | gpu-id=0 |
dGPU |
nvbuf-memory-type |
爲輸出緩存分配的內存類型。 0(nvbuf-mem-default):平臺默認類型 1(nvbuf-mem-cuda-pinned):pinned/主機CUDA內存 2(nvbuf-mem-cuda-device):device CUDA memory 3(nvbuf-mem-cuda-unified):unified CUDA memory 對於dGPU:所有值都有效 對於Jetson:只有0有效 |
整型 0,1,2,3 |
nbuf-memory-type=3 |
dGPU Jetson |
Source Group
示例:
[source0]
enable=1
#Type - 1=CameraV4L2 2=URI 3=MultiURI 4=RTSP
type=3
#uri=file://../../streams/HaiDian.mp4
uri=rtsp://admin:[email protected]:15554/h264/ch1/sub/av_stream
#uri=rtsp://admin:[email protected]:554/h264/ch1/sub/av_stream
num-sources=2
#drop-frame-interval=2
gpu-id=0
# (0): memtype_device - Memory type Device
# (1): memtype_pinned - Memory type Host Pinned
# (2): memtype_unified - Memory type Unified
cudadec-memtype=0
[source1]
enable=1
#Type - 1=CameraV4L2 2=URI 3=MultiURI 4=RTSP
type=3
#uri=file://../../streams/HaiDian.mp4
#uri=rtsp://admin:[email protected]:15554/h264/ch1/sub/av_stream
uri=rtsp://admin:[email protected]:554/h264/ch1/sub/av_stream
#uri=rtsp://admin:[email protected]:184/h264/ch33/sub/av_stream
num-sources=2
#drop-frame-interval=2
gpu-id=0
# (0): memtype_device - Memory type Device
# (1): memtype_pinned - Memory type Host Pinned
# (2): memtype_unified - Memory type Unified
cudadec-memtype=0
講解:
鍵 | 含義 | 類型 | 示例 | 平臺 |
---|---|---|---|---|
enable | 資源是否有效 | 布爾 | enable=1 |
dGPU Jetson |
type |
資源類型;其他源配置依賴於資源類型 1:相機(V4L2) 2:URI 3:MultiURI(複用URI) 4:RTSP 5:相機(CSI)(只針對Jetson) |
整型 1/2/3/4/5 |
type=1 |
dGPU Jetson |
uri | 編碼流的URI。可以是文件,HTTP URI, RTSP.只有type=2和3的時候有效。對於MultiURI,%d的格式可以指定多個源。The application iterates from 0 to num-sources 1 to generate the actual URIs.(含義?) | 字符串 |
uri=file:///home/ubuntu/source.mp4 uri=http://127.0.0.1/source.mp4 uri=rtsp://127.0.0.1/source1 uri=file:///home/ubuntu/source_%d.mp4 |
dGPU Jetson |
num-sources | 資源數,只有當type=3時有效 | 整型,≥0 | num-sources=2 |
dGPU Jetson |
intra-decode-denable | 是否開啓intra-only解碼(開啓後幀率很低?) | 布爾 | intra-decode-enable=1 |
dGPU Jetson |
num-extra-surfaces | 除解碼器給定的最小解碼錶面外的表面數量。 可用於管理管道中解碼器輸出緩衝區的數量。 |
整型 ≥0,≤24 |
num-extra-surfaces=5 |
dGPU Jetson |
gpu-id | 使用的gpu id | 整型,≥0 | gpu-id=1 | dGPU |
camera-id | 添加到metadata輸入源的唯一ID (可選) | 整型,≥0 | camera-id=2 |
dGPU Jetson |
camera-width | 只在type=1和5時有效 | 整型,>0 | camera-width=1920 |
dGPU Jetson |
camera-height | 只在type=1和5時有效 | 整型,>0 | camera-height=1080 |
dGPU Jetson |
camera-fps-n | 分數的分子(numerator)部分,指定攝像機請求的幀速率,以幀/秒爲單位。只在type=1和5時有效 | 整型,>0 | camera-fps-n=30 |
dGPU Jetson |
camera-fps-d | 分數的分母(denominator)部分,指定攝像機請求的幀速率,以幀/秒爲單位。只在type=1和5時有效 | 整型,>0 | camera-fps-d=1 |
dGPU Jetson |
camera-v4l2-dev-node | V4L2設備節點數。例如/dev/video<num> 表示V4L2相機捕獲路徑。只有當type=1時有效 | 整型,>0 | camera-v4l2-dev-node=1 |
dGPU Jetson |
latency | 抖動緩衝區大小(以毫秒爲單位),只有RTSP流可以應用 | 整型,≥0 | latency=200 |
dGPU Jetson |
camera-csi-sensor-id | 相機模塊傳感器ID。只有type=5時有效 | 整型,≥0 | camera-csi-sensor-id=1 | Jetson |
drop-frame-interval | 丟幀的間隔。 例如,5表示解碼器每隔五幀輸出一次; 0表示沒有丟幀。 |
整型, ≥0,≤30 |
drop-frame-interval=5 |
dGPU Jetson |
nvbuf-memory-type |
Type of CUDA memory element is to allocate for output buffers. 0 (cuda-pinned-mem): host/pinned memory allocated with cudaMallocHost(). 1 (cuda-device-mem): Device memory allocated with cudaMalloc(). 2 (cuda-unified-mem): Unified memory allocated with cudaMallocManaged(). |
整型, 0, 1, or 2 |
cuda-memory-type=1 |
dGPU |
Streammux Group
示例:
[streammux]
gpu-id=0
##Boolean property to inform muxer that sources are live
live-source=0
batch-size=4
##time out in usec, to wait after the first buffer is available
##to push the batch even if the complete batch is not formed
batched-push-timeout=40000
## Set muxer output width and height
width=1920
height=1080
##Enable to maintain aspect ratio wrt source, and allow black borders, works
##along with width, height properties
enable-padding=0
nvbuf-memory-type=0
講解:
鍵 | 含義 | 類型 | 示例 | 平臺 |
---|---|---|---|---|
gpu-id | GPU ID | 整型,≥0 | gpu-id=1 | dGPU |
live-source | 通知多路複用器源是實時的。 | 布爾 | live-source=0 |
dGPU Jetson |
batch-size | 複用器batch size | 整型,>0 | batch-size=4 |
dGPU Jetson |
batched-push-timeout | 即使沒有形成完整的批次,在第一個緩衝區可用後將批次推入之後的超時(以微秒爲單位)。 | 整型,≥-1 | batched-push-timeout=40000 |
dGPU Jetson |
width | 複用器輸出的寬 | 整型,>0 | width=1280 |
dGPU Jetson |
height | 複用器輸出的高 | 整型,>0 | height=720 |
dGPU Jetson |
enable-padding | 在通過添加黑帶進行縮放時是否保持源寬高比。 | 布爾 | enable-padding=0 |
dGPU Jetson |
nvbuf-memory-type |
Type of CUDA memory the element is to allocate for output buffers. 0 (nvbuf-mem-default, a platform-specific default 1 (nvbuf-mem-cuda-pinned): pinned/host CUDA memory. 2 (nvbuf-mem-cuda-device): Device CUDA memory. 3 (nvbuf-mem-cuda-unified): Unified CUDA memory. For dGPU: All values are valid. For Jetson: Only 0 (zero) is valid. |
整型 0,1,2,3 |
nvbuf-memory-type=3 | dGPU |
Primary GIE and Secondary GIE Group
示例:
[primary-gie]
enable=1
gpu-id=0
model-engine-file=../../models/Primary_Detector/resnet10.caffemodel_b4_int8.engine
batch-size=4
#Required by the app for OSD, not a plugin property
bbox-border-color0=1;0;0;1
bbox-border-color1=0;1;1;1
bbox-border-color2=0;0;1;1
bbox-border-color3=0;1;0;1
interval=0
gie-unique-id=1
nvbuf-memory-type=0
config-file=config_infer_primary.txt
講解:
鍵 | 含義 | 類型 | 示例 | 平臺 |
---|---|---|---|---|
enable | 主GIE必須設爲1 | 布爾 |
enable=1 |
dGPU, Jetson Both GIEs |
gie-unique-id | 分配給nvinfer實例的唯一組件ID。 用於標識實例生成的metadata數據。 | Integer, >0 |
gie-unique-id=2 |
Both |
gpu-id | 不同GIE設置不同gpu-id可以使不同模型跑在多個GPU上? |
Integer, ≥0 |
gpu-id=1 |
dGPU, Jetson Both GIEs |
model-engine-file | 模式的預生成序列化引擎文件的絕對路徑名。 |
String |
model-engine-file=../../ models/Primary_Detector/resnet10. caffemodel_b4_int8.engine |
Both GIEs |
nvbuf-memory-type |
Type of CUDA memory element is to allocate for output buffers. 0 (nvbuf-mem-default): a platform-specific default 1 (nvbuf-mem-cuda-pinned): pinned/host CUDA memory 2 (nvbuf-mem-cuda-device): Device CUDA memory 3 (nvbuf-mem-cuda-unified): Unified CUDA memory For dGPU: All values are valid. For Jetson: Only 0 (zero) is valid. |
Integer, 0, 1, 2, or 3 |
nvbuf-memory-type=3 |
dGPU, Jetson Primary GIE |
config-file | 配置文件的路徑名,該文件指定Gst-nvinfer插件的屬性。 它可能包含此表中描述的任何屬性,但config-file本身除外。 必須在名爲[property]的組中定義屬性。 |
String |
config-file=/home/ubuntu/config_infer_resnet.txt For complete examples, see the sample file samples/configs/deepstream-app/config_infer_resnet.txt or the deepstream-test2 sample application. |
dGPU, Jetson Both GIEs |
batch-size | 批量推斷在一起的幀數(P.GIE)/對象數(S.GIE)。 |
Integer, >0Integer, >0 |
batch-size=2 |
dGPU, Jetson Both GIEs |
interval | 要跳過以進行推斷的連續批次數。 |
Integer, >0Integer, >0 |
interval=2 |
dGPU, Jetson Primary GIE |
bbox-border-color | bounding box 顏色 |
R:G:B:A Float, 0≤R,G,B,A≤1 |
bbox-border-color2= 1;0;0;1 (Red for class-id 2) |
dGPU, Jetson Both GIEs |
operate-on-gie-id |
GIE的唯一ID,此GIE將在其上運行其元數據(NvDsFrameMeta)。 |
Integer, >0 |
operate-on-gie-id=1 |
dGPU, Jetson Secondary GIE |
operate-on-class-ids |
必須在其上運行的父GIE的類ID。 父GIE是使用gie-id指定的。 |
Semicolon separated integer array |
operate-on-class-ids=1;2 (operate on objects with class IDs 1, 2 generated by parent GIE) |
dGPU, Jetson Secondary GIE |
infer-raw-output-dir |
現有目錄的路徑名,要將原始推理緩衝區的內容轉儲到文件中。 |
String |
infer-raw-output-dir=/home/ubuntu/infer_raw_out |
dGPU, Jetson Both GIEs |
Tracker Group
鍵 | 含義 | 類型 | 示例 | 平臺 |
---|---|---|---|---|
enable |
Enables or disables the tracker. |
Boolean |
enable=1 |
dGPU, Jetson |
tracker-width | Frame width at which the tracker will operate, in pixels. |
Integer, ≥0 |
tracker-width=960 |
dGPU, Jetson |
tracker-height | Frame height at which the tracker will operate, in pixels. |
Integer, ≥0 |
tracker-height=540 |
dGPU, Jetson |
gpu-id |
GPU to be used by the element in case of multiple GPUs. |
Integer, ≥0 |
gpu-id=1 |
dGPU |
ll-config-file |
Pathname for the low-level tracker configuration file. |
String |
ll-config-file=iou_config.txt |
dGPU, Jetson |
ll-lib-file |
Pathname for the low-level tracker implementation library. |
String |
ll-lib-file=/usr/local/deepstream/libnvds_mot_iou.so |
dGPU, Jetson |
enable-batch-process |
Enables batch processing across multiple streams. |
Boolean |
enable-batch-process=1 |
dGPU, Jetson |
OSD Group
鍵 | 含義 | 類型 | 示例 | 平臺 |
---|---|---|---|---|
enable |
Enables or disables the On-Screen Display (OSD). |
Boolean |
enable=1 |
dGPU, Jetson |
gpu-id |
GPU to be used by the element in case of multiple GPUs. |
Integer, ≥0 |
gpu-id=1 |
dGPU |
border-width |
Border width of the bounding boxes drawn for objects, in pixels. |
Integer, ≥0 |
border-width=10 0 disables the boxes. |
dGPU, Jetson |
text-size |
Size of the text that describes the objects, in points. |
Integer, ≥0 |
text-size=16 |
dGPU, Jetson |
text-color |
The color of the text that describes the objects, in RGBA format. |
R;G;B;A Float, 0≤R,G,B,A≤1 |
text-color=0;0;0.7;1 #Dark Blue |
dGPU, Jetson |
text-bg-color |
The background color of the text that describes the objects, in RGBA format. |
R;G;B;A Float, 0≤R,G,B,A≤1 |
text-bg-color=0;0;0;0.5 #Semi-transparent black |
dGPU, Jetson |
clock-text-size |
The size of the clock time text, in points. |
Integer, >0 |
clock-text-size=16 |
dGPU, Jetson |
clock-x-offset |
The horizontal offset of the clock time text, in pixels. |
Integer, >0 |
clock-x-offset=100 |
dGPU, Jetson |
clock-y-offset |
The vertical offset of the clock time text, in pixels. |
Integer, >0 |
clock-y-offset=100 |
dGPU, Jetson |
font |
Name of the font for text that describes the objects. Enter the shell command fc-list to display the names of available fonts. |
String |
font=Purisa |
dGPU, Jetson |
show-clock |
Enables or disables overlay of the clock time on the frame. |
Boolean |
show-clock=1 |
dGPU, Jetson |
clock-color |
Color of the clock time text, in RGBA format. |
R;G;B;A Float, 0≤R,G,B,A≤1 |
clock-color=1;0;0;1 #Red |
dGPU, Jetson |
nvbuf-memory-type |
Type of CUDA memory the element is to allocate for output buffers. 0 (nvbuf-mem-default): a platform-specific default 1 (nvbuf-mem-cuda-pinned): pinned/host CUDA memory 2 (nvbuf-mem-cuda-device): Device CUDA memory 3 (nvbuf-mem-cuda-unified): Unified CUDA memory For dGPU: All values are valid. For Jetson: Only 0 (zero) is valid. |
Integer, 0, 1, 2, or 3 |
nvbuf-memory-type=3 |
dGPU |
process-mode |
NvOSD processing mode. 0: CPU 1: GPU (dGPU only) 2: Hardware (Jetson only) |
Integer, |
process-mode=1 |
dGPU, Jetson |
Sink Group
鍵 | 含義 | 類型 | 示例 | 平臺 |
---|---|---|---|---|
enable |
Enables or disables the sink. |
Boolean |
enable=1 |
dGPU, Jetson |
type |
Type of sink, to use. 1: Fakesink 2: EGL based windowed sink (nveglglessink) 3: Encode + File Save (encoder + muxer + filesink) 4: Encode + RTSP streaming 5: Overlay (Jetson only) 6: Message converter + Message broker |
Integer, |
type=2 |
dGPU, Jetson |
sync |
Indicates how fast the stream is to be rendered. 0: As fast as possible 1: Synchronously |
Integer, 0 or 1 |
sync=1 |
dGPU, Jetson |
qos |
Indicates whether the sink is to generate Quality-of-Service events, which can lead to the pipeline dropping frames when pipeline FPS cannot keep up with the stream frame rate. |
Boolean |
qos=0 |
dGPU, Jetson |
source-id |
The ID of the source whose buffers this sink must use. The source ID is contained in the source group name. For example, for group [source1] source-id=1. |
Integer, ≥0 |
source-id=1 |
dGPU, Jetson |
gpu-id |
GPU to be used by the element in case of multiple GPUs. |
Integer, ≥0 |
gpu-id=1 |
dGPU, Jetson |
container |
Container to use for the file save. Only valid for type=3. 1: MP4 2: MKV |
Integer, |
container=1 |
dGPU, Jetson |
codec |
The encoder to be used to save the file. 2: H.265 (hardware) |
Integer, |
codec=1 |
dGPU, Jetson |
bitrate |
Bitrate to use for encoding, in bits per second. Valid for type=3 and 4. |
Integer, >0 |
bitrate=4000000 |
dGPU, Jetson |
output-file |
Pathname of the output encoded file. Only valid for type=3. |
String |
output-file=/home/ubuntu/output.mp4 |
dGPU, Jetson |
nvbuf-memory-type |
Type of CUDA memory the plugin is to allocate for output buffers. 0 (nvbuf-mem-default): a platform-specific default 1 (nvbuf-mem-cuda-pinned): pinned/host CUDA memory 2 (nvbuf-mem-cuda-device): Device CUDA memory 3 (nvbuf-mem-cuda-unified): Unified CUDA memory For dGPU: All values are valid. For Jetson: Only 0 (zero) Is valid. |
Integer, 0, 1, 2, or 3 |
nvbuf-memory-type=3 |
dGPU, Jetson |
rtsp-port |
Port for the RTSP streaming server; a valid unused port number. Valid for type=4. |
Integer |
rtsp-port=8554 |
dGPU, Jetson |
udp-port |
Port used internally by the streaming implementation; a valid unused port number. Valid for type=4. |
Integer |
udp-port=5400 |
dGPU, Jetson |
overlay-id |
Index of the overlay to use for HEAD 0. Valid for overlay sinks (type=5). |
Integer, >=1 |
overlay-id=1 Must be less than the number of overlays supported by HEAD 0. |
dGPU |
width |
Width of the renderer in pixels. |
Integer, >=1 |
width=1920 |
dGPU, Jetson |
height |
Height of the renderer in pixels. |
Integer, >=1 |
height=1920 |
dGPU, Jetson |
offset-x |
Horizontal offset of the renderer window, in pixels. |
Integer, >=1 |
offset-x=100 |
dGPU, Jetson |
offset-y |
Vertical offset of the renderer window, in pixels. |
Integer, >=1 |
offset-y=100 |
dGPU, Jetson |
display-id |
ID of the display HEAD. Valid for overlay sinks (type=5). |
Integer, ≥0 |
display-id=0 |
Jetson |
iframeinterval |
Encoding intra-frame occurrence frequency. |
Integer, |
iframeinterval=30 |
dGPU, Jetson |
msg-conv-config |
Pathname of the configuration file for the Gst-nvmsgconv element (type=6). |
String |
msg-conv-config=dstest5_msgconv_sample_config.txt |
dGPU, Jetson |
msg-broker-proto-lib |
Path to the protocol adapter implementation used Gst-nvmsgbroker (type=6). |
String |
msg-broker-proto-lib=/home/ubuntu/libnvds_amqp_proto.so |
dGPU, Jetson |
msg-broker-conn-str |
Connection string of the backend server (type=6). |
String |
msg-broker-conn-str=foo.bar.com;80;dsapp |
dGPU, Jetson |
topic |
Name of the message topic (type=6). |
String |
topic=test-ds4 |
dGPU, Jetson |
msg-conv-payload-type |
Type of payload. 0, PAYLOAD_DEEPSTREAM: Deepstream schema payload. 1, PAYLOAD_DEEPSTREAM_MINIMAL: Deepstream schema payload minimal. 256, PAYLOAD_RESERVED: Reserved type. 257, PAYLOAD_CUSTOM: Custom schema payload (type=6). |
Integer 0, 1, 256, or 257 |
msg-conv-payload-type=0 |
dGPU, Jetson |
msg-broker-config |
Pathname of an optional configuration file for the Gst-nvmsgbroker element (type=6). |
String |
msg-conv-config=/home/ubuntu/cfg_amqp.txt |
dGPU, Jetson |
msg-conv-msg2p-lib |
Absolute pathname of an optional custom payload generation library. This library implements the API defined by sources/libs/nvmsgconv/nvmsgconv.h. Applicable only when msg-conv-payload-type=257, PAYLOAD_CUSTOM. |
String |
msg-conv-msg2p-lib= /opt/nvidia/deepstream/deepstream-4.0/lib/libnvds_msgconv.so |
dGPU, Jetson |
msg-conv-comp-id |
comp-id Gst property of the nvmsgconv element; ID (gie-unique-id) of the primary/secondary-gie component from which metadata is to be processed. |
Integer, >=0 |
msg-conv-comp-id=1 |
dGPU, Jetson |
msg-broker-comp-id |
comp-id Gst property of the nvmsgbroker element; ID (gie-unique-id) of the primary/secondary gie component from which metadata is to be processed. |
Integer, >=0 |
msg-broker-comp-id=1 |
Tests Group
鍵 | 含義 | 類型 | 示例 | 平臺 |
---|---|---|---|---|
file-loop |
是否應無限循環輸入文件。 |
Boolean |
file-loop=1 |
dGPU, Jetson |