# Failed to capture video frame using RTSP

**URL:** <https://forums.developer.nvidia.com/t/failed-to-capture-video-frame-using-rtsp/186446>\
**Category:** Jetson Nano\
**Tags:** rtsp\
**Created:** [August 13, 2021, 5:41am UTC](https://forums.developer.nvidia.com/t/failed-to-capture-video-frame-using-rtsp/186446 "2021-08-13T05:41:08Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![AK51](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@AK51](https://forums.developer.nvidia.com/u/AK51)\
**Post date:** [August 13, 2021, 5:41am UTC](https://forums.developer.nvidia.com/t/failed-to-capture-video-frame-using-rtsp/186446/1 "2021-08-13T05:41:08Z")

</div>

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

 ![vlc_264](https://global.discourse-cdn.com/nvidia/original/3X/a/2/a257fa397bca7d06f9039772a53dd17359b31fa3.jpeg)  
 ![vlc_265](https://global.discourse-cdn.com/nvidia/original/3X/1/7/170130a55f267236ccd0a7df38f06a21834e220b.jpeg)  
 ![nx_264](https://global.discourse-cdn.com/nvidia/original/3X/1/8/18230126e8311d9d17f66ab9c70b1d04a85c637d.jpeg)  
 ![nx_fail](https://global.discourse-cdn.com/nvidia/original/3X/b/b/bb71e6558f99f943d5908722767d0cb929db786d.jpeg)

---

<div class="post-metadata">

**Author:** ![DaneLLL](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/danelll/32/14043_2.png) [@DaneLLL](https://forums.developer.nvidia.com/u/DaneLLL)\
**Post date:** [August 13, 2021, 7:15am UTC](https://forums.developer.nvidia.com/t/failed-to-capture-video-frame-using-rtsp/186446/3 "2021-08-13T07:15:08Z")

</div>

Hi,  
Please check if it works with _uridecodebin_:

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

```

---

<div class="post-metadata">

**Author:** ![AK51](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@AK51](https://forums.developer.nvidia.com/u/AK51)\
**Post date:** [August 13, 2021, 7:45am UTC](https://forums.developer.nvidia.com/t/failed-to-capture-video-frame-using-rtsp/186446/4 "2021-08-13T07:45:32Z")

</div>

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

 ![gst](https://global.discourse-cdn.com/nvidia/original/3X/5/6/56a076846f73d4ed5d841093f2cd9fd747f9abaf.jpeg)  
 ![opencv](https://global.discourse-cdn.com/nvidia/original/3X/2/9/2907c1c9c53cd901b03298fb34cab37b5f0fc33f.jpeg)

---

<div class="post-metadata">

**Author:** ![DaneLLL](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/danelll/32/14043_2.png) [@DaneLLL](https://forums.developer.nvidia.com/u/DaneLLL)\
**Post date:** [August 13, 2021, 8:18am UTC](https://forums.developer.nvidia.com/t/failed-to-capture-video-frame-using-rtsp/186446/5 "2021-08-13T08:18:23Z")

</div>

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

```auto
uri='rtsp://_RTSP_URI_'

```

---

<div class="post-metadata">

**Author:** ![AK51](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@AK51](https://forums.developer.nvidia.com/u/AK51)\
**Post date:** [August 13, 2021, 8:36am UTC](https://forums.developer.nvidia.com/t/failed-to-capture-video-frame-using-rtsp/186446/6 "2021-08-13T08:36:23Z")

</div>

It does not pop any window and stay there… Thx

 ![gst_no_window](https://global.discourse-cdn.com/nvidia/original/3X/b/7/b7ecf7fe588775018bb20df321fc178dc0038212.jpeg)

---

<div class="post-metadata">

**Author:** ![AK51](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@AK51](https://forums.developer.nvidia.com/u/AK51)\
**Post date:** [August 13, 2021, 8:44am UTC](https://forums.developer.nvidia.com/t/failed-to-capture-video-frame-using-rtsp/186446/7 "2021-08-13T08:44:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![AK51](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@AK51](https://forums.developer.nvidia.com/u/AK51)\
**Post date:** [August 20, 2021, 6:16am UTC](https://forums.developer.nvidia.com/t/failed-to-capture-video-frame-using-rtsp/186446/8 "2021-08-20T06:16:11Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![DaneLLL](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/danelll/32/14043_2.png) [@DaneLLL](https://forums.developer.nvidia.com/u/DaneLLL)\
**Post date:** [August 20, 2021, 10:14am UTC](https://forums.developer.nvidia.com/t/failed-to-capture-video-frame-using-rtsp/186446/9 "2021-08-20T10:14:15Z")

</div>

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](https://forums.developer.nvidia.com/t/ip-camera-connection-with-jetson-utils-gstcamera/155064/6)  
[Passing in codec options to jetson.utils.videoSource in python - #4 by dusty\_nv](https://forums.developer.nvidia.com/t/passing-in-codec-options-to-jetson-utils-videosource-in-python/167839/4)  
[jetson.utils.videoSource() and RTSP with low latency on Nano - is it possible? - #3 by dusty\_nv](https://forums.developer.nvidia.com/t/jetson-utils-videosource-and-rtsp-with-low-latency-on-nano-is-it-possible/154042/3)

Please check and see if these help.

---

<div class="post-metadata">

**Author:** ![AK51](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@AK51](https://forums.developer.nvidia.com/u/AK51)\
**Post date:** [August 23, 2021, 5:50am UTC](https://forums.developer.nvidia.com/t/failed-to-capture-video-frame-using-rtsp/186446/10 "2021-08-23T05:50:15Z")

</div>

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

[![](https://global.discourse-cdn.com/nvidia/original/3X/4/1/41ca96212c19e809d9c19ea298186670a09d11cb.jpeg "Jetson RTSP problem") ](https://www.youtube.com/watch?v=LVung1DwuEg)

---

<div class="post-metadata">

**Author:** ![dusty\_nv](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/dusty_nv/32/14043_2.png) [@dusty\_nv](https://forums.developer.nvidia.com/u/dusty_nv)\
**Post date:** [August 23, 2021, 4:14pm UTC](https://forums.developer.nvidia.com/t/failed-to-capture-video-frame-using-rtsp/186446/11 "2021-08-23T16:14:37Z")

</div>

> [@AK51](#):
>
> 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?

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.

---

<div class="post-metadata">

**Author:** ![AK51](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@AK51](https://forums.developer.nvidia.com/u/AK51)\
**Post date:** [August 24, 2021, 4:26am UTC](https://forums.developer.nvidia.com/t/failed-to-capture-video-frame-using-rtsp/186446/12 "2021-08-24T04:26:27Z")

</div>

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)

[![](https://global.discourse-cdn.com/nvidia/original/3X/4/9/49bc3d23a6ed69503c6e96a9d038a2c293dd58e8.jpeg "Jetson RTSP works") ](https://www.youtube.com/watch?v=fceB9VDeBJI)

---

<div class="post-metadata">

**Author:** ![nadeemm](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/nadeemm/32/367020_2.png) [@nadeemm](https://forums.developer.nvidia.com/u/nadeemm)\
**Post date:** [October 15, 2021, 3:20am UTC](https://forums.developer.nvidia.com/t/failed-to-capture-video-frame-using-rtsp/186446/14 "2021-10-15T03:20:06Z")

</div>

Closed on October 15, 2021, 3:20am UTC


