How to read IP camera RTSP link with jetson.utils?

Good day,

I have a UNV IP Camera (model: IPC322LR3-VSPF28-D) and would like to read its RTSP feed inside my code via function from the jetson.utils package. Is there a way to do it because the available online resources that I see suggest GStreamer but that does not work.

Please advise of a way to read RTSP in source code.

Hi @joslmn, please see this page of the jetson-utils documentation:

https://github.com/dusty-nv/jetson-inference/blob/master/docs/aux-streaming.md#rtsp

DeepStream also supports capturing RTSP camera streams.

Good day,

Thank you for reverting back to me this fast. I have tried that but it produces the following error that I am struggling to resolve.

Here is my code:

import jetson.inference
import jetson.utils

net = jetson.inference.detectNet(“ssd-mobilenet-v2”, threshold=0.5)

camera = jetson.utils.videoSource(“rtsp://:@******:1234”) # ‘/dev/video0’ for V4L2
display = jetson.utils.videoOutput() # ‘my_video.mp4’ for file

while True:
img = camera.Capture()
detections = net.Detect(img)
display.Render(img)
display.SetStatus(“Object Detection | Network {:.0f} FPS”.format(net.GetNetworkFPS()))

Note that the code works fine when I change the source to a usb-cam by having “/dev/video0” instead of the rtsp source.

Your assistance would be much appreciated.

Is there an example somewhere of how to use DeepStream as well?

I look forward to hearing from you the soonest.

Regards,
~Joseph L.

Are you able to ping your IP camera from your Jetson to confirm that it can make the connection? You may want to try running with --input-codec=h264 as well (or whatever your camera’s codec is)

You can find the DeepStream docs and links to examples here: https://docs.nvidia.com/metropolis/deepstream/dev-guide/
You can use DeepStream from C++, Python, or standalone via a config file.