How to get the real-time frame of the video?

Hi, I use python, after Gst gets rtsp streaming,

  1. How to get the real-time frame of the video?
  2. After finishing net.Detect, can the results be displayed on the same viewer?

These two problems bothered me for a week,
Checked a lot of information but couldn’t solve it,
Can anyone help provide directions, thank you.

The code is similar to the following:

import jetson.inference
import jetson.utils
import cv2

import gi
gi.require_version(‘Gst’, ‘1.0’)
from gi.repository import GObject, Gst


pipeline = Gst.parse_launch(rtsp_command)
video_sink = pipeline.get_by_name(‘source’)
video_sink.props.location = rtsp_src
width = 1024
height = 768

#Show rtsp frame,It’s okay
pipeline.set_state(Gst.State.PLAYING)

#1.How to get the number of video frames(buffer)?

frame_rgba = cv2.cvtColor(frame, cv2.COLOR_BGR2RGBA)
cuda_frame = hetson.utils.cudaFromNumpy(frame_rgba)
detections = net.Detect(cuda_frame, width, height)

#2.How to integrate the results into the same viewer?

Hi,
We suggest use DeepStream SDK. Please install the package through SDKManager and try the python samples: