Accessing rtsp feed

here is my algorithm for object detection
it works fine with usb cam or video file but when input RTSP FEED ,i get an error
import cv2

import jetson.inference
import jetson.utils
import sys
import numpy as np


display = jetson.utils.glDisplay() #initialting a

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

vs=cv2.VideoCapture(‘rtsp://’) #video input file

while display.IsOpen():
_,frame = #reading a frmae
img = cv2.cvtColor(frame, cv2.COLOR_BGR2RGBA) #converting it to a bgra format for jetson util
img = jetson.utils.cudaFromNumpy(img) #converting image to cuda format from numpy array
#img, width, height = camera.CaptureRGBA()
detections = net.Detect(img, width, height) #running detections on each image and saving the results in detections
display.RenderOnce(img, width, height) #display the output frame with detection
display.SetTitle(“Object Detection | Network {:.0f} FPS”.format(net.GetNetworkFPS())) #display title for the output feed

here is the error
[h264 @ 0x496fd5a0] error while decoding MB 94 14, bytestream -9
[h264 @ 0x496fe190] error while decoding MB 94 14, bytestream -9

You may refer to this for using jetson-inference with RTSP source:

For running deep learning inference, suggest you try DeepStream SDK. Please install the package through SDKManager and check