# Four stream batching with LiteRT This command line shows a four stream batched AI inference, that is, object detection use case from a video file. Note This use case isn't supported in the QLI 2.0 RC2 release. Run the use case on the target device gst-launch-1.0 qtivcomposer sink_0::position="<0, 0>" sink_0::dimensions="<640, 360>" name=mixer \ sink_1::position="<640, 0>" sink_1::dimensions="<640, 360>" \ sink_2::position="<0, 360>" sink_2::dimensions="<640, 360>" \ sink_3::position="<640, 360>" sink_3::dimensions="<640, 360>" \ sink_4::position="<0, 0>" sink_4::dimensions="<640, 360>" sink_4::alpha=0.5 \ sink_5::position="<640, 0>" sink_5::dimensions="<640, 360>" sink_5::alpha=0.5 \ sink_6::position="<0, 360>" sink_6::dimensions="<640, 360>" sink_6::alpha=0.5 \ sink_7::position="<640, 360>" sink_7::dimensions="<640, 360>" sink_7::alpha=0.5 \ mixer. ! queue name=vcompsrcq ! fpsdisplaysink signal-fps-measurements=true text-overlay=true sync=false video-sink="waylandsink fullscreen=true sync=true" \ qtimltflite name=tflite_bs4_1 delegate=external external-delegate-path=libQnnTFLiteDelegate.so external-delegate-options="QNNExternalDelegate,backend_type=htp;" model=/opt/yolo_batch4.tflite \ qtibatch name=batch_1 ! queue name=batchsrcq ! qtimlvconverter ! tflite_bs4_1. tflite_bs4_1. ! qtimldemux name=mldemux_1 \ filesrc location=/etc/media/video.mp4 ! qtdemux ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! tee name=split_1 ! queue name=batch_sink1 ! batch_1. split_1. ! queue name=vcomp_sink1 ! mixer. \ filesrc location=/etc/media/video.mp4 ! qtdemux ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! tee name=split_2 ! queue name=batch_sink2 ! batch_1. split_2. ! queue name=vcomp_sink2 ! mixer. \ filesrc location=/etc/media/video.mp4 ! qtdemux ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! tee name=split_3 ! queue name=batch_sink3 ! batch_1. split_3. ! queue name=vcomp_sink3 ! mixer. \ filesrc location=/etc/media/video.mp4 ! qtdemux ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! tee name=split_4 ! queue name=batch_sink4 ! batch_1. split_4. ! queue name=vcomp_sink4 ! mixer. \ mldemux_1. ! queue name=dq_0 ! qtimlpostprocess settings="{\"confidence\": 75.0}" results=10 module=yolov8 labels=/etc/labels/yolov8.json ! video/x-raw,width=640,height=360 ! mixer. \ mldemux_1. ! queue name=dq_1 ! qtimlpostprocess settings="{\"confidence\": 75.0}" results=10 module=yolov8 labels=/etc/labels/yolov8.json ! video/x-raw,width=640,height=360 ! mixer. \ mldemux_1. ! queue name=dq_2 ! qtimlpostprocess settings="{\"confidence\": 75.0}" results=10 module=yolov8 labels=/etc/labels/yolov8.json ! video/x-raw,width=640,height=360 ! mixer. \ mldemux_1. ! queue name=dq_3 ! qtimlpostprocess settings="{\"confidence\": 75.0}" results=10 module=yolov8 labels=/etc/labels/yolov8.json ! video/x-raw,width=640,height=360 ! mixer. Copy to clipboard To stop the use case, use **CTRL + C**. The following figure shows the flow of the use case execution: 1. Identifies object scenes in the scene from a video stream, which is coming through a camera source. 2. Composes the following using qtivcomposer: 1. Bounding boxes over objects detected. 2. Original video stream. 3. Displays the results. Qualcomm Open source qtivcomposer tee filesrc qtdemux h264parse V4l2h264dec tee filesrc qtdemux h264parse V4l2h264dec tee filesrc qtdemux h264parse V4l2h264dec tee filesrc qtdemux h264parse V4l2h264dec qtimlvconverter qtimltflite/qtimlsnpe/qtimlqnn qtibatch qtimldemux qtimlpostprocess Waylandsink **Figure : Pipeline for four stream batching use case with LiteRT** The following table provides the sequential processing stages of the pipeline execution: | Plugin | Description | | --- | --- | | File source: filesrc | | | h264parse | Parses the H.264 video. | | [v4l2h264dec](https://docs.qualcomm.com/doc/80-80021-50/topic/v4l2h264dec.html) | Decodes the video. | | [qtibatch](https://docs.qualcomm.com/doc/80-80021-50/topic/qtibatch.html) | | | [qtimlvconverter](https://docs.qualcomm.com/doc/80-80021-50/topic/qtimlvconverter.html) |

  1. Receives the batched video streams on its sink pad.


  2. Performs the following preprocessing on the stream data. This preprocessing is done when the model expects floating-point values as input.




    1. Color conversion


    2. Scaling (up or down)


    3. Normalization







The tensor stream is used for inferencing in the later stages of the pipeline. | | [qtimltflite](https://docs.qualcomm.com/doc/80-80021-50/topic/qtimltflite.html) |

  1. After the inference runtime receives the tensor stream on its sink pad, it runs the inference.


  2. Produces a tensor stream with the inference results on its source pad.


| | qtimldemux |

  1. Demultiplexes the batched output.


  2. Splits the output corresponding to the input streams.


| | [qtimlpostprocess](https://docs.qualcomm.com/doc/80-80021-50/topic/qtimlpostprocess.html) | [qtimlpostprocess](https://docs.qualcomm.com/doc/80-80021-50/topic/qtimlpostprocess.html) | - > - qtimlpostprocess converts the inference tensors that are received on the sink pad into video formats the multimedia plugins can use for further processing. - - - [qtivcomposer](https://docs.qualcomm.com/doc/80-80021-50/topic/qtivcomposer.html) - 1. Composes frames with contents from its sink pads. 2. Pushes the GStreamer buffers containing these composed frames to its source pad. - - [Waylandsink](https://docs.qualcomm.com/doc/80-80021-50/topic/waylandsink.html) - 1. Waylandsink submits the video stream received on its sink pad to Weston. 2. Weston renders the video stream on a local display. Last Published: Mar 26, 2026 [Previous Topic Single stream from camera to RTSP with ML detection](https://docs.qualcomm.com/bundle/publicresource/80-80021-50/topics/single-stream-from-camera-to-rtsp-with-ml-detection.md) [Next Topic Object detection using USB camera source](https://docs.qualcomm.com/bundle/publicresource/80-80021-50/topics/object-detection-using-usb-camera-source.md) Source: [https://docs.qualcomm.com/doc/80-80021-50/topic/four-stream-batching-with-litert.html](https://docs.qualcomm.com/doc/80-80021-50/topic/four-stream-batching-with-litert.html)