# Decode and object detection using RTSP stream The **gst-rtspsrc-detection-display.py** script receives an RTSP stream as a source, decodes it, uses [YOLOv8](https://github.com/ultralytics/ultralytics) LiteRT model to identify the object in a scene from the camera stream and overlay the bounding boxes over the detected objects. The results are shown on the display. Note This application isn't supported in the QLI 2.0 RC2 release because the Python bindings aren't enabled. **Figure : Pipeline for decode and object detection using RTSP stream–Preview** ## Run the application on the target device 1. Ensure that you complete the [Prerequisites](https://docs.qualcomm.com/doc/80-80021-50/topic/prerequisites-for-python-sample-applications.html). 2. Run the object detection script on the target device: 1. Console 1 - 640 × 480 stream: gst-launch-1.0 -e qtiqmmfsrc camera=0 ! v4l2h264enc capture-io-mode=4 output-io-mode=5 ! h264parse config-interval=1 ! qtirtspbin Copy to clipboard - 1980 × 1080 stream: gst-launch-1.0 -e qtiqmmfsrc camera=0 ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 ! v4l2h264enc capture-io-mode=4 output-io-mode=5 ! h264parse config-interval=1 ! qtirtspbin Copy to clipboard 2. Console 2: gst-rtspsrc-detection-display.py Copy to clipboard Table : Default directories for model and label files for object detection using RTSP stream | Runtime | Models | Labels | | --- | --- | --- | | LiteRT | */etc/models/yolox\_quantized.tflite* | */etc/labels/yolox.json* | 3. To display the available help options, run the following command: gst-rtspsrc-detection-display.py -h Copy to clipboard ## Expected output  **Figure : Expected output for object detection and display using RTSP stream–Preview** ## Pipeline flow The following table lists the plugins used in the decode and object detection using RTSP stream pipeline: | Plugin | Description | | --- | --- | | rtspsrc | Receives the RTSP stream from *rtsp:///live*. | | rtph264depay | Extracts the video data from RTSP stream. | | h264parse | Parses the H.264 video. | | [v4l2h264dec](https://docs.qualcomm.com/doc/80-80021-50/topic/v4l2h264dec.html) | Decodes the video. Then, tee splits the stream for inferencing. | | [qtimlvconverter](https://docs.qualcomm.com/doc/80-80021-50/topic/qtimlvconverter.html) |
Receives the video stream on its sink pad.
Performs the following preprocessing on the stream data. This preprocessing is done when the model expects floating-point values as input.
Color conversion
Scaling (up or down)
Normalization
Loads the model.
Modifies the graph for the chosen delegate.
Receives the tensor stream on its sinkpad.
Runs the inference and produces a tensor stream with the inference results on its source pad.
Receives the inference tensors from the object detection model.
Converts the inference tensors on its sinkpad into formats like video or text that the multimedia plugins can process later.
Applies the threshold to the chosen number of results.
Loads the corresponding modules for detection models.
Loads the YOLOv8 submodule.
Produces results as structures of text.
Sends them to the sinkpad of qtimetamux.
Receives video stream and text stream with bounding box results corresponding to the video stream on its sinkpads.
Produces GST buffers with contents of the video stream from its sink pad.
Adds bounding boxes as GstVideoRegionOfInterest from data sinkpad to GST buffers meta (meta muxing) on its source pad.
Receives the multiplexed stream.
Overlays the bounding boxes on the VideoFrame using CL.
Produces GST buffers with overlays in its source pad.
Receives the video in its sinkpad
Submits the video stream to Weston.
Weston renders the video stream on a local display device.