# Camera encode, object detection, and display
Source: [https://docs.qualcomm.com/doc/80-70022-50/topic/camera-encode-file-detection-yolov8-overlay-display.html](https://docs.qualcomm.com/doc/80-70022-50/topic/camera-encode-file-detection-yolov8-overlay-display.html)
The **gst-camera-two-stream-encode-file-detection-display.py** application encodes
the camera stream and saves it to a file. The application uses a YOLOX LiteRT model to
identify the objects in a scene from a camera stream. The application overlays the bounding
boxes over the detected objects and displays the results.
Note: This application isn't supported on the Ubuntu Server.
Figure : Pipeline for camera encode and object detection
For information about the plugins used in this pipeline, see [Pipeline flow](https://docs.qualcomm.com/doc/80-70022-50/topic/camera-encode-file-detection-yolov8-overlay-display.html#camera-encode-file-detection-yolov8-overlay-display__section_mty_hyk_bdc).
## Run the application on the target device
1. Ensure that you complete the [Prerequisites](https://docs.qualcomm.com/doc/80-70022-50/topic/prerequisites-for-python-sample-applications.html).
2. Run the camera encode and object detection script on the target
device:
gst-camera-two-stream-encode-file-detection-display.pyCopy to clipboard
3. To display the available help options, run the following
command:
gst-camera-two-stream-encode-file-detection-display.py -hCopy to clipboard
The following are the default files in the Python script:
Table : Default model and label files for
gst-camera-two-stream-encode-file-detection-display.py
| Files | Directory |
| :--- | :--- |
| Detection model (YOLOv8) | /etc/models/yolox\_quantized.tflite |
| Detection labels (same for both models) | /etc/labels/yolox.json |
## Expected output
The output is saved at /etc/media/test.mp4.
## Pipeline flow
| Process | Description |
| --- | --- |
| [qtiqmmfsrc](https://docs.qualcomm.com/doc/80-70022-50/topic/qtiqmmfsrc.html) | Collects two video streams from the camera:
One stream is saved to a file.
The second stream is used for detection. It's split using tee and sent to the following:
qtimetamux to retain the video stream.
qtimlvconverter to convert the video stream to input tensors for the classification inference.
|
| [v4l2h264enc](https://docs.qualcomm.com/doc/80-70022-50/topic/v4l2h264enc.html) | Encodes H.264 video. |
| h264parse | Parses H.264 video. |
| mp4mux | Multiplexes the video data. |
| filesink | Saves the video data to a file. |
| **Preprocessing** | **Preprocessing** |
| [qtimlvconverter](https://docs.qualcomm.com/doc/80-70022-50/topic/qtimlvconverter.html) |
Receives the video stream on its sink pad.
Performs preprocessing:
Color conversion
Scaling down/up
Normalization on the stream data when the model expects the floating point values as an input
Converts the video stream to a tensor stream on its source pad.
The object detection model uses this tensor stream for inferencing.
Weston renders the video stream on a local display device.
|
## Related information
[Object detection](https://docs.qualcomm.com/doc/80-70022-50/topic/gst-ai-object-detection.html)
**Parent Topic:** [Run Python-based applications](https://docs.qualcomm.com/doc/80-70022-50/topic/python-sample-applications.html)
Last Published: Feb 20, 2026
[Previous Topic
Transform and encode a camera stream](https://docs.qualcomm.com/bundle/publicresource/80-70022-50/topics/camera-transform-downscale-and-rotate-encode.md) [Next Topic
Object detection, classification, and segmentation](https://docs.qualcomm.com/bundle/publicresource/80-70022-50/topics/object-detection-classification-and-segmentation-python-sample-app.md)