How save inference output and display inference on another local network PC in deepstream-reference-app

Hi hope you doing good .

i am using deepstream-reference-app on jetson-agx-axavier

i have edit the below file for live stream inferencing.

source8_1080p_dec_infer-resnet_tracker_tiled_display_fp16_nano.txt

[application]
enable-perf-measurement=1
perf-measurement-interval-sec=5
#gie-kitti-output-dir=streamscl

[tiled-display]
enable=1
rows=4
columns=2
width=1280
height=720
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

[source0]
enable=1
#Type - 1=CameraV4L2 2=URI 3=MultiURI 4=RTSP
type=4
#uri=file://../../streams/sample_1080p_h264.mp4
uri=rtsp://192.168.1.100:8554/camera-0
num-sources=8
#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

[sink0]
enable=1
#Type - 1=FakeSink 2=EglSink 3=File
type=5
sync=1
source-id=0
gpu-id=0
qos=0
nvbuf-memory-type=0
overlay-id=1

[sink1]
enable=0
type=3
#1=mp4 2=mkv
container=1
#1=h264 2=h265
codec=1
#encoder type 0=Hardware 1=Software
enc-type=0
sync=0
#iframeinterval=10
bitrate=2000000
#H264 Profile - 0=Baseline 2=Main 4=High
#H265 Profile - 0=Main 1=Main10
profile=0
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
#encoder type 0=Hardware 1=Software
enc-type=0
sync=0
bitrate=4000000
#H264 Profile - 0=Baseline 2=Main 4=High
#H265 Profile - 0=Main 1=Main10
profile=0
# set below properties in case of RTSPStreaming
rtsp-port=8554
udp-port=5400

[osd]
enable=1
gpu-id=0
border-width=1
text-size=15
text-color=1;1;1;1;
text-bg-color=0.3;0.3;0.3;1
font=Serif
show-clock=0
clock-x-offset=800
clock-y-offset=820
clock-text-size=12
clock-color=1;0;0;0
nvbuf-memory-type=0

[streammux]
gpu-id=0
##Boolean property to inform muxer that sources are live
live-source=1
batch-size=1
##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
## If set to TRUE, system timestamp will be attached as ntp timestamp
## If set to FALSE, ntp timestamp from rtspsrc, if available, will be attached
# attach-sys-ts-as-ntp=1

# 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]
[primary-gie]
enable=1
gpu-id=0
#model-engine-file=../../models/Primary_Detector_Nano/resnet10.caffemodel_b8_gpu0_fp16.engine
batch-size=1
#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=5
gie-unique-id=1
nvbuf-memory-type=0
config-file=config_infer_primary_nano.txt
#config-file = nvinfer1_config.txt

[tracker]
enable=1
# For NvDCF and DeepSORT tracker, tracker-width and tracker-height must be a multiple of 32, respectively
tracker-width=640
tracker-height=384
ll-lib-file=/opt/nvidia/deepstream/deepstream-6.0/lib/libnvds_nvmultiobjecttracker.so
# ll-config-file required to set different tracker types
# ll-config-file=config_tracker_IOU.yml
ll-config-file=config_tracker_NvDCF_perf.yml
# ll-config-file=config_tracker_NvDCF_accuracy.yml
# ll-config-file=config_tracker_DeepSORT.yml
gpu-id=0
enable-batch-process=1
enable-past-frame=1
display-tracking-id=1

[tests]
file-loop=0
                                                               

i have set my yolov4 pige file and these configuration is for showing streaming on jetson display but

i want to save output and show display on another PC on same network

You can use RTSP streaming sink (type 4) to stream the result to a local RTSP server, and then play it from another PC, details can be found here: Frequently Asked Questions — DeepStream 6.1.1 Release documentation (nvidia.com)

thank you @yingliu

but i got this with above configuration .

Opening in BLOCKING MODE 
NvMMLiteOpen : Block : BlockType = 279 
NVMEDIA: Reading vendor.tegra.display-size : status: 6 
NvMMLiteBlockCreate : Block : BlockType = 279 
** INFO: <bus_callback:180>: Pipeline running

**PERF:  0.00 (0.00)	
NVPARSER: HEVC: Seeking is not performed on IRAP picture 
NVPARSER: HEVC: Seeking is not performed on IRAP picture 
**PERF:  33.01 (32.50)	
**PERF:  24.87 (28.08)	
**PERF:  24.81 (26.86)	
**PERF:  24.93 (26.25)	

No display is showing ?

and if i run this in terminal

gst-launch-1.0 rtsp://192.168.1.100:8554/camera-0
(gst-plugin-scanner:12977): GStreamer-WARNING **: 12:01:11.425: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_udp.so': librivermax.so.0: cannot open shared object file: No such file or directory

(gst-plugin-scanner:12977): GStreamer-WARNING **: 12:01:11.426: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_inferserver.so': libtritonserver.so: cannot open shared object file: No such file or directory
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Progress: (open) Opening Stream
Progress: (connect) Connecting to rtsp://192.168.1.100:8554/camera-0
Progress: (open) Retrieving server options
Progress: (open) Retrieving media info
ERROR: from element /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0: Unhandled error
Additional debug info:
gstrtspsrc.c(6161): gst_rtspsrc_send (): /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0:
Service Unavailable (503)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

HI @yingliu please give me solution

can you show us how i add rstp url with passwd and user for connection.

The config file is for deepstream-app, you can compare the output from my deepstream in docker (I have set enable=1 for sink2), you can see the URL when the deepstream-app starts to run:

root@node2:/opt/nvidia/deepstream/deepstream-6.1/samples/configs/deepstream-app# deepstream-app -c source30_1080p_dec_infer-resnet_tiled_display_int8.yml

 *** DeepStream: Launched RTSP Streaming at rtsp://localhost:8554/ds-test ***

Currently username/password is not supported, all available parameters for sink can be found here: DeepStream Reference Application - deepstream-app — DeepStream 6.1.1 Release documentation (nvidia.com)

HI @yingliu

Model is redicting person and helmet labels
but person label hiding helmet label what should i do in config

i reduce text size in [OSD] but still they show overlap and hide helmet label
Also why it show number with helmet

Screenshot from 2023-01-28 15-47-34
Screenshot from 2023-01-28 15-47-43

Which program are you running?
The display text string is from deepstream program, you can refer to the example code deepstream/sources/apps/sample_apps/deepstream-test1/deepstream_test1_app.c about setting content intxt_params->display_text
The overlay is inevitable as the objects may overlap.

HI @ yingliu thanks for reply.

i am running deepstream-reference-app
only modified congif file for detection

how i seperate these labels, so look more clear.

HI @yingliu

i have used this url for streaming
the orignal url for camera was rstp://192.168.1.224:554

and used in deepstream refrence-app with name and password just like this

uri=rtsp://admin:GFISTK@192.168.1.224:554/cam/realmonitor?channel=1&subtype=0

i got live stream inference i also enabled sink 2 for remote access


[sink2]
enable=1
#Type - 1=FakeSink 2=EglSink 3=File 4=RTSPStreaming
type=4
#1=h264 2=h265
codec=1
#encoder type 0=Hardware 1=Software
enc-type=0
sync=0
bitrate=4000000
#H264 Profile - 0=Baseline 2=Main 4=High
#H265 Profile - 0=Main 1=Main10
profile=0
# set below properties in case of RTSPStreaming
rtsp-port=8554
udp-port=5400

but when i access from VLC network i got error unable to connect.i am using below url in VLC

rstp://localhost-jetson-ip: 8554

how should i connect to remote streaming while i have enable sink 2 or i am using wrong format of url

please do help

Thanks alot

When your program is running there will be an output like " rtsp://localhost:8554/ds-test", you need replace the localhost by it’s real IP address, please also be sure the firewall allow port 8554 to be accessiable by other host.

please submit a new topic for this label overlay issue, thank you.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.