# AI 智能 codec

Source: [https://docs.qualcomm.com/doc/80-70017-50SC/topic/ai-smart-codec.html](https://docs.qualcomm.com/doc/80-70017-50SC/topic/ai-smart-codec.html)

**gst-ai-smartcodec-example** 应用程序可减少摄像头或文件源的输入的网络带宽和存储资源。

## 前提条件

- [下载 LiteRT 和 Qualcomm AI Engine Direct 的模型、标签和 config JSON 文件](https://docs.qualcomm.com/doc/80-70017-50SC/topic/ai-ml-sample-applications.html#ai-ml-sample-applications__section_fsl_lgz_scc).
- 要访问您的主机设备，请启用 SSH。相关说明，可参见[使用 SSH 登录](https://docs.qualcomm.com/bundle/publicresource/topics/80-70017-254/how_to.html#use-ssh)。
注释： 如果 SSH 已启用，则可以跳过此步骤。
- 进入 SSH shell 并运行用例：

        ssh root@<ip-addr of the target device>Copy to clipboard
- 启用显示屏：

        export XDG_RUNTIME_DIR=/dev/socket/weston && export WAYLAND_DISPLAY=wayland-1Copy to clipboard
- 从 Linux 主机推送文件：

        scp <filename> root@<IP address of target device>:/opt/Copy to clipboard
- 将 video.mp4 文件推送到 opt 文件夹中。

## 运行应用程序

关于模型和标签文件，请参阅[示例模型和标签文件](https://docs.qualcomm.com/doc/80-70017-50SC/topic/ai-smart-codec.html#ai-smart-codec__section_lb3_1th_4dc)。

- 使用摄像头源运行应用程序：

        gst-ai-smartcodec-example -w 1920 -h 1080 -o output.mp4 -m /opt/YOLOv8-Detection-Quantized.tflite -l /opt/coco_labels.txtCopy to clipboard
- 使用文件源运行应用程序：

        gst-ai-smartcodec-example -i /opt/video.mp4 -o output.mp4 -m /opt/YOLOv8-Detection-Quantized.tflite -l /opt/coco_labels.txtCopy to clipboard

请在 SSH shell 中运行以下命令，以显示可用的帮助选项：

    gst-ai-smartcodec-example --helpCopy to clipboard

如需停止用例，可按下 CTRL + C。

## 预期输出

该应用程序生成一个编码后的 MP4 文件作为输出。

## 示例模型和标签文件

Table : gst-ai-smartcodec-example 的示例模型和标签文件

| Runtime | 模型文件 | 标签文件 |
| :--- | :--- | :--- |
| LiteRT | <var class="keyword varname">YOLOv8-Detection-Quantized.tflite</var> | <var class="keyword varname">coco_labels.txt</var> |

**上一级主题：** [AI/ML 示例应用程序](https://docs.qualcomm.com/doc/80-70017-50SC/topic/ai-ml-sample-applications.html)

**相关概念**  

- [智能 codec](https://docs.qualcomm.com/doc/80-70017-50SC/topic/smart-codec.html)

Last Published: Nov 11, 2025

[Previous Topic
多流批量推理](https://docs.qualcomm.com/bundle/publicresource/80-70017-50SC/topics/multistream-batch-inference.md) [Next Topic
人脸检测](https://docs.qualcomm.com/bundle/publicresource/80-70017-50SC/topics/gst-ai-face-detection.md)