# Image segmentation and encode with LiteRT Source: [https://docs.qualcomm.com/doc/80-70018-50/topic/single-camera-stream-with-image-segmentation-and-encode.html](https://docs.qualcomm.com/doc/80-70018-50/topic/single-camera-stream-with-image-segmentation-and-encode.html) The use case uses the `deeplabv3_resnet50` LiteRT model to compose the semantic segmentations and original video stream, encode this stream, and then multiplex it in an MP4 container. Run the use case: gst-launch-1.0 -e --gst-debug=2 \ qtiqmmfsrc name=camsrc ! video/x-raw,format=NV12_Q08C,width=1280,height=720,framerate=30/1 ! queue ! tee name=split \ split. ! queue ! qtivcomposer name=mixer sink_1::dimensions="<1920,1080>" sink_1::alpha=0.5 ! queue ! video/x-raw,format=NV12,width=1920,height=1080,interlace-mode=progressive,colorimetry=bt601 ! \ v4l2h264enc capture-io-mode=4 output-io-mode=5 ! h264parse ! queue ! mp4mux ! queue ! filesink location=/etc/media/video.mp4 \ split. ! queue ! qtimlvconverter ! queue ! qtimltflite delegate=external external-delegate-path=libQnnTFLiteDelegate.so \ external-delegate-options="QNNExternalDelegate,backend_type=htp;" model=/etc/models/deeplabv3_plus_mobilenet_quantized.tflite ! queue ! \ qtimlvsegmentation module=deeplab-argmax labels=/etc/labels/deeplabv3_resnet50.labels constants="deeplab,q-offsets=<0.0>,q-scales=<1.0>;" ! video/x-raw,width=256,height=144 ! queue ! mixer.Copy to clipboard To stop the use case, use CTRL + C. Figure : Pipeline for segmentation and encode with qtivcomposer  The figure shows the flow of the use case execution: 1. Identify the scenes from a video stream coming through a camera source. 2. Compose the semantic segmentation and video stream using qtivcomposer. 3. Encode the stream as a H.264 bit stream and multiplex the stream in an MP4 container. The table provides the sequential processing stages of the pipeline execution: | Process | Description | | --- | --- | | [qtiqmmfsrc](https://docs.qualcomm.com/doc/80-70018-50/topic/qtiqmmfsrc.html) |
The segmentation model uses this tensor stream for
inferencing.
In this use case, qtimlvsegmentation does the
following: