Pass argument for the codec to display


Unable to connect to external camera using rtsp protocol


I am using latest version of the Xavier NX.
Ip-Camera model: Reolink RLC-410-5MP

Steps To Reproduce

I am following Jetson AI Fundamentals - S3E4 - Object Detection Inference - YouTube. When using usb camera everything is fine. I need to to connect a ip-camera and updated the like this below. When executed got the following error.

TRT]    detectNet -- maximum bounding boxes:  100
[TRT]    detectNet -- loaded 91 class info entries
[TRT]    detectNet -- number of object classes:  91
[gstreamer] initialized gstreamer, version
[gstreamer] gstDecoder -- creating decoder for admin:reolink@
[gstreamer] gstDecoder -- failed to discover stream info
[gstreamer] gstDecoder -- try manually setting the codec with the --input-codec option
[gstreamer] gstDecoder -- failed to create decoder for rtsp://admin:reolink@
Traceback (most recent call last):
  File "./", line 6, in <module>
    camera = jetson.utils.videoSource("rtsp://admin:reolink@")      # '/dev/video0' for V4L2
Exception: jetson.utils -- failed to create videoSource device

Looks like it needs codec. I am not sure how to pass the codec to the program. Any help is appreciated.

import jetson.inference
import jetson.utils

net = jetson.inference.detectNet("ssd-mobilenet-v2", threshold=0.5)
camera = jetson.utils.videoSource("/dev/video0")      # '/dev/video0' for V4L2
# camera = jetson.utils.videoSource("rtsp://admin:password@")      # '/dev/video0' for V4L2
display = jetson.utils.videoOutput() # 'my_video.mp4' for file

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

Hi @nagaraja,

This forum talks more about updates and issues related to TensorRT. We recommend you to post your query on Jetson forum to get better help.

Thank you.