Jetson-inference input RTSP over UDP

Hi! I have the same problem as here. But instead of rtsp-simple-server my noname camera from china supports rtsp and encodes video in h265 format, works fine with this command (don’t work with h265 decoding):

gst-launch-1.0 rtspsrc location=rtsp://admin:1234@192.168.1.41:554 latency=200 ! queue ! rtph264depay ! h264parse ! omxh264dec ! 'video/x-raw(memory:NVMM)' ! nvoverlaysink

output:

Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Progress: (open) Opening Stream
Progress: (connect) Connecting to rtsp://admin:1234@192.168.1.41:554
Progress: (open) Retrieving server options
Progress: (open) Retrieving media info
Progress: (request) SETUP stream 0
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
WARNING: from element /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0: Could not read from resource.
Additional debug info:
gstrtspsrc.c(5427): gst_rtspsrc_reconnect (): /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0:
Could not receive any UDP packets for 5,0000 seconds, maybe your firewall is blocking it. Retrying using a tcp connection.

(gst-launch-1.0:11426): GStreamer-CRITICAL **: 18:08:34.454: gst_caps_is_empty: assertion 'GST_IS_CAPS (caps)' failed

(gst-launch-1.0:11426): GStreamer-CRITICAL **: 18:08:34.454: gst_caps_truncate: assertion 'GST_IS_CAPS (caps)' failed

(gst-launch-1.0:11426): GStreamer-CRITICAL **: 18:08:34.454: gst_caps_fixate: assertion 'GST_IS_CAPS (caps)' failed

(gst-launch-1.0:11426): GStreamer-CRITICAL **: 18:08:34.454: gst_caps_get_structure: assertion 'GST_IS_CAPS (caps)' failed

(gst-launch-1.0:11426): GStreamer-CRITICAL **: 18:08:34.454: gst_structure_get_string: assertion 'structure != NULL' failed

(gst-launch-1.0:11426): GStreamer-CRITICAL **: 18:08:34.454: gst_mini_object_unref: assertion 'mini_object != NULL' failed
NvMMLiteOpen : Block : BlockType = 261 
NVMEDIA: Reading vendor.tegra.display-size : status: 6 
NvMMLiteBlockCreate : Block : BlockType = 261 
Allocating new output: 1920x1088 (x 11), ThumbnailMode = 0
OPENMAX: HandleNewStreamFormat: 3605: Send OMX_EventPortSettingsChanged: nFrameWidth = 1920, nFrameHeight = 1080 
^Chandling interrupt.
Interrupt: Stopping pipeline ...
Execution ended after 0:00:07.997687179
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

ffplay over TCP works fine, over UDP does not work, so I conclude that my camera cannot work with UDP. In jetson-inference “RTSP network streams are subscribed to from a remote host over UDP/IP.” so I can’t use my camera that doesn’t work over UDP / IP for some reason. Please tell me have I any options to use jetson-inference and connect it to the camera via TCP? If i need to rewrite part of jetson-inference please indicate where to start.

Hi @farhatyakubov, you can edit the RTSP pipeline created by jetson-inference/jetson-utils here in the code:

https://github.com/dusty-nv/jetson-utils/blob/0d3f59f5c0967a108ec1cd58a518ee5ad817d35b/codec/gstDecoder.cpp#L524

I’m not exactly sure, but I think you may want to try adding protocols=tcp to the rtspsrc element. Does this pipeline work for you?

gst-launch-1.0 rtspsrc location=rtsp://admin:1234@192.168.1.41:554 latency=200 protocols=tcp ! queue ! rtph264depay ! h264parse ! omxh264dec ! 'video/x-raw(memory:NVMM)' ! nvoverlaysink

BTW I found out about this setting using the gst-inspect tool:

$ gst-inspect-1.0 rtspsrc
 protocols           : Allowed lower transport protocols
                        flags: readable, writable
                        Flags "GstRTSPLowerTrans" Default: 0x00000007, "tcp+udp-mcast+udp"
                           (0x00000000): unknown          - GST_RTSP_LOWER_TRANS_UNKNOWN
                           (0x00000001): udp              - GST_RTSP_LOWER_TRANS_UDP
                           (0x00000002): udp-mcast        - GST_RTSP_LOWER_TRANS_UDP_MCAST
                           (0x00000004): tcp              - GST_RTSP_LOWER_TRANS_TCP
                           (0x00000010): http             - GST_RTSP_LOWER_TRANS_HTTP
                           (0x00000020): tls              - GST_RTSP_LOWER_TRANS_TLS

Also, if you change the C++ code in jetson-inference/jetson-utils, re-run the following:

$ cd /path/to/your/jetson-inference/build
$ cmake ../
$ make
$ sudo make install
2 Likes

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