# Camera encode, object detection, and display
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 in the QLI 2.0 RC2 release because the Python bindings aren't enabled.
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-80021-50/topic/object-detection-classification-and-segmentation-python-sample-app.html#section-mty-hyk-bdc).
## 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 camera encode and object detection script on the target device:
gst-camera-two-stream-encode-file-detection-display.py
Copy to clipboard
3. To display the available help options, run the following command:
gst-camera-two-stream-encode-file-detection-display.py -h
Copy 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 (YOLOX) | `/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
The following table lists the plugins used to run the transformation pipeline:
| **Process** | **Description** |
| --- | --- |
| [qtiqmmfsrc](https://docs.qualcomm.com/doc/80-80021-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.
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.
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 such as 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.