# 编译并安装 Qualcomm IM SDK 插件

Tab Qualcomm Linux
Tab Ubuntu

- *class* tabincludedirectiv

    - 本节以 `mlvdetection` 插件为例，说明如何编译 Qualcomm IM SDK 插件并将其安装在设备上。

1. 搭建环境：

cd $ESDK_ROOT
        Copy to clipboard

source environment-setup-armv8-2a-qcom-linux
        Copy to clipboard

SDK environment now set up; additionally you may now run devtool to perform development tasks.
        Run devtool --help for further details.
        [/local/mnt/workspace/QIMSDK_ESDK_6490/workspace/sources/qcom-gst-ai-classification]$
        Copy to clipboard
2. 下载 Qualcomm IM SDK 插件源代码。

cd $ESDK_ROOT
        Copy to clipboard

devtool modify qcom-gstreamer1.0-plugins-oss-mlvdetection
        Copy to clipboard

    其中 `qcom-gstreamer1.0-plugins-oss-mlvdetection` 是下载插件源代码的 BitBake 配方。

NOTE: Starting bitbake server...
        Loading cache: 100% |######################################| Time: 0:00:00
        Loaded 9816 entries from dependency cache.
        Parsing recipes: 100% |####################################| Time: 0:00:01
        Parsing of 6700 .bb  files complete (6678 cached, 22 parsed). 9838 targets, 842 skipped, 0 masked, 0 errors.
        NOTE: Resolving any missing task queue dependencies
        Initialising tasks: 100% |#################################| Time: 0:00:55
        Sstate summary: Wanted 10 local 0 mirrors 0 Missed 10 Current 10 (0% match, 50% complete)
        NOTE: Executing Tasks
        NOTE: Tasks Summary: Attempted 93 tasks of which 90 didn't need to be rerun and all succeeded.
        INFO: Source tree extracted to /local/mnt/workspace/QIMSDK_ESDK_6490/workspace/sources/qcom-gstreamer1.0-plugins-oss-mlvdetection
        INFO: Recipe qcom-gstreamer1.0-plugins-oss-mlvdetection now setup to build from /local/mnt/workspace/QIMSDK_ESDK_6490/workspace/sources/qcom-gstreamer1.0-plugins-oss-mlvdetection
        Copy to clipboard

    将插件源代码下载到 `$ESDK_ROOT/workspace/sources/qcom-gstreamer1.0-plugins-oss-mlvdetection`。

[/local/mnt/workspace/QIMSDK_ESDK_6490/workspace/sources/qcom-gstreamer1.0-plugins-oss-mlvdetection]$ ls
        CMakeLists.txt    config.h.in    mlvdetection.h    modules
        [/local/mnt/workspace/QIMSDK_ESDK_6490/workspace/sources/qcom-gstreamer1.0-plugins-oss-mlvdetection]$
        Copy to clipboard
3. 定制完成后，使用以下命令重新编译插件。

devtool build qcom-gstreamer1.0-plugins-oss-mlvdetection
        Copy to clipboard

NOTE: Starting bitbake server...
        Loading cache: 100% |################################################| Time: 0:00:00
        Loaded 9816 entries from dependency cache.
        Parsing recipes: 100% |##############################################| Time: 0:00:01
        Parsing of 6700 .bb  files complete (6678 cached, 22 parsed). 9838 targets, 842 skipped, 0 masked, 0 errors.
        NOTE: Resolving any missing task queue dependencies
        Initialising tasks: 100% |###########################################| Time: 0:00:55
        Checking sstate mirror object availability: 100% |###################| Time: 0:01:06
        Sstate Summary: Wanted 264 Local 0 Mirrors 0 Missed 264 Current 255 (0% match, 49% complete)
        Removing 1 stale sstate objects for arch qcs6490_rb3gen2_vision_kit: 100% |################################################| Time: 0:00:12
        Removing 1 stale sstate objects for arch armv8-2a: 100% |##################################################################| Time: 0:00:16
        NOTE: Executing Tasks
        NOTE: qcom-gstreamer1.0-plugins-oss-mlvdetection: compiling from external source tree /local/mnt/workspace/QIMSDK_ESDK_6490/workspace/sources/qcom-gstreamer1.0-plugins-oss-mlvdetection
        NOTE: Task Summary: Attempted 1836 tasks of which 1827 didn't need to be rerun and all succeeded.
        Copy to clipboard
4. 生成插件安装程序 (`.ipk`) 以在设备上安装应用程序。

devtool package qcom-gstreamer1.0-plugins-oss-mlvdetection
        Copy to clipboard

    确认可安装软件包已位于以下路径。

ls $ESDK_ROOT/tmp/deploy/ipk/armv8-2a | grep qcom-gstreamer1.0-plugins-oss-mlvdetection
        Copy to clipboard

qcom-gstreamer1.0-plugins-oss-mlvdetection_1.0-r0_armv8-2a.ipk
        qcom-gstreamer1.0-plugins-oss-mlvdetection_dbg_1.0-r0_armv8-2a.ipk
        qcom-gstreamer1.0-plugins-oss-mlvdetection_dev_1.0-r0_armv8-2a.ipk
        qcom-gstreamer1.0-plugins-oss-mlvdetection_src_1.0-r0_armv8-2a.ipk
        [/local/mnt/workspace/QIMSDK_ESDK_6490/workspace/sources/qcom-gstreamer1.0-plugins-oss-mlvdetection]$
        Copy to clipboard
5. 按照[使用 SSH 登录](https://docs.qualcomm.com/bundle/publicresource/topics/80-70022-254/how_to.html#use-ssh)中提供的步骤，建立与设备的 SSH 连接。

    连接后，可通过其配置的 IP 地址访问 Dragonwing RB3 Gen 2 设备。
6. 将 `qcom-gstreamer1.0-plugins-oss-mlvdetection_1.0-r0_armv8-2a.ipk` 复制到 Dragonwing RB3 Gen 2 设备以安装编译的参考应用程序。
7. 通过 SSH shell 连接到设备：

ssh root@<IP addr of the target device>
        Copy to clipboard

Note

如果出现提示，请输入 `oelinux123` 作为 SSH shell 的密码。
8. 在目标设备上运行以下命令。

mount -o remount,rw /
        exit
        Copy to clipboard
9. 在主机上运行以下命令：

cd $ESDK_ROOT/tmp/deploy/ipk/armv8-2a/
        Copy to clipboard

scp qcom-gstreamer1.0-plugins-oss-mlvdetection_1.0-r0_armv8-2a.ipk root@<IP addr of the target device>:/opt
        Copy to clipboard
10. 通过 SSH shell 连接到设备：

ssh root@<IP addr of the target device>
        Copy to clipboard
11. 在目标设备上运行以下命令：

opkg --force-depends --force-reinstall --force-overwrite install /opt/qcom-gstreamer1.0-plugins-oss-mlvdetection_1.0-r0_armv8-2a.ipk
        Copy to clipboard
12. 验证 IPK 安装是否成功，如下所示。

Installing qcom-gstreamer1.0-plugins-oss-mlvdetection (1.0) on root
        Configuring qcom-gstreamer1.0-plugins-oss-mlvdetection.
        Copy to clipboard

## 后续步骤

- [Qualcomm Linux 编译指南](https://docs.qualcomm.com/bundle/publicresource/topics/80-70022-254/build_landing_page.html)
- [编译多媒体应用程序](https://docs.qualcomm.com/doc/80-70022-51SC/topic/application-development.html#application-development)
- [创建示例应用程序](https://docs.qualcomm.com/doc/80-70022-51SC/topic/content-develop-your-first-application.html#content-develop-your-first-application)
- [自定义现有示例应用程序](https://docs.qualcomm.com/doc/80-70022-51SC/topic/customize-sample-applications.html#customize-sample-applications)
- [开发自定义插件](https://docs.qualcomm.com/doc/80-70022-51SC/topic/create-your-imsdk-plugin.html#create-your-imsdk-plugin)
- [问题排查指南](https://docs.qualcomm.com/doc/80-70022-51SC/topic/troubleshooting.html#troubleshooting)

- *class* tabincludedirective

    - 要下载源代码并编译示例应用程序，请在 Qualcomm 开发套件上运行以下命令。

1. 更新会话的用户权限。

> 
> 
> sudo su
>         Copy to clipboard
2. 配置 Ubuntu 软件包管理器以下载源代码。

> 
> 
> apt-add-repository -s ppa:ubuntu-qcom-iot/qcom-ppa
>         Copy to clipboard
> 
> 
> apt-add-repository ppa:ubuntu-qcom-iot/qcom-ppa
>         Copy to clipboard
> 
> 
> apt-get install adreno-dev
>         Copy to clipboard
> 
> 
> apt-get install gstreamer1.0-qcom-sample-apps-utils-dev
>         Copy to clipboard
3. 编译依赖项。

> 
> 
> apt build-dep gst-plugins-qti-oss
>         Copy to clipboard
4. 将目录更改为主文件夹。

> 
> 
> cd /home/ubuntu
>         Copy to clipboard
5. 下载 QIM 软件包的源代码。

> 
> 
> apt source gst-plugins-qti-oss
>         Copy to clipboard
6. 转到 QIM 根文件夹。

    例如：

> 
> 
> cd gst-plugins-qti-oss-1.0.r1.05200
>         Copy to clipboard
7. 创建并转到编译目录。

> 
> 
> mkdir build; cd build
>         Copy to clipboard
8. 运行 CMake 生成 Makefile。

> 
> 
> cmake
>            -DCMAKE_INSTALL_PREFIX=/usr
>            -DCMAKE_BUILD_TYPE=None
>            -DCMAKE_INSTALL_SYSCONFDIR=/etc
>            -DCMAKE_INSTALL_LOCALSTATEDIR=/var
>            -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON
>            -DCMAKE_FIND_USE_PACKAGE_REGISTRY=OFF
>            -DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON
>            -DFETCHCONTENT_FULLY_DISCONNECTED=ON
>            -DCMAKE_INSTALL_RUNSTATEDIR=/run
>            -DCMAKE_SKIP_INSTALL_ALL_DEPENDENCY=ON
>            "-GUnix Makefiles"
>            -DCMAKE_VERBOSE_MAKEFILE=ON
>            -DCMAKE_INSTALL_LIBDIR=lib/aarch64-linux-gnu
>            -DGST_VERSION_REQUIRED=1.20.1
>            -DSYSROOT_INCDIR=/usr/include
>            -DSYSROOT_LIBDIR=/usr/lib
>            -DGST_PLUGINS_QTI_OSS_INSTALL_BINDIR=/usr/bin
>            -DGST_PLUGINS_QTI_OSS_INSTALL_LIBDIR=/usr/lib/aarch64-linux-gnu
>            -DGST_PLUGINS_QTI_OSS_INSTALL_INCDIR=/usr/include
>            -DGST_PLUGINS_QTI_OSS_INSTALL_CONFIG=/etc/configs
>            -DGST_PLUGINS_QTI_OSS_LICENSE=BSD
>            -DGST_PLUGINS_QTI_OSS_VERSION=2.0.0
>            -DGST_PLUGINS_QTI_OSS_PACKAGE=gstreamer1.0-plugins-qcom-oss
>            "-DGST_PLUGINS_QTI_OSS_SUMMARY=Qualcomm open-source GStreamer Plug-ins"
>            -DGST_PLUGINS_QTI_OSS_ORIGIN=http://www.qualcomm.com
>            -DGST_IMAGE_MAX_WIDTH=5184
>            -DGST_IMAGE_MAX_HEIGHT=3880
>            -DGST_VIDEO_MAX_WIDTH=5184
>            -DGST_VIDEO_MAX_HEIGHT=3880
>            -DGST_VIDEO_MAX_FPS=120/1
>            -DCAMERA_METADATA_VERSION=1.0
>            -DGST_VIDEO_TYPE_SUPPORT=TRUE
>            -DEIS_MODES_ENABLE=TRUE
>            -DVHDR_MODES_ENABLE=TRUE
>            -DFEATURE_OFFLINE_IFE_SUPPORT=TRUE
>            -DENABLE_VIDEO_ENCODE=TRUE
>            -DENABLE_VIDEO_DECODE=TRUE
>            -DENABLE_VIDEO_DISPLAY=TRUE
>            -DENABLE_VIDEO_ML=TRUE
>            -DENABLE_VIDEO_AUDIO=TRUE
>            ..
>         Copy to clipboard
9. 编译 QIM 插件

> 
> 
> make
>         Copy to clipboard

    如果成功，编译后的库文件将出现在编译目录中。
10. 运行以下命令安装程序。

> 
> 
> sudo make install
>         Copy to clipboard

Last Published: Dec 22, 2025

[Previous Topic
使用 Qualcomm IM SDK 自定义现有示例应用程序](https://docs.qualcomm.com/bundle/publicresource/80-70022-51SC/topics/customize-sample-applications.md) [Next Topic
为 Qualcomm IM SDK 开发自定义插件](https://docs.qualcomm.com/bundle/publicresource/80-70022-51SC/topics/create-your-imsdk-plugin.md)