# Multi input/output object detection
Source: [https://docs.qualcomm.com/doc/80-70018-50/topic/gst-ai-multi-input-output-object-detection.html](https://docs.qualcomm.com/doc/80-70018-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 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-70018-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
1. If not already done so, [Download and install eSDK](https://docs.qualcomm.com/bundle/publicresource/topics/80-70018-51/install-sdk.html#download-and-install-esdk-).
2. Download the [YOLOv5](https://github.com/ultralytics/yolov5) model.
Running the
yolov5.tflite model requires a Python
environment.
Note: Update the following commands
according to the Python version in your host environment.
3. 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
4. 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
5. On the host computer, push the model to the
device:
scp yolov5m-int8.tflite root@:/etc/models/yolov5.tfliteCopy to clipboard
6. [Download model and label files](https://docs.qualcomm.com/doc/80-70018-50/topic/download-model-and-label-files.html).
7. Enable SSH to access your host device. For instructions, see [Sign in using SSH](https://docs.qualcomm.com/bundle/publicresource/topics/80-70018-254/how_to.html#use-ssh).
Note: If SSH is already enabled, you can skip this
step.
8. Connect the display to the device using the HDMI port. For instructions, see
[Set up HDMI display](https://docs.qualcomm.com/bundle/publicresource/topics/80-70018-18/samples.html).
9. Enable the
display:
export XDG_RUNTIME_DIR=/dev/socket/weston && export WAYLAND_DISPLAY=wayland-1Copy to clipboard
10. Push the model files from the Linux host
computer:
scp root@:/etc/modelsCopy to clipboard
If you face issues while enabling camera or display, see [Camera troubleshooting](https://docs.qualcomm.com/bundle/publicresource/topics/80-70018-17/troubleshooting.html) and [Display troubleshooting](https://docs.qualcomm.com/bundle/publicresource/topics/80-70018-18/debug.html).
## Run the application
YOLO-NAS and YOLOv5 models are trained on the same Common Objects in Context (COCO)
dataset.
Enter SSH shell and copy the YOLO-NAS label files to YOLOv5:
cp /etc/labels/yolonas.labels /etc/labels/yolov5.labelsCopy to clipboard
Note: The following commands provide the default model and label
paths. If you have a different folder structure, replace the default paths in the
command-line parameters. See [Sample model and label files](https://docs.qualcomm.com/doc/80-70018-50/topic/gst-ai-parallel-inference.html#gst-ai-parallel-inference__section_pnn_hmb_4dc).
- Run object detection on streams from two
cameras:
gst-ai-multi-input-output-object-detection --num-camera=2 --display --model=/etc/models/yolov5.tflite --labels=/etc/labels/yolov5.labelsCopy to clipboard
- Run object detection on streams from a file source and display the
output:
gst-ai-multi-input-output-object-detection --num-file=2 --display --model=/etc/models/yolov5.tflite --labels=/etc/labels/yolov5.labelsCopy to clipboard
The
default source paths for the video files are
/etc/media/video1.mp4 and
/etc/media/video2.mp4.
- Run object detection on streams from an RTSP source and display the output:
gst-ai-multi-input-output-object-detection --num-rtsp=2 --rtsp-ip-port= --display --model=/etc/models/yolov5.tflite --labels=/etc/labels/yolov5.labelsCopy to clipboard
It's expected to have the live1.mkv and
live2.mkv streams on for
`ip-port`.
- Take the input source video stream from a file and display the output as
follows:
- Display the output on a screen.
- Save the output on a file.
- Send the output over the network through RTSP streaming.
Before running this use case, ensure that the evaluation kit (EVK) and
the host computer are connected to the same network:
Run the use cases
in a
shell:
gst-ai-multi-input-output-object-detection --num-file=2 -d -f /etc/media/app.mp4 --out-rtsp --model=/etc/models/yolov5.tflite --labels=/etc/labels/yolov5.labels -i -p Copy to clipboard
To
view the RTSP stream on the host PC, do the following:
- Install VLC Media Player on the host computer and set the environment
variables.
- On the Linux host computer, do one of the following to see the RTSP
stream:
vlc -vvv rtsp://:/liveCopy to clipboard
ffplay -rtsp_transport tcp rtsp://:/liveCopy to clipboard
- On the Windows host computer, do the following:
1. Open the VLC Media Player.
2. Select Media > Open Network Stream or use CTRL +
N).
3. Enter
`rtsp://:/live`.
4. Select Play.
Note: Ensure that the total number of input streams
from the camera, RTSP, and file source doesn't exceed 6.
To display the available help options, run the following command in the SSH
shell:
gst-ai-multi-input-output-object-detection --helpCopy to clipboard
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 table lists the plugins used in the multi input/output inference use
cases:| Plugin | Description |
| --- | --- |
| Camera source:[qtiqmmfsrc](https://docs.qualcomm.com/doc/80-70018-50/topic/qtiqmmfsrc.html) | |
| File source: filesrc | |
| RTSP source: rtspsrc | |
| h264parse | Parses the H.264 video. |
| [v4l2h264dec](https://docs.qualcomm.com/doc/80-70018-50/topic/v4l2h264dec.html) | Decodes the video. |
| [qtimlvconverter](https://docs.qualcomm.com/doc/80-70018-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-70018-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-70018-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-70018-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](https://docs.qualcomm.com/doc/80-70018-50/topic/waylandsink.html) |
- 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-70018-50/topic/qtirtspbin.html) |
- Serves as a network sink.
- Transmits UDP packets to the network.
|
Pull the files from the target
device:
scp root@:/etc/media/out.mp4 Copy to clipboard
## 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.
**Parent Topic:** [Run AI/ML sample applications](https://docs.qualcomm.com/doc/80-70018-50/topic/ai-ml-sample-applications.html)
**Related Resources**
- [Object detection](https://docs.qualcomm.com/doc/80-70018-50/topic/gst-ai-object-detection.html)
Last Published: Jan 30, 2026
[Previous Topic
Parallel inferencing](https://docs.qualcomm.com/bundle/publicresource/80-70018-50/topics/gst-ai-parallel-inference.md) [Next Topic
Daisy chain detection and classification](https://docs.qualcomm.com/bundle/publicresource/80-70018-50/topics/daisy-chain-detection-and-classification.md)