Error while streaming ethernet camera with RTSP protocol

Hello, I want to stream a video from ethernet camera through RTSP protocol, I have installed in my jetson TX2 board FFMPEG 3.4 and OpenCV 3.3.0 both from git sources.
I have tested OpenCV with Onboard camera and it work perfectly, but the problem is when I try to connect to one ethernet camera with the following gstreamer pipeline:

gst-launch-1.0 rtspsrc location=rtsp://192.168.1.219:554/video.pro1 latency=0 ! rtph264depay ! h264parse ! omxh264dec ! nvvidconv ! video/x-raw, format=BGRx ! videoconvert ! appsink

the output of this pipeline is:

Setting pipeline to PAUSED …
Pipeline is live and does not need PREROLL …
Progress: (open) Opening Stream
Progress: (connect) Connecting to rtsp://192.168.1.219:554/video.pro1
ERROR: from element /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0: Could not open resource for reading and writing.
Additional debug info:
gstrtspsrc.c(6819): gst_rtspsrc_retrieve_sdp (): /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0:
Failed to connect. (Generic error)
ERROR: pipeline doesn’t want to preroll.
Setting pipeline to PAUSED …
Setting pipeline to READY …
Setting pipeline to NULL …
Freeing pipeline …

Can you try

gst-launch-1.0 rtspsrc location=rtsp://192.168.1.219:554/video.pro1 latency=0 ! rtph264depay ! fakesink

Not sure but port is usually 5554 by default. Probably a typo in your pipeline…

Progress: (connect) Connecting to rtsp://192.168.1.219:554/video.pro1
ERROR: from element /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0: Could not open resource for reading and writing.

I think the above error usually means ‘rtspsrc’ fails to connect to the IP CAM.

Have you verified the URI you’re using (rtsp://192.168.1.219:554/video.pro1)? What I usually do is to use ‘vlc’ for testing before I run the GStreamer pipeline. To install and run vlc:

$ sudo apt-get install vlc
$ vlc

Then right click on vlc window and select ‘Open Media’ -> ‘Open Network’. Reference: https://www.brickcom.com.tw/support/faq_contents.php?id=7

Another thing I’ve noticed is that you’ve set ‘latency=0’ for ‘rtspsrc’. This is probably not a good practice, since ‘rtspsrc’ cannot buffer anything and would thus throw away any (potentially a lot of) late network packets. I myself usually set this latency value to 50~200 (ms) in a LAN environment, depending on network condition and behavior of the IP CAM.

Reference: https://jkjung-avt.github.io/tx2-camera-with-python/

Thanks to both for the answers, I have tried to access the RTSP stream with VLC with the following command:

$ vlc rtsp://192.168.1.219:554/video.pro1

and it works perfectly on Jetson TX2 and my laptop with the H265 and MJPEG encoding algorithms, then I suppose that rtsp uri is correct. I have also tried the gstreamer pipeline:

gst-launch-1.0 rtspsrc location=rtsp://192.168.1.219:554/video.pro1 latency=0 ! rtph264depay ! fakesink

but it returns the following error:

Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Progress: (open) Opening Stream
Progress: (connect) Connecting to rtsp://192.168.1.219:554/video.pro1
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
WARNING: from element /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0: Delayed linking failed.
Additional debug info:
./grammar.y(506): gst_parse_no_more_pads (): /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0:
failed delayed linking some pad of GstRTSPSrc named rtspsrc0 to some pad of GstRtpH264Depay named rtph264depay0
ERROR: from element /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0/GstUDPSrc:udpsrc3: Internal data flow error.
Additional debug info:
gstbasesrc.c(2948): gst_base_src_loop (): /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0/GstUDPSrc:udpsrc3:
streaming task paused, reason not-linked (-1)
Execution ended after 0:00:00.189744758
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

Looks to be gstreamer issue. Can you please get help from http://gstreamer-devel.966125.n4.nabble.com ?

Could you try to set ‘latency’ to a larger value? For example,

gst-launch-1.0 rtspsrc location=rtsp://192.168.1.219:554/video.pro1 latency=1000 ! rtph264depay ! fakesink