# Multi input/output object detection
Source: [https://docs.qualcomm.com/doc/80-70020-50/topic/gst-ai-multi-input-output-object-detection.html](https://docs.qualcomm.com/doc/80-70020-50/topic/gst-ai-multi-input-output-object-detection.html)
The **gst-ai-multi-input-output-object-detection** application allows you to
perform objection detection on video streams from various sources such as a camera, a file,
or over a network such as RTSP.
The following figure shows the pipeline workflow, which captures video streams for
inferencing from different sources such as camera, file, or RTSP. For information about
the plugins used in the pipeline, see [Pipeline flow](https://docs.qualcomm.com/doc/80-70020-50/topic/gst-ai-multi-input-output-object-detection.html#gst-ai-multi-input-output-object-detection__section_qbz_bsq_nbc).
Figure : Multi-input inferencing pipeline
## Sample model and label files
Table : Sample model and label files for
gst-ai-multi-input-output-object-detection
| Runtime | Model files | Label files |
| :--- | :--- | :--- |
| LiteRT | yolov5.tflite | yolov5.labels |
## Prerequisites
Note: Update the following commands according to the Python
version in your Linux host computer.
- Create the Python 3.8 virtual
environment:
sudo apt-get install python3.8Copy to clipboard
python3.8 -m venv py3.8Copy to clipboard
source py3.8/bin/activateCopy to clipboard
- Generate the yolov5.tflite
model:
git clone https://github.com/ultralytics/yolov5.gitCopy to clipboard
cd yolov5Copy to clipboard
python -m pip install -r requirements.txt tensorflow-cpuCopy to clipboard
python export.py --weights yolov5m.pt --img 320 --include tflite --int8 --data data/coco128.yamlCopy to clipboard
- In the terminal of the host computer, run the following command to push the
model to the target device:
- For Qualcomm
Linux:
scp yolov5m-int8.tflite root@:/etc/models/yolov5.tfliteCopy to clipboard
- For Ubuntu
Server:
scp yolov5m-int8.tflite ubuntu@:/home/ubuntu
ssh ubuntu@
sudo cp /home/ubuntu/yolov5.tflite /etc/modelsCopy to clipboard
If any model isn't available after downloading the script file, you can
download the model from [IoT–](https://aihub.qualcomm.com/iot/models/)
[Qualcomm AI Hub](https://aihub.qualcomm.com/iot/models/).
## Run the application on the target device
Note: The commands in this section are targeted for the sample
applications based on QLI GA 1.5 (PPA version 05900 in Ubuntu) or later releases.
Run the `apt-cache policy gstreamer1.0-qcom-sample-apps` command to
check your QIM version. If you are using sample applications from older versions,
run the application with the `--help` option for more
instructions.
Note: The following commands provide the default model and label
paths. If you have a different folder structure, replace the default paths in the
config file. See [Sample model and label files](https://docs.qualcomm.com/doc/80-70020-50/topic/gst-ai-parallel-inference.html#gst-ai-parallel-inference__section_pnn_hmb_4dc).
The sample application uses the
/etc/configs/config-multi-input-output-object-detection.json
file to read the input parameters.
To create your own config JSON file, use [config-multi-input-output-object-detection.json](https://git.codelinaro.org/clo/le/platform/vendor/qcom-opensource/gst-plugins-qti-oss/-/blob/imsdk.lnx.2.0.0.r2-rel/gst-sample-apps/gst-ai-multi-input-output-object-detection/config-multi-input-output-object-detection.json) as a reference.
1. Ensure that you also complete these additional [Prerequisites](https://docs.qualcomm.com/doc/80-70020-50/topic/download-model-and-label-files.html).
2. Update the config JSON file based on the model, input stream, and other
properties. For more information, see [Config JSON field description](https://docs.qualcomm.com/doc/80-70020-50/topic/gst-ai-multi-input-output-object-detection.html#gst-ai-multi-input-output-object-detection__section_mxw_t2r_32c).
For QCS6490, if `file-path` and
`rtsp-ip-port` are *not* present in the
configuration file, then the camera input is selected.
3. Enter SSH shell and copy the YOLO-NAS label files to
YOLOv5:
cp /etc/labels/yolonas.labels /etc/labels/yolov5.labelsCopy to clipboard
Note: For Ubuntu Server, this step requires a
`sudo`.
4. Use the following format of the
config-multi-input-output-object-detection.json
file:
{
"num-camera": "",
"camera-id": "",
"input-file-path": "",
"input-rtsp-path": "",
"model": "",
"labels": "",
"constants": ""
"output-file-path": ""
"output-ip-address": ""
"output-port-number": ""
"output-display": ""
}Copy to clipboard
For example, run the application using the custom video
input file, model and label paths, and
constants:
{
"input-file-path":
[
"/etc/media/video1.mp4",
"/etc/media/video2.mp4"
],
"model": "/etc/models/yolov5.tflite",
"labels": "/etc/labels/yolov5.labels",
"constants": "YoloV5,q-offsets=<3.0>,q-scales=<0.005047998391091824>;",
"output-display": true,
"output-file-path": "/etc/media/output.mp4",
"output-ip-address": "127.0.0.1",
"output-port-number": "8554"
}Copy to clipboard
5. Run the gst-ai-multi-input-output-object-detection
application:
gst-ai-multi-input-output-object-detection --config-file=/etc/configs/config-multi-input-output-object-detection.jsonCopy to clipboard
Note: Ensure that the total number of input streams from the
camera, RTSP, and file source doesn't exceed 6.
6. Pull the files from the target device:
- For Linux
host:
scp root@:/etc/media/out.mp4 Copy to clipboard
- For Ubuntu Server
host:
scp ubuntu@:/etc/media/out.mp4 Copy to clipboard
7. To display the available help options, run the following command in the SSH
shell:
gst-ai-multi-input-output-object-detection --helpCopy to clipboard
8. To stop the use case, use CTRL +
C.
## Expected output
Based on the use case, the results are either displayed on an HDMI screen, saved as
an H.264 encoded MP4 file, or streamed over the RTSP server.
Figure : Expected output for gst-ai-multi-input-output-object-detection
application–Preview

## Pipeline flow
The following table lists the plugins used in the multi input/output inference
use cases:| Plugin | Description |
| --- | --- |
| Camera source:[qtiqmmfsrc](https://docs.qualcomm.com/doc/80-70020-50/topic/qtiqmmfsrc.html) |
Captures the live stream from camera.
Uses tee to split the stream for inferencing.
|
| File source: filesrc |
Captures the video stream using filesrc, followed by qtdemux, which demultiplexes the stream.
Uses tee to split the stream for inferencing.
|
| RTSP source: rtspsrc |
Captures the RTSP stream using rtspsrc, followed by rtph264depay for video extraction.
Uses tee to split the stream for inferencing.
|
| h264parse | Parses the H.264 video. |
| [v4l2h264dec](https://docs.qualcomm.com/doc/80-70020-50/topic/v4l2h264dec.html) | Decodes the video. |
| [qtimlvconverter](https://docs.qualcomm.com/doc/80-70020-50/topic/qtimlvconverter.html) |
Receives the video stream on its sink pad.
Performs the following preprocessing on the stream data. This is done when the model expects floating-point values as input.
Color conversion
Scaling (up or down)
Normalization
The tensor stream is used for inferencing in the later stages of the pipeline. |
| [qtimltflite](https://docs.qualcomm.com/doc/80-70020-50/topic/qtimltflite.html) | Runs on the LiteRT and uses the yolov5.tflite model for object detection.
After the inference runtime receives the tensor stream on its sink pad, it runs the inference.
Produces a tensor stream with the inference results on its source pad.
|
| [qtimlvdetection](https://docs.qualcomm.com/doc/80-70020-50/topic/qtimlvdetection.html) | Converts the inference tensors that it receives on its sink pad into video formats that the multimedia plugins can process later. |
| [qtivcomposer](https://docs.qualcomm.com/doc/80-70020-50/topic/qtivcomposer.html) |
Composes frames with contents from its sink pads.
Pushes the GStreamer buffers containing these composed frames to its source pad.
Waylandsink submits the video stream received on its sink pad to Wayland compositor.
Renders the video stream on a local display.
|
| Filesink | Takes the video stream that it receives on its sink pad and saves it as an H.264-encoded MP4 file. |
| [qtirtspbin](https://docs.qualcomm.com/doc/80-70020-50/topic/qtirtspbin.html) |
Serves as a network sink.
Transmits UDP packets to the network.
|
## Config JSON field description
The different parameters available to configure the JSON file and run the use case
are as follows:
Table : Field description–config-multi-input-output-object-detection.json
file
| Field | Values/description |
| :--- | :--- |
| **Input source** | Use one of the following input sources:
num-camera: The number of inputs from the camera. Select either 1 or 2.
camera-id: The id of the test camera. Select either 0 or 1.
input-file-path: The directory path to the video file.
input-rtsp-path: The address of the RTSP stream: rtsp://<ip>:<port>/<stream>
|
| **Models and labels** |
model: The path to the model file.
labels: The path to the label file.
constants: The LiteRT detection model constants.
|
| **Output** | Use one of the following outputs:
output-file-path: The directory path to save the output file.
output-ip-address: The IP address of the device on which the RTSP stream can be played.
output-port-number: The port number of the device on which the RTSP stream can be played.
output-display: The connected display device for preview.
|
## Known issues
- An fps drop is observed when running the application with six input
streams.
- A display crash is observed when running two cameras together in a long run
scenario.
## Related information
[Object detection](https://docs.qualcomm.com/doc/80-70020-50/topic/gst-ai-object-detection.html)
**Parent Topic:** [Run AI/ML sample applications](https://docs.qualcomm.com/doc/80-70020-50/topic/ai-ml-sample-applications.html)
Last Published: Jan 30, 2026
[Previous Topic
Parallel inferencing](https://docs.qualcomm.com/bundle/publicresource/80-70020-50/topics/gst-ai-parallel-inference.md) [Next Topic
Daisy chain detection and classification](https://docs.qualcomm.com/bundle/publicresource/80-70020-50/topics/daisy-chain-detection-and-classification.md)