下载 ffmpeg 项目
基于如下项目编译的 ffmpeg
git clone https://gitcode.com/openharmony-sig/tpc_c_cplusplus.git
配置编译环境
下载 command line tools
https://developer.huawei.com/consumer/cn/download/
导出 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。
相关库
当然也有编译好的库,可以直接使用
https://ohpm.openharmony.cn/#/cn/detail/@sj%2Fffmpeg