# Decode and object detection using RTSP stream
Source: [https://docs.qualcomm.com/doc/80-70018-50/topic/rts-decode-ai-detection-yolo-v8-overlay-display.html](https://docs.qualcomm.com/doc/80-70018-50/topic/rts-decode-ai-detection-yolo-v8-overlay-display.html)
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 sample application isn't supported on QCS8275 and
QCS9075.
Figure : Pipeline for decode and object detection using RTSP stream–Preview

## Run the application
1. Ensure that you complete the [Prerequisites](https://docs.qualcomm.com/doc/80-70018-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 ! qtirtspbinCopy 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 ! qtirtspbinCopy to clipboard
2. Console
2:
gst-rtspsrc-detection-display.pyCopy to clipboard
Table : Default directories for model and label files for object
detection using RTSP stream
| Runtime | Models | Labels |
| :--- | :--- | :--- |
| LiteRT | /etc/models/YoloV8N_Detection_Quantized.tflite | /etc/labels/yolov8n.labels |
To display the available help options, run the following command:
gst-rtspsrc-detection-display.py -hCopy to clipboard
## Expected output
Figure : Expected output for object detection and display using RTSP
stream–Preview

## Pipeline flow
The table lists the plugins used in the decode and object detection using RTSP
stream pipeline:| Plugin | Description |
| --- | --- |
| rtspsrc | Receives the RTSP stream from
rtsp://<ip-address>/live. |
| rtph264depay | Extracts the video data from RTSP stream. |
| h264parse | Parses the H.264 video. |
| [v4l2h264dec](https://docs.qualcomm.com/doc/80-70018-50/topic/v4l2h264dec.html) | Decodes the video. Then, tee splits the stream for
inferencing. |
| [qtimlvconverter](https://docs.qualcomm.com/doc/80-70018-50/topic/qtimlvconverter.html) |
In
this use case, qtimlvdetection does the following: