# Image classification and encode with Neural Processing SDK
Source: [https://docs.qualcomm.com/doc/80-80020-50/topic/single-camera-stream-with-image-classification-and-encode-with-mobilenet-v1.html](https://docs.qualcomm.com/doc/80-80020-50/topic/single-camera-stream-with-image-classification-and-encode-with-mobilenet-v1.html)
The use cases implement the InceptionV3 image classification model with Qualcomm
Neural Processing SDK to classify scenes from a single camera stream and either overlay or
compose the classification labels. The streams are then encoded.
You can use any publicly available classification model with LiteRT and convert it to
`.dlc` format. For instructions, see [TensorFlow Model Conversion](https://docs.qualcomm.com/bundle/publicresource/topics/80-63442-2/model_conv_tensorflow.html).
Note: For Ubuntu Server, `sudo` access is necessary to
write the encoded stream to the `/etc/media` folder.
## Use qtivoverlay plugin to apply classification overlay
Run the use case on the target
device:
gst-launch-1.0 -e filesrc location=/etc/media/video.mp4 ! qtdemux ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! tee name=split \
split. ! queue ! qtimetamux name=metamux ! queue ! qtivoverlay ! queue ! \
v4l2h264enc capture-io-mode=4 output-io-mode=4 ! h264parse ! mp4mux ! filesink location=/etc/media/video.mp4 \
split. ! queue ! qtimlvconverter ! queue ! qtimlsnpe delegate=dsp model=/etc/models/inceptionv3.dlc ! queue ! qtimlpostprocess \
settings="{\"confidence\": 40.0}" results=2 module=mobilenet-softmax labels=/etc/labels/classification.json ! text/x-raw ! queue ! metamux.Copy to clipboard
To stop the use case, use CTRL + C.
The following figure shows the flow of the use case execution:
1. Classify scenes from a video stream coming through a file source.
2. Overlay the classification labels using overlaylib.
3. Encode this stream as an H.264 bitstream.
4. Multiplex the stream in an MP4 container and store it as an MP4 file.
Figure : Pipeline for classification overlay and encode
The following table provides the sequential processing stages of the pipeline
execution:
| Process | Description |
| --- | --- |
| File source: filesrc |
Captures the video stream using filesrc, followed by qtdemux, which demultiplexes the stream.
Applies parameters to each frame of the video stream it's receiving on its sinkpad.
Encodes it into bitstream and sends it over its sourcepad.
|
| h264parse | Adds more information about the bitstream to GStreamer buffer meta. |
| mp4mux | Receives these buffers and creates containers with format specification buffers. |
| **Output** | **Output** |
| Filesink | Stores the resulting stream in a /etc/media/video.mp4 file. |
| Playback | Pull video.mp4 from the host computer and play it on a media player: `scp root@ target device>:/etc/media/video.mp4 directory>` |
## Use qtivcomposer to mix original frame with classification mask
Run the use case on the target
device:
gst-launch-1.0 -e --gst-debug=2 \
filesrc location=/etc/media/Draw_1080p_18s_30FPS.mp4 ! qtdemux ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! queue ! tee name=split \
split. ! queue ! qtivcomposer name=mixer sink_1::position="<30, 30>" sink_1::dimensions="<320, 180>" ! queue ! \
v4l2h264enc capture-io-mode=4 output-io-mode=5 ! h264parse ! queue ! mp4mux ! queue ! filesink location=/etc/media/video.mp4 \
split. ! queue ! qtimlvconverter ! queue ! qtimlsnpe delegate=dsp model=/etc/ models/inceptionv3.dlc ! queue ! qtimlpostprocess settings="{\"confidence\": 40.0}" \
results=2 module=mobilenet-softmax labels=/etc/labels/classification.json ! video/x-raw,format=BGRA,width=640,height=360 ! queue ! mixer.Copy to clipboard
To stop the use case, use CTRL + C.
The following figure shows the flow of the use case execution:
- Classify scenes from a video stream coming through a file source.
- Compose classification labels and video stream together using qtivcomposer.
- Encode this stream as an H.264 bitstream.
- Multiplex the stream in an MP4 container and store it as an MP4 file.
Figure : Pipeline for classification and encode with qtivcomposer
The following table provides the sequential processing stages of the pipeline
execution:
| Process | Description |
| --- | --- |
| File source: filesrc |
Captures the video stream using filesrc, followed by qtdemux, which demultiplexes the stream.
Applies parameters to each frame of the video stream it's receiving on its sinkpad.
Encodes it into bitstream and sends it over its sourcepad.
|
| h264parse | Adds more information about the bitstream to GStreamer buffer meta. |
| mp4mux | Receives these buffers and creates containers with format specification buffers. |
| **Output** | **Output** |
| Filesink | Stores the resulting stream in a /etc/media/video.mp4 file. |
| Playback | Pull video.mp4 from the host computer and play it on a media player: `scp root@ target device>:/etc/media/video.mp4 directory>` |
**Parent Topic:** [Qualcomm Neural Processing SDK use cases](https://docs.qualcomm.com/doc/80-80020-50/topic/qualcomm-neural-processing-sdk-use-cases.html)
Last Published: Mar 02, 2026
[Previous Topic
Image classification and display with Neural Processing SDK](https://docs.qualcomm.com/bundle/publicresource/80-80020-50/topics/single-camera-stream-with-image-classification-and-display-with-mobilenet-v1.md) [Next Topic
Object detection and display with Neural Processing SDK](https://docs.qualcomm.com/bundle/publicresource/80-80020-50/topics/single-camera-stream-with-object-detection-and-display-with-mobilenet-v2-ssd.md)