본문 바로가기

개발 이야기/AI 인공지능 이야기

NVIDIA - Deepstream Configuration 설명

728x90

Deepstream의 config에 대한 설명이 아래 가이드에 잘 나와 있습니다.

https://docs.nvidia.com/metropolis/deepstream/4.0/dev-guide/index.html#page/DeepStream_Development_Guide%2Fdeepstream_app_config.3.2.html

 

DeepStream Development Guide

 

docs.nvidia.com

 

 

source30_1080p_dec_infer-resnet_tiled_display_int8.txt 파일에 설명을 달아 보았습니다.

필요 없다고 생각되는 부분은 뺐고, 몇몇 사항은 추가로 작성하였습니다.

사용해보지 않거나 잘 모르는 부분들은 영어 설명을 그대로 달았습니다.

# Copyright (c) 2018 NVIDIA Corporation. All rights reserved.

#

# NVIDIA Corporation and its licensors retain all intellectual property

# and proprietary rights in and to this software, related documentation

# and any modifications thereto. Any use, reproduction, disclosure or

# distribution of this software and related documentation without an express

# license agreement from NVIDIA Corporation is strictly prohibited.

​

[application]

enable-perf-measurement=1 => 퍼포먼스 측정 여부 활성화 결정

perf-measurement-interval-sec=5 => 퍼포먼스 지표가 측정되고 출력되는 간격이 5초임

#gie-kitti-output-dir=streamscl => 기본 출력을 KITTI 메타 데이터 형식으로 저장하는 디렉토리 경로

​

[tiled-display]

enable=1 => 화면을 타일로 보여줄 지 여부

rows=5 => 5행

columns=6 => 6열

width=1280 => 가로 해상도

height=720 => 세로 해상도

gpu-id=0 => Jetson Xavier는 GPU가 하나이므로 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 => 0은 디폴트이고 Jetson이면 4를 사용하는 것 같은데, Jetson에서는 0과 4가 동일한 것으로 추측됨.

​

[source0]

enable=1 => 입력소스 첫 번째 사용 여부

# [Type]

# 1=CameraV4L2 : V4L2카메라(USB 카메라)

# 2=URI

# 3=MultiURI

# 4=RTSP

# 5=Camera (CSI) : CSI 인터페이스 카메라

type=3 => 파일은 3번으로 사용.

uri=file://../../streams/sample_1080p_h264.mp4 => 파일 경로를 URI형식으로 입력

num-sources=15 => 입력 소스의 개수 15개

# intra-decode-enable=1 => Enables or disables intra-only decode 뭘까?

# num-extra-sufraces => Number of surfaces in addition to minimum decode surfaces given by the decoder. ​

Can be used to manage the number of decoder output buffers in the pipeline. 뭘까?

gpu-id=0 => Jetson Xavier는 GPU가 하나이므로 0 이외에 숫자는 의미가 없음

# camera-id=2 => 메타 데이터에 추가할 입력 소스의 고유 ID (Optional)

# camera-width=1280 => 카메라 가로 해상도. Type이 1이나 5일 경우 사용

# camera-height=720 => 카메라 세로 해상도. Type이 1이나 5일 경우 사용

# camera-fps-n=30 => 카메라 frame per sec. Type이 1이나 5일 경우 사용

# camera-fps-d=1 => Denominator part of a fraction specifying the frame rate

requested from the camera, in frames/sec. Valid when type = 1 or 5.

# camera-v4l2-dev-node=1 => Number of the V4L2 device node. For example, /dev/video<num> for ​

the open source V4L2 camera capture path. Valid when the type setting (type of source) is 1.

# latency=200 => Jitterbuffer size in milliseconds; applicable only for RTSP streams.

# camera-csi-sensor-id=1 => Sensor ID of the camera module. Valid when the type (type of source) is 5.

#drop-frame-interval=5 => 5 프레임마다 출력, 0이면 프레임 drop 없음. Interval to drop frames. ​

For example, 5 means decoder outputs every fifth frame; 0 means no frames are dropped.

​

# (0): memtype_device - Memory type Device

# (1): memtype_pinned - Memory type Host Pinned

# (2): memtype_unified - Memory type Unified

cudadec-memtype=0 => Type of CUDA memory element is to allocate for output buffers.

파일에는 0이 device, 1이 pinned라고 나와있는데 문서에는 1이 device, 0이 pinned라고 나와있음. 확인 필요함.

​

[streammux]

gpu-id=0

##Boolean property to inform muxer that sources are live

live-source=0 => 입력 소스가 live임을 알려줌. RTSP일 경우에는 1로 세팅.

batch-size=30 => Muxer batch size.

##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 => Timeout in microseconds after to push the batch after the first buffer is available,

even if the complete batch is not formed.

RTSP재생 시 플레이가 되지 않는 현상이 발생하면 이 값을 늘려 본다.

## Set muxer output width and height

width=1920 => Muxer output width in pixels.

height=1080 => Muxer output height in pixels.

##Enable to maintain aspect ratio wrt source, and allow black borders, works

##along with width, height properties

enable-padding=0 => Indicates whether to maintain source aspect ratio when scaling by adding black bands.

nvbuf-memory-type=0 => 0 : default

​

# config-file property is mandatory for any gie section.

# Other properties are optional and if set will override the properties set in

# the infer config file.

​

[primary-gie] => GIE : GPU Inference Engine

enable=1 => 활성화 여부

gpu-id=0

model-engine-file=../../models/Primary_Detector/resnet10.caffemodel_b30_int8.engine => 모델 엔진 파일 경로

nvbuf-memory-type=0

# Pathname of a configuration file which specifies properties for the Gst-nvinfer plugin. It may contain any of the

properties described in this table except config-file itself. Properties must be defined in a group named [property].

For more details about parameters see “Gst-nvinfer File Configuration Specifications” in the DeepStream 4.0

Plugin Manual.

config-file=config_infer_primary.txt

#Required to display the PGIE labels, should be added even when using config-file

#property

batch-size=30 => The number of frames(P.GIE)/objects(S.GIE) to be inferred together in a batch.

일반적으로 소스의 개수와 동일할 듯.

# interval=2 => Number of consecutive batches to skip for inference. 추론 시 건너 뛰는 프레임 수.

#Required by the app for OSD, not a plugin property

# The color of the borders for the objects of a specific class ID, specified in RGBA format. The key must be of format

bbox-border-color<class-id>. This property can be identified multiple times for multiple class IDs. If this property is

not identified for the class ID, the borders are not drawn for objects of that class-id.

# R:G:B:A Float, 0≤R,G,B,A≤1

bbox-border-color0=1;0;0;1 => Red for class-id 0

bbox-border-color1=0;1;1;1

bbox-border-color2=0;0;1;1

bbox-border-color3=0;1;0;1

# The color of the boxes drawn over objects of a specific class ID, in RGBA format. The key must be of format

bbox-bg-color<class-id>. This property can be used multiple times for multiple class IDs. If it is not used for a class

ID, the boxes are not drawn for objects of that class ID.

# R:G:B:A Float, 0≤R,G,B,A≤1​

# bbox-bg-color3=0;1;0;0.3 => Semi-transparent green for class-id 3

#Required by the app for SGIE, when used along with config-file property

gie-unique-id=1

# infer-raw-output-dir=/home/ubuntu/infer_raw_out => Pathname of an existing directory in which to dump

the raw inference buffer contents in a file.

​

[tracker]

enable=1 => 트래커 활성화 여부

tracker-width=480 => Frame width at which the tracker will operate, in pixels.

tracker-height=272 => Frame height at which the tracker will operate, in pixels.

#ll-lib-file=/opt/nvidia/deepstream/deepstream-4.0/lib/libnvds_mot_iou.so

ll-lib-file=/opt/nvidia/deepstream/deepstream-4.0/lib/libnvds_mot_klt.so

=> Pathname for the low-level tracker implementation library.

#ll-config-file required for IOU only

#ll-config-file=iou_config.txt => Pathname for the low-level tracker configuration file.

gpu-id=0

# enable-batch-process=1 => Enables batch processing across multiple streams.

​

[osd]

enable=1 => OSD 활성화 여부

gpu-id=0

border-width=1 => Border width of the bounding boxes drawn for objects, in pixels.

text-size=15 => 오브젝트에 표시되는 글자 크기

text-color=1;1;1;1; => 글자색상. R;G;B;A Float, 0≤R,G,B,A≤1

text-bg-color=0.3;0.3;0.3;1 => 글자의 배경 색상. R;G;B;A Float, 0≤R,G,B,A≤1

font=Serif => 글자 폰트

show-clock=0 => Enables or disables overlay of the clock time on the frame.

clock-x-offset=800

clock-y-offset=820

clock-text-size=12

clock-color=1;0;0;0 => Color of the clock time text, in RGBA format. R;G;B;A Float, 0≤R,G,B,A≤1

nvbuf-memory-type=0

# NvOSD processing mode.

# 0: CPU

# 1: GPU (dGPU only)

# 2: Hardware (Jetson only)

# process-mode=1

​

[sink0]

enable=1 => sink 활성화 여부

# 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) => 전체 화면으로 디스플레이됨

type=2 => 화면에 창으로 디스플레이

# Indicates how fast the stream is to be rendered.

# 0: As fast as possible

# 1: Synchronously

sync=1

# 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.

# qos=0

# 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.

source-id=0

gpu-id=0

nvbuf-memory-type=0

# Container to use for the file save. Only valid for type=3.

# 1: MP4

# 2: MKV

# container=1

# The encoder to be used to save the file.

# 1: H.264 (hardware)

# 2: H.265 (hardware)

# codec=1

# bitrate=4000000 => Bitrate to use for encoding, in bits per second. Valid for type=3 and 4.

# output-file=/home/ubuntu/output.mp4 => Pathname of the output encoded file. Only valid for type=3.

# rtsp-port=8554 => Port for the RTSP streaming server; a valid unused port number. Valid for type=4.

# udp-port=5400 => Port used internally by the streaming implementation; a valid unused port number.

Valid for type=4.

# overlay-id=1 => Index of the overlay to use for HEAD 0. Valid for overlay sinks (type=5).

# width=1920 => Width of the renderer in pixels.

# height=1080 => Height of the renderer in pixels.

# offset-x=100 => Horizontal offset of the renderer window, in pixels.

# offset-y=100 => Vertical offset of the renderer window, in pixels.

# display-id=0 => ID of the display HEAD. Valid for overlay sinks (type=5).

# iframeinterval=30 => Encoding intra-frame occurrence frequency.

​

[sink1]

enable=0

type=3

#1=mp4 2=mkv

container=1

#1=h264 2=h265

codec=1

sync=0

#iframeinterval=10

bitrate=2000000

output-file=out.mp4

source-id=0

​

[sink2]

enable=0

#Type - 1=FakeSink 2=EglSink 3=File 4=RTSPStreaming

type=4

#1=h264 2=h265

codec=1

sync=0

bitrate=4000000

# set below properties in case of RTSPStreaming

rtsp-port=8554

udp-port=5400

​

​

[tests]

file-loop=0 => input 파일을 계속 재생시킬 지 여부 (테스트 용도)

 

그럼,

    공유합니다.

 

 

 

728x90