Failed to capture video frame using RTSP

Hi, I’ve played with the rtsp with another IP cam and it works fine.
However, today, I have another IP cam which I can see the stream in vlc player, but not in video-viewer… (Note: I use the same string of calling the IP cam)
I have read the forum and tried to add --input-codec=h264 or --input-codec=h265
Btw, I didn’t use any proxy.
I have also tried
video-viewer --input-codec=h264 rtsp://192.168.50.3:554/user=…&password=…&channel=1&stream=0.sdp? (same for vlc player)
I have attached the codec info (h264 and h265) from vlcplayer, may I know if there is any code modification I shall do? Or any codec I shall add? And how to add the codec? Thx




Hi,
Please check if it works with uridecodebin:

$ gst-launch-1.0 uridecodebin uri='rtsp://_RTSP_URI_' ! nvoverlaysink

No,
ERROR: from element/GstPipeline:pipleline0…
But if I use openCV, I can see the video though.


Hi,
Please put URI in ' ' and give it a try:

uri='rtsp://_RTSP_URI_'

It does not pop any window and stay there… Thx

if I type gst-launch-1.0 uridecodebin url=‘…’ ! autovideosink, there is a video window pops up.
Where shall I modify the code so that the detectnet.py will work? Thx

May I know if there is any update? Thx
Do I need to buy another camera?

Hi,
If you can see preview through autovideosink. The source should work. There are related topics:
IP camera connection with jetson.utils.gstCamera - #6 by dusty_nv
Passing in codec options to jetson.utils.videoSource in python - #4 by dusty_nv
jetson.utils.videoSource() and RTSP with low latency on Nano - is it possible? - #3 by dusty_nv

Please check and see if these help.

Hi,

I have tried for 2 days… no luck
This command works and I can see the pop up window video
(gst-launch-1.0 uridecodebin uri=‘rtsp://RTSP_URI’ ! nvoverlaysink)
But this command does not work
video-viewer --input-codec=h264 rtsp://192.168.50.3:554/user=…&password=…&channel=1&stream=0.sdp?
There is an error of “gststreamer rtspsrc0 ERROR Could not get/set settings from/on resources”. When I google it, this error is related to gst-launch (but I have no problem with gst-launch, only the video-viewer and detectnet…)

Here is the youtube for a better explanation

Hi @AK51, sorry I am not sure what the issue is with this particular camera. uridecodebin doesn’t use the hw-accelerated decoder, which is why I don’t use it.

Lower in your log, it says Server can not provide an SDP, so I think it is related to rtspsrc somehow. If you go higher in the log, you will see the exact GStreamer pipeline printed out that jetson.utils runs. I would take that and replace the appsink with a display element, and try running it with gst-launch-1.0 and tweaking it until it works. That will let you know what needs to be changed in the code.

Thanks. It is good to know what the problem is.
After 4hours of trial and error, I found a solution. :>
It is the problem of the rtsp string, but it is funny why vlc player works but not gstStreamer, anyway…
python3 video-viewer.py --input-rtsp-latency=0 rtsp://192.168.50.3:554/user=user_password=password&channel=1&stream=0.sdp?

Youtube as a proof (Tt is like magic. Ha)