Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rtsp source is not working #5

Open
barslan16 opened this issue Mar 5, 2021 · 15 comments
Open

rtsp source is not working #5

barslan16 opened this issue Mar 5, 2021 · 15 comments
Assignees
Labels
type:support Support question or issue

Comments

@barslan16
Copy link

Could you give a command line example of how to change video source to rtsp?
Although I tried many times, I could not run this command.

Thank you very much in advance, looking forward to your
I also add the error I got below.

WhatsApp Image 2021-03-05 at 15 15 30

@manoj7410
Copy link

manoj7410 commented Mar 12, 2021

@barslan16
Maybe you can try to test your rtsp-url on a gst-launch-1.0 first?

gst-launch-1.0 rtspsrc location=

@barslan16
Copy link
Author

Thank you very much for your advice. I tried what you said.
When I run the code below, streaming is happening.
gst-launch-1.0 rtspsrc location='rtsp://admin:1234@192.168.1.143/H264?ch=1&subtype=0' ! rtph264depay ! h264parse ! avdec_h264 ! videoconvert ! xvimagesink

However, when I run the code below, I get an error. I'm writing the error and code below.

python3 detect.py --tracker sort --videosrc rtsp://admin:1234@192.168.1.143/H264?ch=1&subtype=0 ! rtph264depay ! h264parse ! avdec_h264 ! videoconvert ! xvimagesink

Error:

Gstreamer pipeline:
rtspsrc location=rtsp://admin:1234@192.168.1.143/H264?ch=1 ! tee name=t
t. ! queue max-size-buffers=1 leaky=downstream ! videoconvert ! videoscale ! video/x-raw,width=300,height=225 ! videobox name=box autocrop=true
! video/x-raw,format=RGB,width=300,height=300 ! appsink name=appsink emit-signals=true max-buffers=1 drop=true
t. ! queue max-size-buffers=1 leaky=downstream ! videoconvert
! rsvgoverlay name=overlay ! videoconvert ! ximagesink sync=false

Warning: gst_parse_error: Delayed linking failed. (7): ./grammar.y(510): gst_parse_no_more_pads (): /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0:
failed delayed linking some pad of GstRTSPSrc named rtspsrc0 to some pad of GstTee named t
Error: gst-stream-error-quark: Internal data stream error. (1): gstbasesrc.c(3055): gst_base_src_loop (): /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0/GstUDPSrc:udpsrc0:
streaming stopped, reason not-linked (-1)

I would be glad if you could help.

@barslan16
Copy link
Author

Thank you very much for your advice. I tried what you said.
When I run the code below, streaming is happening.
gst-launch-1.0 rtspsrc location='rtsp://admin:1234@192.168.1.143/H264?ch=1&subtype=0' ! rtph264depay ! h264parse ! avdec_h264 ! videoconvert ! xvimagesink

However, when I run the code below, I get an error. I'm writing the error and code below.

python3 detect.py --tracker sort --videosrc rtsp://admin:1234@192.168.1.143/H264?ch=1&subtype=0 ! rtph264depay ! h264parse ! avdec_h264 ! videoconvert ! xvimagesink

Error:

Gstreamer pipeline:
rtspsrc location=rtsp://admin:1234@192.168.1.143/H264?ch=1 ! tee name=t
t. ! queue max-size-buffers=1 leaky=downstream ! videoconvert ! videoscale ! video/x-raw,width=300,height=225 ! videobox name=box autocrop=true
! video/x-raw,format=RGB,width=300,height=300 ! appsink name=appsink emit-signals=true max-buffers=1 drop=true
t. ! queue max-size-buffers=1 leaky=downstream ! videoconvert
! rsvgoverlay name=overlay ! videoconvert ! ximagesink sync=false

Warning: gst_parse_error: Delayed linking failed. (7): ./grammar.y(510): gst_parse_no_more_pads (): /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0:
failed delayed linking some pad of GstRTSPSrc named rtspsrc0 to some pad of GstTee named t
Error: gst-stream-error-quark: Internal data stream error. (1): gstbasesrc.c(3055): gst_base_src_loop (): /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0/GstUDPSrc:udpsrc0:
streaming stopped, reason not-linked (-1)

I would be glad if you could help.

@barslan16
Maybe you can try to test your rtsp-url on a gst-launch-1.0 first?

gst-launch-1.0 rtspsrc location=

@manoj7410
Copy link

@barslan16 Is there an HDMI monitor connected ? And on which platform are you trying to run this demo ?

@barslan16
Copy link
Author

@barslan16 Is there an HDMI monitor connected ? And on which platform are you trying to run this demo ?

@manoj7410 I am using rpi4 and coral, I could not run it when connected with hdmi, nor could I run it when connected via vnc player.
The brand of the camera I use: Qmax IP camera

@highfreq
Copy link

highfreq commented Mar 20, 2021

Same problem here, i can get a feed with:

gst-launch-1.0 rtspsrc location=rtsp://admin:password@10.8.0.4:554/videoinput_1:0/h264_2/media.stm ! rtph264depay ! h264parse ! avdec_h264 ! videoconvert ! xvimagesink

but following gives error:

python3 detect.py --tracker sort --videosrc rtsp://admin:password@10.8.0.4:554/videoinput_1:0/h264_2/media.stm

Warning: gst_parse_error: Delayed linking failed. (7): ./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 GstTee named t
Error: gst-stream-error-quark: Internal data stream error. (1): gstbasesrc.c(3072): gst_base_src_loop (): /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0/GstUDPSrc:udpsrc1:
streaming stopped, reason not-linked (-1)

Following works using laptop webcam:

python3 detect.py --tracker sort

@highfreq
Copy link

Any help please????

@Naveen-Dodda Naveen-Dodda self-assigned this May 6, 2021
@hjonnala hjonnala assigned hjonnala and unassigned Naveen-Dodda Jul 4, 2021
@hjonnala hjonnala added stat:awaiting Coral team Status - Awaiting response from Coral team type:support Support question or issue labels Aug 6, 2021
@kiteklan
Copy link

try to remove the password auth. from the camera menu

@highfreq
Copy link

Tried without password, same error. Must be something in the pipeline that they build in the application that is broken because the following works:
gst-launch-1.0 rtspsrc location=rtsp://admin:password@10.8.0.4:554/videoinput_1:0/h264_2/media.stm ! rtph264depay ! h264parse ! avdec_h264 ! videoconvert ! xvimagesink

@kiteklan
Copy link

kiteklan commented Sep 6, 2021

Quick note gst-launch-1.0 rtspsrc location="rtsp://admin:xxxxx@192.168.1.105:554/cam/realmonitor?channel=2&subtype=0"
Using double quotes may help, I managed to run with this , but still issues with buffer

@highfreq
Copy link

Can't believe still the same problem after months. Could someone from google fix it please?

@jlpoolen
Copy link

I'm looking into this and noticed that the video used for the two methods (invoked with parameters: --device and --stream) differ... and they differ from the original presumably borrowed by Google from pixabay.

See http://salemdata.net/ai/coral/video_device_comparisons.html

I think the complexity of gstreamer and video, in general, is intimidating, even for the people supporting the functionality of the coral chip.

@jlpoolen
Copy link

These dot diagrams representing runs of Google's default demonstration programs edgetpu_demo --stream and edgetpu_demo --device may be helpful in analyzing the flow:
edgetpu_demo_device_20220423_Sat_0748
edgetpu_demo_stream_20220423_Sat_0743

@hjonnala hjonnala removed the stat:awaiting Coral team Status - Awaiting response from Coral team label May 13, 2022
@jiekechoo
Copy link

It works for me :

python3 detect.py --videosrc "rtsp://192.168.120.58/ch01_sub.h264 ! rtph264depay ! h264parse ! avdec_h264 ! videoconvert"

@jvsinclair
Copy link

jvsinclair commented Jun 1, 2023

I have the same issue. I was able to use ffmpeg / vlc to view the stream with no issue:

ffplay -i rtsp://1234:1234@192.168.123.31/live 

I then tried the various gst-launch commands, for example:

gst-launch-1.0 rtspsrc location="rtsp://1234:1234@192.168.123.31/live" ! videoconvert ! autovideosink

Every time, no matter the options selected, I get the following error:

WARNING: from element /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0: Delayed linking failed.
Additional debug info:
gst/parse/grammar.y(540): gst_parse_no_more_pads (): /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0:
failed delayed linking some pad of GstRTSPSrc named rtspsrc0 to some pad of GstVideoConvert named videoconvert0
ERROR: from element /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0/GstUDPSrc:udpsrc2: Internal data stream error.

Reading through some forums is seem that on Debian there are some issues with non-free code for RTSP so the decision was made to pull it: Debian bug #982299 . Not sure it its related, but a lot of the tools I tried to use in testing this ran into issues because of RTSP being pulled (like in VLC on debian).

Then I came across this old Stack overflow article so I tried it:

gst-launch-1.0 uridecodebin uri="rtsp://1234:1234@192.168.123.31/live" ! videoconvert ! autovideosink

and it works great

Based on that, here is how I fixed it. In gstreamers.py line 219, I updated it to useuridecodebin instead of rtspsrc

    elif videosrc.startswith('http'):
        PIPELINE = 'souphttpsrc location=%s'%videosrc
    #elif videosrc.startswith('rtsp'):
    #    PIPELINE = 'rtspsrc location="%s"'%videosrc
    elif videosrc.startswith('rtsp'):
        PIPELINE = 'uridecodebin uri="%s"'%videosrc
    else:
        demux =  'avidemux' if videosrc.endswith('avi') else 'qtdemux'

With that change you can use a password protected rtsp stream. Works with Wyze v3 camera running rtsp firmware and VLC running on Mac creating a rtsp stream. Needs to be tested more before creating a pull request with this change but it works on my Debian 11 server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:support Support question or issue
Projects
None yet
Development

No branches or pull requests

9 participants