# AI 智能 codec

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

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

Note: Qualcomm Linux 1.5 版本不支持此应用程序。此问题将在未来的版本中修复。

## 示例模型和标签文件

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

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

## 前提条件

- 确保[下载并安装 eSDK](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-51/install-sdk.html#download-and-install-esdk-)（如果尚未安装）。
- [下载模型和标签文件](https://docs.qualcomm.com/doc/80-70020-50SC/topic/download-model-and-label-files.html)。
- 要访问您的主机，请设置 SSH。有关说明，请参阅[使用 SSH 登录](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-254/how_to.html#use-ssh)。
Note: 如果已设置 SSH，则可以跳过此步骤。
- 从 Linux 主机推送模型文件。

        scp <model_filename> root@<IP address of target device>:/etc/modelsCopy to clipboard
- 请注意，[下载的脚本](https://docs.qualcomm.com/doc/80-70020-50SC/topic/download-model-and-label-files.html)会将示例 video.mp4 视频下载到 /etc/media 目录。如果您使用的是自定义视频，请确保将视频推送到 /etc/media，并在应用程序的 config.JSON 文件中更新文件路径。
- 使用 HDMI 端口将显示器连接到设备。有关说明，请参见[设置 HDMI 显示器](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-18/samples.html)。
- 激活显示器：

        export XDG_RUNTIME_DIR=/dev/socket/weston && export WAYLAND_DISPLAY=wayland-1Copy to clipboard

如果您遇到摄像头或显示器问题，请参阅[摄像头故障排查](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-17/troubleshooting.html)和[显示器故障排查](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-18/debug.html)。

## 运行应用程序

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

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

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

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

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

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

要停止用例，请按 CTRL + C。

## 预期输出

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

## 相关信息

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

**Parent Topic:** [运行 AI/ML 示例应用程序](https://docs.qualcomm.com/doc/80-70020-50SC/topic/ai-ml-sample-applications.html)

Last Published: Jul 23, 2025

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