How to Call Hardware Decoding to Accelerate RTSP Video Reading?

I am using the Jetson AGX Orin and would like to use the YOLO V8 model to detect rtsp videos streams, and then send the detection results to another host. Here is my program. The video delay is very high now. Is there any way to make slight changes to my program and call for hardware accelerated decoding?

def camera1_thread():
    cap1 = cv2.VideoCapture('rtsp://admin:admin123@192.168.1.108:554/cam/realmonitor?channel=1&subtype=1')
    print('camera_channel_1 is running')
    model = YOLO('yolov8n.pt')
    while True:
        ret, frame = cap1.read()       
        if ret:
            results = model(frame)
            boxes = results[0].boxes
            
            type = int(boxes[0].cls[0].tolist())
            conf = round(boxes[0].conf[0].tolist(), 1)
            xywhn = list(map(int, boxes[0].xywhn[0].tolist()[:]))                
            
            data = {
                'address': 'ch1',
                'alarm':type,
                'conf': conf,
                'xyxy': xywhn,                 
            }
            
            json_data = json.dumps(data)
            client1.sendall(json_data.encode())
    cap1.release()

Hi,
Please refer to the sample:
Doesn't work nvv4l2decoder for decoding RTSP in gstreamer + opencv - #3 by DaneLLL

For running Yolo models, we suggest use DeepStream SDK to get optimal performance. Please check the documents:
NVIDIA Metropolis Documentation

Hi DaneLLL!
Thank you for your reply! Sorry to bother you again. I have reviewed the link you sent. May I use “rtspsrc location”= rtsp://…" need to compile opencv with gstreamer? Do you have any relevant tutorials that you can send me? Thank you!

There is no update from you for a period, assuming this is not an issue any more.
Hence we are closing this topic. If need further support, please open a new one.
Thanks

Sorry for the late response.
Is this still an issue to support? Any result can be shared?