鸿蒙编译ffmpeg库

8 阅读1分钟

下载 ffmpeg 项目

基于如下项目编译的 ffmpeg git clone gitcode.com/openharmony…

配置编译环境

下载 command line tools

developer.huawei.com/consumer/cn…

导出 OHOS_SDK 环境变量

export OHOS_SDK=~/command-line-tools/sdk/default/openharmony

拷贝必要鸿蒙平台的 cmake

cp command-line-tools/sdk/default/openharmony/native/build-tools/cmake/share/cmake-3.28/Modules/Platform/OHOS.cmake /opt/homebrew/Cellar/cmake/4.0.2/share/cmake/Modules/Platform/

进入到相应的编译工具文件夹

cd tpc_c_cplusplus/lycium/Buildtools

解压工具链

tar -zxvf toolchain.tar.gz

拷贝必要的编译工具

cp toolchain/* command-line-tools/sdk/default/openharmony/native/llvm/bin/

编译工具

brew install cmake automake ninja wget

为了后续的 sha512sum

brew install coreutils

进入到

tpc_c_cplusplus/lycium

开始编译

./build FFmpeg

之后产物就在 lycium/usr 目录下 cd tpc_c_cplusplus/lycium/usr

在之后就可以根据文档来引入相关的库来编译 ffmpeg。

相关库

当然也有编译好的库,可以直接使用 ohpm.openharmony.cn/#/cn/detail…

参考文档

参考文档