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:
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 …
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:
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.
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:
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 ...