# Monodepth from video
Source: [https://docs.qualcomm.com/doc/80-70023-50/topic/mono-depth-from-video.html](https://docs.qualcomm.com/doc/80-70023-50/topic/mono-depth-from-video.html)
The **gst-ai-monodepth** application allows you to infer depth of a source feed
from a live camera stream, file, or an RTSP stream.
The following figure shows the pipeline, which captures feed from the source,
preprocesses it, and runs inferences using the AI hardware. For information about the
plugins used in the pipeline, see [Pipeline flow](https://docs.qualcomm.com/doc/80-70023-50/topic/mono-depth-from-video.html#mono-depth-from-video__section_w3l_s1t_pbc).
Figure : gst-ai-monodepth pipeline
## Sample model and label files
| Runtime | Model files | Label files |
| --- | --- | --- |
| Qualcomm Neural Processing SDK | midasv2.dlc | monodepth.json |
| LiteRT | midas_quantized.tflite | monodepth.json |
| Qualcomm AI Engine direct | midas_quantized.bin | monodepth.json |
| | | |
| | | |
## Run the application on the target device
The sample application uses the
/etc/configs/config\_monodepth.json file to read the input
parameters.
To create your own config JSON file, use [config_monodepth.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-monodepth/config_monodepth.json?ref_type=heads) as a reference.
1. Ensure that you complete the [Prerequisites](https://docs.qualcomm.com/doc/80-70023-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-70023-50/topic/mono-depth-from-video.html#mono-depth-from-video__section_xhk_l4r_32c).
3. Use the following format of the config\_monodepth.json
file:
{
"file-path": "",
"ml-framework": "",
"model": "",
"labels": "",
"runtime": ""
}Copy to clipboard
For example, run the application using the LiteRT model and
DSP runtime, with input from a video file, and custom model and label
paths:
{
"file-path": "/etc/media/video.mp4",
"ml-framework": "tflite",
"model": "/etc/models/midas_quantized.tflite",
"labels": "/etc/labels/monodepth.json",
"runtime": "dsp"
}Copy to clipboard
4. Run the gst-ai-monodepth
application:
gst-ai-monodepth --config-file=/etc/configs/config_monodepth.jsonCopy to clipboard
5. To display the available help options, run the following command in the SSH
shell:
gst-ai-monodepth -hCopy to clipboard
6. To stop the use case, use CTRL +
C.
## Expected output
The overlaid model output stream is shown side by side with the live feed.
Figure : Expected output for gst-ai-monodepth application

## Pipeline flow
The following table lists the plugins used in the mono depth pipeline:
| Plugin | Description |
| --- | --- |
| Camera source:[qtiqmmfsrc](https://docs.qualcomm.com/doc/80-70023-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-70023-50/topic/v4l2h264dec.html) | Decodes the video. |
| [qtimlvconverter](https://docs.qualcomm.com/doc/80-70023-50/topic/qtimlvconverter.html) | Used by AI processing stream for preprocessing:
Receives the video stream on its sink pad.
Performs the following preprocessing on the stream data. This preprocessing is done when the model expects floating-point values as input.
Color conversion
Scaling (up or down)
Normalization
Converts the preprocessed video stream to a tensor stream on its source pad.
The tensor stream is used for inferencing in the later stages of the pipeline. |
| Inferencing plugins: [qtimlsnpe](https://docs.qualcomm.com/doc/80-70023-50/topic/qtimlsnpe.html), [qtimltflite](https://docs.qualcomm.com/doc/80-70023-50/topic/qtimltflite.html), and [qtimlqnn](https://docs.qualcomm.com/doc/80-70023-50/topic/qtimlqnn.html) | Uses the Midasv2 model for monodepth.
The inference runtime receives the tensor stream on its sink pad.
The runtime runs the inference.
Produces a tensor stream with the inference results on its source pad.
The postprocessing plugin for processing the inference comes from the Midasv2 model. |
| qtimlpostprocess | Converts the inference tensors that it receives on its sink pad into video formats that the multimedia plugins can use for further processing. |
| [qtivtransform](https://docs.qualcomm.com/doc/80-70023-50/topic/qtivtransform.html) | Converts the buffers on its source pad. These buffers are for composition on Waylandsink. |
| [Waylandsink](https://docs.qualcomm.com/doc/80-70023-50/topic/waylandsink.html) |
Waylandsink submits the video stream received on its sink pad to Weston.
Weston renders the video stream on a local display.
|
## 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_monodepth.json file
| Field | Values/description |
| :--- | :--- |
| **ml-framework** | Enable and use one of the following models:
snpe: Qualcomm Neural Processing SDK.
tflite: LiteRT.
qnn: Qualcomm AI Engine direct.
|
| **runtime** | Enable and use one of the following runtimes:
cpu
gpu
dsp
|
| **Input source** | Enable and use one of the following input sources:
camera: Primary (0) or secondary (1).
file-path: The directory path to the video file.
rtsp-ip-port: The address of the RTSP stream: rtsp://<ip>:<port>/<stream>.
|
## Related information
[Image segmentation](https://docs.qualcomm.com/doc/80-70023-50/topic/gst-ai-segmentation.html)
**Parent Topic:** [Run AI/ML sample applications](https://docs.qualcomm.com/doc/80-70023-50/topic/ai-ml-sample-applications.html)
Last Published: Mar 27, 2026
[Previous Topic
Daisy chain detection and pose estimation](https://docs.qualcomm.com/bundle/publicresource/80-70023-50/topics/daisy-chain-detection-and-pose-detection.md) [Next Topic
Video super-resolution](https://docs.qualcomm.com/bundle/publicresource/80-70023-50/topics/video-super-resolution.md)