官方参考文档:https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_ref_app_deepstream.html#sink-group
目的:sink配置,保存文件和生成RTSP流
正常显示:
[sink0]
enable=1
type=2
sync=0
source-id=0
gpu-id=0
nvbuf-memory-type=0
保存文件:
[sink1]
enable=1
type=3
sync=0
container=1
codec=1
sync=1
source-id=0
gpu-id=0
bitrate=2000000
output-file=/home/packae/out.mp4
#链接到分离器,一定要写不然编译出错
link-to-demux=1
source
[source0]
enable=1
type=4
uri=rtsp://admin:Leaniot123@192.168.0.5/h264/ch1/main/av_stream
num-sources=1
gpu-id=0
cudadec-memtype=0
drop-frame-interval=5
smart-record=1
smart-rec-dir-path=/home/package/
smart-rec-file-prefix=Cam1
smart-rec-video-cache=20
smart-rec-container=0
smart-rec-start-time=5
smart-rec-default-duration=10
smart-rec-duration=8
Key | Meaning | 中文 | Type and Value | Example | Platforms |
---|---|---|---|---|---|
enable | Enables or disables the sink. | 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 | sink类型: 1:无sink 2:nveglglessink 3:解码+分离+存文件 4:RTSP流 5:仅Jetson 6:云端 | 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 | 0:越快越好 1:同步 | 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. | 指示sink是否产生高质量的服务时间,当管道FPS不能跟上流帧率时可能导致管道丢帧 | 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. | source-id对应 | Integer, ≥0 | source-id=1 | dGPU, Jetson |
gpu-id | GPU to be used by the element in case of multiple GPUs. | gpu-id | Integer, ≥0 | gpu-id=1 | dGPU |
container | Container to use for the file save. Only valid for type=3. | 1: MP4 | 2: MKV | 文件存储类型(仅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) | 编码: 1:H.264 2:H.265 | Integer, 1 or 2 | codec=1 | dGPU, Jetson |
bitrate | Bitrate to use for encoding, in bits per second. Valid for type=3 and 4. | 编码比特率(bit/s): type=3(存文件) type=4(RTSP流) | Integer, >0 | bitrate=4000000 | dGPU, Jetson |
iframeinterval | Encoding intra-frame occurrence frequency. | 帧间隔 | Integer, 0≤iv≤MAX_INT | iframeinterval=30 | dGPU, Jetson |
output-file | Pathname of the output encoded file. Only valid for type=3. | 输出文件(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. | CUDA内存类型的插件是分配输出缓冲区。 0 :平台特定的默认值 1:host CUDA 内存 2:设备CUDA内存 3:统一CUDA记忆 dGPU:所有值都是有效的。 Jetson:只有0(零)是有效的 | 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. | RTSP服务端口(type=4): rtsp-port=8554 | Integer | rtsp-port=8554 | dGPU, Jetson |
udp-port | Port used internally by the streaming implementation - a valid unused port number. Valid for type=4. | udp端口(type=4): udp-port=5400 | Integer | udp-port=5400 | dGPU, Jetson |
overlay-id | Index of the overlay to use for HEAD 0. Valid for overlay sinks (type=5). | 重叠(type=5): overlay-id=1
| 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. | 渲染器的宽度: width=1920 | Integer, >=1 | width=1920 | dGPU, Jetson |
height | Height of the renderer in pixels. | 渲染器的高度: height=1920 | Integer, >=1 | height=1920 | dGPU, Jetson |
offset-x | Horizontal offset of the renderer window, in pixels. | 渲染器x偏移: offset-x=100 | Integer, >=1 | offset-x=100 | dGPU, Jetson |
offset-y | Vertical offset of the renderer window, in pixels. | 渲染器y偏移: offset-y=100 | Integer, >=1 | offset-y=100 | dGPU, Jetson |
display-id | ID of the display HEAD. Valid for overlay sinks (type=5). | 重叠展示id(type=5): display-id=0 | Integer, ≥0 | display-id=0 | Jetson |
msg-conv-config | Pathname of the configuration file for the Gst-nvmsgconv element (type=6). | 云端配置文件路径(type=6): msg-conv-config=path | 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). | 云端依赖库路径(type=6): msg-broker-proto-lib=pa | String | msg-broker-proto-lib= /opt/nvidia/deepstream/deepstream-5.0/lib/libnvds_amqp_proto.so | dGPU, Jetson |
msg-broker-conn-str | Connection string of the backend server (type=6). | 云端服务连接字符串(type=6): msg-broker-conn-str=str | String | msg-broker-conn-str=foo.bar.com;80;dsapp | dGPU, Jetson |
topic | Name of the message topic (type=6). | 云端topic(type=6): topic=test-ds4 | 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). | 负载类型(type6): 0: 1: | 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). | type=6 | String | msg-conv-config=/home/ubuntu/cfg_amqp.txt | dGPU, Jetson |
new-api | use protocol adapter library api’s directly or use new msgbroker library wrapper api’s | type=6 | Integer 0 : Use adapter api’s directly 1 : msgbroker lib wrapper api’s | new-api = 0 | 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. | type=6 | 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. | type=6 | 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. | type=6 | Integer, >=0 | msg-broker-comp-id=1 | dGPU, Jetson |
disable-msgconv | Only add a message broker component instead of a message converter + message broker. | Integer, | disable-msgconv = 1 | dGPU, Jetson | |
enc-type | Engine to use for encoder 0: NVENC hardware engine 1: CPU software encoder | 编码引擎: 0:NVENC(GPU) 1:CPU | Integer, 0 or 1 | enc-type=0 | dGPU, Jetson |
profile (HW) | Encoder profile for the codec V4L2 H264 encoder(HW):
V4L2 H265 encoder(HW): 0: Main 1: Main10 | h264编码: 0:基础线 2:主线 4:高 | Integer, valid values from the column beside | profile=2 | dGPU, Jetson |
udp-buffer-size | UDP kernel buffer size (in bytes) for internal RTSP output pipeline. | RTSP的UDP缓存大小(type=4): udp-buffer-size=100000 | Integer, >=0 | udp-buffer-size=100000 | dGPU, Jetson |
link-to-demux | A boolean which enables or disables streaming a particular “source-id” alone to this sink. Please check the tiled-display group enable key for more information. | 连接器是否连接源source: link-to-demux=0 | Boolean | link-to-demux=0 |