Issue with DeepStream 4.0.2 RTSP stream on Jetson Nano

Hi,

i faced a issue with DeepStream 4.0.2 RTSP stream on Jetson Nano.

The IP cam seems to work as expected:

gst-launch-1.0 uridecodebin uri=rtsp://*user*:*pass*@192.168.61.146:88/videoMain  ! nvvideoconvert ! 'video/x-raw(memory:NVMM),width=1280,height=720' ! nvoverlaysink
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Progress: (open) Opening Stream
Progress: (connect) Connecting to rtsp://*user*:*pass*@192.168.61.146:88/videoMain
Progress: (open) Retrieving server options
Progress: (open) Retrieving media info
Progress: (request) SETUP stream 0
Progress: (request) SETUP stream 1
Progress: (open) Opened Stream
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Progress: (request) Sending PLAY request
Progress: (request) Sending PLAY request
Progress: (request) Sent PLAY request
Opening in BLOCKING MODE 
Redistribute latency...
Redistribute latency...

(gst-launch-1.0:13568): GStreamer-CRITICAL **: 19:17:07.835: gst_mini_object_copy: assertion 'mini_object != NULL' failed

(gst-launch-1.0:13568): GStreamer-CRITICAL **: 19:17:07.835: gst_caps_get_structure: assertion 'GST_IS_CAPS (caps)' failed

(gst-launch-1.0:13568): GStreamer-CRITICAL **: 19:17:07.835: gst_structure_copy: assertion 'structure != NULL' failed

(gst-launch-1.0:13568): GStreamer-CRITICAL **: 19:17:07.835: gst_caps_append_structure_full: assertion 'GST_IS_CAPS (caps)' failed

(gst-launch-1.0:13568): GStreamer-CRITICAL **: 19:17:07.835: gst_caps_get_structure: assertion 'GST_IS_CAPS (caps)' failed

(gst-launch-1.0:13568): GStreamer-CRITICAL **: 19:17:07.835: gst_structure_copy: assertion 'structure != NULL' failed

(gst-launch-1.0:13568): GStreamer-CRITICAL **: 19:17:07.835: gst_caps_append_structure_full: assertion 'GST_IS_CAPS (caps)' failed
Redistribute latency...
Redistribute latency...
^Chandling interrupt.
Interrupt: Stopping pipeline ...
Execution ended after 0:00:09.393740827
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

My DeepStream config:

# Copyright (c) 2019 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
#gie-kitti-output-dir=streamscl

[tiled-display]
enable=0
rows=1
columns=1
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://*user*:*pass*@192.168.61.146:88/videoMain  ! nvvideoconvert ! 'video/x-raw(memory:NVMM),width=1280,height=720' ! nvoverlaysink
num-sources=1
#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
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

[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=1280
height=720
##Enable to maintain aspect ratio wrt source, and allow black borders, works
##along with width, height properties
enable-padding=0
nvbuf-memory-type=0

# 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]
enable=1
gpu-id=0
model-engine-file=../../models/Primary_Detector_Nano/resnet10.caffemodel_b8_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=4
gie-unique-id=1
nvbuf-memory-type=0
config-file=config_infer_primary_nano.txt

[tracker]
enable=1
tracker-width=480
tracker-height=272
#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
#ll-config-file required for IOU only
#ll-config-file=iou_config.txt
gpu-id=0

[tests]
file-loop=0

Output of DeepStream:

Creating LL OSD context new
gstnvtracker: Loading low-level lib at /opt/nvidia/deepstream/deepstream-4.0/lib/libnvds_mot_klt.so
gstnvtracker: Optional NvMOT_RemoveStreams not implemented
gstnvtracker: Batch processing is OFF

Runtime commands:
	h: Print this help
	q: Quit

	p: Pause
	r: Resume

** INFO: <bus_callback:189>: Pipeline ready

ERROR from src_elem0: Could not open resource for reading.
Debug info: gstrtspsrc.c(5829): gst_rtspsrc_setup_auth (): /GstPipeline:pipeline/GstBin:multi_src_bin/GstBin:src_sub_bin0/GstRTSPSrc:src_elem0:
No supported authentication protocol was found
ERROR from src_elem0: Not found
Debug info: gstrtspsrc.c(6112): gst_rtspsrc_send (): /GstPipeline:pipeline/GstBin:multi_src_bin/GstBin:src_sub_bin0/GstRTSPSrc:src_elem0:
Stream Not Found (404)
Reset source pipeline reset_source_pipeline 0x7f4faab080
,ERROR from src_elem0: Could not open resource for reading.
Debug info: gstrtspsrc.c(5829): gst_rtspsrc_setup_auth (): /GstPipeline:pipeline/GstBin:multi_src_bin/GstBin:src_sub_bin0/GstRTSPSrc:src_elem0:
No supported authentication protocol was found
ERROR from src_elem0: Not found
Debug info: gstrtspsrc.c(6112): gst_rtspsrc_send (): /GstPipeline:pipeline/GstBin:multi_src_bin/GstBin:src_sub_bin0/GstRTSPSrc:src_elem0:
Stream Not Found (404)

**PERF: FPS 0 (Avg)	
**PERF: 0.00 (0.00)	
**PERF: 0.00 (0.00)	
**PERF: 0.00 (0.00)

I tried https://devtalk.nvidia.com/default/topic/1058356/-jetson-tx2-help-rtsp-camera-and-usb-camera-did-not-work-in-deepstream4-0/ without success.

The sample “source8_1080p_dec_infer-resnet_tracker_tiled_display_fp16_nano.txt” is working.

Best regards and thank you very much

svlsbrg

It is most likely caused by gstreamer cache. You may clean the cache and try again.

Hi DaneLLL,

after clearing cache

rm ~/.cache/gstreamer-1.0/registry.aarch64.bin

the problem is still the same.

Creating LL OSD context new
gstnvtracker: Loading low-level lib at /opt/nvidia/deepstream/deepstream-4.0/lib/libnvds_mot_klt.so
gstnvtracker: Optional NvMOT_RemoveStreams not implemented
gstnvtracker: Batch processing is OFF

Runtime commands:
	h: Print this help
	q: Quit

	p: Pause
	r: Resume

** INFO: <bus_callback:189>: Pipeline ready

ERROR from src_elem0: Could not open resource for reading.
Debug info: gstrtspsrc.c(5829): gst_rtspsrc_setup_auth (): /GstPipeline:pipeline/GstBin:multi_src_bin/GstBin:src_sub_bin0/GstRTSPSrc:src_elem0:
No supported authentication protocol was found
ERROR from src_elem0: Not found
Debug info: gstrtspsrc.c(6112): gst_rtspsrc_send (): /GstPipeline:pipeline/GstBin:multi_src_bin/GstBin:src_sub_bin0/GstRTSPSrc:src_elem0:
Stream Not Found (404)
Reset source pipeline reset_source_pipeline 0x7f6a93e080
,ERROR from src_elem0: Could not open resource for reading.
Debug info: gstrtspsrc.c(5829): gst_rtspsrc_setup_auth (): /GstPipeline:pipeline/GstBin:multi_src_bin/GstBin:src_sub_bin0/GstRTSPSrc:src_elem0:
No supported authentication protocol was found
ERROR from src_elem0: Not found
Debug info: gstrtspsrc.c(6112): gst_rtspsrc_send (): /GstPipeline:pipeline/GstBin:multi_src_bin/GstBin:src_sub_bin0/GstRTSPSrc:src_elem0:
Stream Not Found (404)

**PERF: FPS 0 (Avg)	
**PERF: 0.00 (0.00)	
**PERF: 0.00 (0.00)

Hi,
In the config file, uri looks wrong. It should be only:

uri=rtsp://*user*:*pass*@192.168.61.146:88/videoMain

! nvvideoconvert ! ‘video/x-raw(memory:NVMM),width=1280,height=720’ ! nvoverlaysink is not required.

Also you can try type=2

#Type - 1=CameraV4L2 2=URI 3=MultiURI 4=RTSP
type=2

Hi DaneLLL,

I modified the config as you recommended:

# Copyright (c) 2019 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
#gie-kitti-output-dir=streamscl

[tiled-display]
enable=0
rows=1
columns=1
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=2
#uri=file://../../streams/sample_1080p_h264.mp4
uri=rtsp://*user*:*pass*@192.168.61.146:88/videoMain
# ! nvvideoconvert ! nvdsosd ! nvegltransform ! nveglglessink
num-sources=1
#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
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

[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=1280
height=720
##Enable to maintain aspect ratio wrt source, and allow black borders, works
##along with width, height properties
enable-padding=0
nvbuf-memory-type=0

# 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]
enable=1
gpu-id=0
model-engine-file=../../models/Primary_Detector_Nano/resnet10.caffemodel_b8_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=4
gie-unique-id=1
nvbuf-memory-type=0
config-file=config_infer_primary_nano.txt

[tracker]
enable=1
tracker-width=480
tracker-height=272
#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
#ll-config-file required for IOU only
#ll-config-file=iou_config.txt
gpu-id=0

[tests]
file-loop=0

The Error is now different:

Creating LL OSD context new
gstnvtracker: Loading low-level lib at /opt/nvidia/deepstream/deepstream-4.0/lib/libnvds_mot_klt.so
gstnvtracker: Optional NvMOT_RemoveStreams not implemented
gstnvtracker: Batch processing is OFF
cb_sourcesetup set 100 latency

Runtime commands:
	h: Print this help
	q: Quit

	p: Pause
	r: Resume

** INFO: <bus_callback:189>: Pipeline ready

** INFO: <bus_callback:175>: Pipeline running


**PERF: FPS 0 (Avg)	
**PERF: 0.00 (0.00)	
** INFO: <bus_callback:175>: Pipeline running

Opening in BLOCKING MODE 
** INFO: <bus_callback:175>: Pipeline running


(deepstream-app:9689): GStreamer-CRITICAL **: 19:24:56.268: gst_mini_object_copy: assertion 'mini_object != NULL' failed

(deepstream-app:9689): GStreamer-CRITICAL **: 19:24:56.268: gst_caps_get_structure: assertion 'GST_IS_CAPS (caps)' failed

(deepstream-app:9689): GStreamer-CRITICAL **: 19:24:56.268: gst_structure_copy: assertion 'structure != NULL' failed

(deepstream-app:9689): GStreamer-CRITICAL **: 19:24:56.268: gst_caps_append_structure_full: assertion 'GST_IS_CAPS (caps)' failed

(deepstream-app:9689): GStreamer-CRITICAL **: 19:24:56.268: gst_caps_get_structure: assertion 'GST_IS_CAPS (caps)' failed

(deepstream-app:9689): GStreamer-CRITICAL **: 19:24:56.268: gst_structure_copy: assertion 'structure != NULL' failed

(deepstream-app:9689): GStreamer-CRITICAL **: 19:24:56.268: gst_caps_append_structure_full: assertion 'GST_IS_CAPS (caps)' failed
ERROR from src_bin_muxer: Input buffer number of surfaces (471604252) must be equal to mux->num_surfaces_per_frame (1)
	Set nvstreammux property num-surfaces-per-frame appropriately

Debug info: /dvs/git/dirty/git-master_linux/deepstream/sdk/src/gst-plugins/gst-nvmultistream/gstnvstreammux.c(309): gst_nvstreammux_chain (): /GstPipeline:pipeline/GstBin:multi_src_bin/GstNvStreamMux:src_bin_muxer
Creating LL OSD context new
Quitting
App run failed

Hi,
Please try type=4 + correct uri

type=4
uri=rtsp://*user*:*pass*@192.168.61.146:88/videoMain

Also try to enable [tiled-display]

[tiled-display]
enable=1