Deepstream SDK 4.0 samples not working for RTSP

Hi Guys,

I am trying to run deepstream sdk 4.0 samples - deepstream-app and deepstream-test3 on Jetson Nano (flashed with JetPack 4.2.1) using RTSP streams. I have been successful in running v4l2 camera stream with deepstream-app. However, I have not been able to achieve success with RTSP streams.

Note: I am able to access the RTSP stream using the following gstreamer command.

gst-launch-1.0 rtspsrc location=rtsp://<ip-address>:<rtsp-port> ! rtph264depay ! h264parse ! omxh264dec ! nvoverlaysink

Following are the changes made in the config file for running deepstream-app :

[source0]
enable=1
#Type - 1=CameraV4L2 2=URI 3=MultiURI 4=RTSP
type=4
uri=rtsp://<ip-address>:<rtsp-port>
camera-width=1280
camera-height=720
camera-fps-n=30
camera-fps-d=1
camera-id=1
camera-v4l2-dev-node=1
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=0
#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=1
#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=554
udp-port=5400

Result:

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

Opening in BLOCKING MODE 
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

NOTE: To expand a source in the 2D tiled display and view object details, left-click on the source.
      To go back to the tiled display, right-click anywhere on the window.


**PERF: FPS 0 (Avg)	
**PERF: 0.00 (0.00)	
** INFO: <bus_callback:163>: Pipeline ready

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

Creating LL OSD context new
NvMMLiteOpen : Block : BlockType = 4 
===== NVMEDIA: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 4 
**PERF: 0.00 (0.00)	
**PERF: 0.00 (0.00)	
**PERF: 0.00 (0.00)	
**PERF: 0.00 (0.00)

When I run the deepstream-test3 using a file, it works while RTSP gives me the following result and the app does not terminate after printing this :

Command:

./deepstream-test3-app rtsp://<ip-address>:<rtsp-port>

Result:

./deepstream-test3-app rtsp://admin:edge1234@192.168.0.201:554
Now playing: rtsp://admin:edge1234@192.168.0.201:554,

Using winsys: x11 
Creating LL OSD context new
0:00:03.891976537 13459   0x55a74f6440 INFO                 nvinfer gstnvinfer.cpp:519:gst_nvinfer_logger:<primary-nvinference-engine> NvDsInferContext[UID 1]:initialize(): Trying to create engine from model files
0:00:03.892339463 13459   0x55a74f6440 WARN                 nvinfer gstnvinfer.cpp:515:gst_nvinfer_logger:<primary-nvinference-engine> NvDsInferContext[UID 1]:generateTRTModel(): INT8 not supported by platform. Trying FP16 mode.
0:02:13.410523690 13459   0x55a74f6440 INFO                 nvinfer gstnvinfer.cpp:519:gst_nvinfer_logger:<primary-nvinference-engine> NvDsInferContext[UID 1]:generateTRTModel(): Storing the serialized cuda engine to file at /home/edgetensor/deepstream_sdk_v4.0_jetson/samples/models/Primary_Detector/resnet10.caffemodel_b1_fp16.engine
Decodebin child added: source
Running...
Decodebin child added: decodebin0
Decodebin child added: rtph264depay0
Decodebin child added: h264parse0
Decodebin child added: capsfilter0
Decodebin child added: nvv4l2decoder0
Seting bufapi_version
Opening in BLOCKING MODE 
NvMMLiteOpen : Block : BlockType = 261 
NVMEDIA: Reading vendor.tegra.display-size : status: 6 
NvMMLiteBlockCreate : Block : BlockType = 261 
In cb_newpad
Creating LL OSD context new

Please let me know where I am going wrong. Kindly help me out.

Thanks

Hi,
Please refer to
https://devtalk.nvidia.com/default/topic/1058086/deepstream-sdk/how-to-run-rtp-camera-in-deepstream-on-nano/post/5366807/#5366807

for this command :

./deepstream-test3-app rtsp://172.16.32.83:554

it could not capture video from IP camera

Failed to load config file: No such file or directory
** ERROR: <gst_nvinfer_parse_config_file:943>: failed
Now playing: rtsp://172.16.32.83:554,

Using winsys: x11 
Creating LL OSD context new
0:00:00.290626929 24664     0x39e5b6a0 WARN                 nvinfer gstnvinfer.cpp:658:gst_nvinfer_start:<primary-nvinference-engine> error: Configuration file parsing failed
0:00:00.290774119 24664     0x39e5b6a0 WARN                 nvinfer gstnvinfer.cpp:658:gst_nvinfer_start:<primary-nvinference-engine> error: Config file path: dstest3_pgie_config.txt
Running...
ERROR from element primary-nvinference-engine: Configuration file parsing failed
Error details: /dvs/git/dirty/git-master_linux/deepstream/sdk/src/gst-plugins/gst-nvinfer/gstnvinfer.cpp(658): gst_nvinfer_start (): /GstPipeline:dstest3-pipeline/GstNvInfer:primary-nvinference-engine:
Config file path: dstest3_pgie_config.txt
Returned, stopping playback
Deleting pipeline

for this command :

./deepstream-test3-app rtsp://172.16.32.83:554

it could not capture video from IP camera

Failed to load config file: No such file or directory
** ERROR: <gst_nvinfer_parse_config_file:943>: failed
Now playing: rtsp://172.16.32.83:554,

Using winsys: x11 
Creating LL OSD context new
0:00:00.290626929 24664     0x39e5b6a0 WARN                 nvinfer gstnvinfer.cpp:658:gst_nvinfer_start:<primary-nvinference-engine> error: Configuration file parsing failed
0:00:00.290774119 24664     0x39e5b6a0 WARN                 nvinfer gstnvinfer.cpp:658:gst_nvinfer_start:<primary-nvinference-engine> error: Config file path: dstest3_pgie_config.txt
Running...
ERROR from element primary-nvinference-engine: Configuration file parsing failed
Error details: /dvs/git/dirty/git-master_linux/deepstream/sdk/src/gst-plugins/gst-nvinfer/gstnvinfer.cpp(658): gst_nvinfer_start (): /GstPipeline:dstest3-pipeline/GstNvInfer:primary-nvinference-engine:
Config file path: dstest3_pgie_config.txt
Returned, stopping playback
Deleting pipeline

Also for this command :

gst-launch-1.0 rtspsrc location=rtsp://172.16.32.83:554 ! rtph264depay ! h264parse ! omxh264dec ! nvoverlaysink

I could test IP camera.