目录
配置组
Application Group
Tiled-dispaly Group
Source Group
Streammux Group
Primary GIE and Secondary GIE Group
Tracker Group
OSD Group
Sink Group
Tests Group
参考:https://docs.nvidia.com/metropolis/deepstream/dev-guide/index.html#page/DeepStream%2520Development%2520Guide%2Fdeepstream_app_config.3.2.html%23wwconnect_header
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]
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-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 |
示例:
[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 |
整型,>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]
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]
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 | 以RGBA格式指定的特定类别ID的对象的边框颜色。 密钥的格式必须为bbox-border-color |
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 |
键 | 含义 | 类型 | 示例 | 平台 |
---|---|---|---|---|
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 |
键 | 含义 | 类型 | 示例 | 平台 |
---|---|---|---|---|
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 |
键 | 含义 | 类型 | 示例 | 平台 |
---|---|---|---|---|
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 |
键 | 含义 | 类型 | 示例 | 平台 |
---|---|---|---|---|
file-loop |
是否应无限循环输入文件。 | Boolean |
file-loop=1 |
dGPU, Jetson |