DeepStream 配置文件解析

目录

配置组

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] , ...
streammuxstreammux(混流)组件的配置和更改
primary-gieGIE推理引擎的相关配置
secondary-gie次级推理引擎的相关配置。多个次级推理命名:[secondary-gie0] , [secondary-gie1] ,...
tracker目标跟组的相关配置
osdOSD(on-screen display)组件相关配置。包括每一帧上显示的文本和矩形框
sinksink组件的相关配置。表示了输出(如显示、文件渲染、编码、文件保存)。一个管道可以包含多个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性能指标测试时间间隔(秒)整型,>0perf-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数组行数整型,>0rows=2

dGPU

Jetson

columns平铺2D列数整型,>0rows=2

dGPU

Jetson

width平铺宽,单位像素整型,>0width=1280

dGPU

Jetson

height高,单位像素整型,>0height=720

dGPU

Jetson

gpu-id多gpu时,使用的gpu编号整型,≥0gpu-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:poiu1234@124.193.193.43:15554/h264/ch1/sub/av_stream
#uri=rtsp://admin:poiu1234@192.168.1.123: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:poiu1234@124.193.193.43:15554/h264/ch1/sub/av_stream
uri=rtsp://admin:poiu1234@192.168.1.123:554/h264/ch1/sub/av_stream
#uri=rtsp://admin:poiu1234@192.168.1.122: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时有效整型,≥0num-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整型,≥0gpu-id=1dGPU
camera-id添加到metadata输入源的唯一ID (可选)整型,≥0camera-id=2

dGPU

Jetson

camera-width只在type=1和5时有效整型,>0camera-width=1920

dGPU

Jetson

camera-height只在type=1和5时有效整型,>0camera-height=1080

dGPU

Jetson

camera-fps-n分数的分子(numerator)部分,指定摄像机请求的帧速率,以帧/秒为单位。只在type=1和5时有效整型,>0camera-fps-n=30

dGPU

Jetson

camera-fps-d分数的分母(denominator)部分,指定摄像机请求的帧速率,以帧/秒为单位。只在type=1和5时有效整型,>0camera-fps-d=1

dGPU

Jetson

camera-v4l2-dev-nodeV4L2设备节点数。例如/dev/video<num> 表示V4L2相机捕获路径。只有当type=1时有效整型,>0camera-v4l2-dev-node=1

dGPU

Jetson

latency抖动缓冲区大小(以毫秒为单位),只有RTSP流可以应用整型,≥0latency=200

dGPU

Jetson

camera-csi-sensor-id相机模块传感器ID。只有type=5时有效整型,≥0camera-csi-sensor-id=1Jetson
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-idGPU ID整型,≥0gpu-id=1dGPU
live-source通知多路复用器源是实时的。布尔live-source=0

dGPU

Jetson

batch-size复用器batch size整型,>0batch-size=4

dGPU

Jetson

batched-push-timeout即使没有形成完整的批次,在第一个缓冲区可用后将批次推入之后的超时(以微秒为单位)。整型,≥-1batched-push-timeout=40000

dGPU

Jetson

width复用器输出的宽整型,>0width=1280

dGPU

Jetson

height复用器输出的高整型,>0height=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=3dGPU

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以RGBA格式指定的特定类别ID的对象的边框颜色。 密钥的格式必须为bbox-border-color <class-id>。 可以为多个类ID多次标识此属性。 如果没有为类ID标识此属性,则不会为该类ID的对象绘制边框。

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-widthFrame width at which the tracker will operate, in pixels.

Integer, ≥0

tracker-width=960

dGPU, Jetson

tracker-heightFrame 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,
0, 1, or 2

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,
1, 2, 3, 4, 5, or 6

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,
1 or 2

container=1

dGPU, Jetson

codec

The encoder to be used to save the file.
1: H.264 (hardware)

2: H.265 (hardware)

Integer,
1 or 2

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,
0≤iv≤MAX_INT

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

 

  • 20
    点赞
  • 81
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值