Windows下编译android版ijkplayer

今天也来编译一下ijkplayer ,并做记录。
先普及一下cygwin和mingw知识
cygwin和mingw都是为用户提供在windows操作系统使用GNU工具的方法,使得在windows上可以编译为linux写的c源代码并运行(让你可以用signal等linux才有的api)。

真正的不同在于
1,cygwin大,mingw小
2,cygwin编译后的exe需要cygwin1.dll作为支持,而mingw不需要就可以直接运行,因为有中间层所以cygwin慢,mingw快。
3,cygwin包含的内容更全面,能编译通过的linux源文件更多,mingw的min是minimalist所以能编译通过的更少。但,不是全部,就是说别指望你可以把任何为linux写的源代码在cygwin或mingw编译通过并运行。

编译之前请确保已经配置好环境。关于配置细节请自行百度,不过一般在此之前都配置过了。
1.安装cygwin,并安装git,make,ysam
2.设置环境变量
在cygwin的home目录下,修改 ~/.bash_profile 或 ~/.profile文件,添加
export ANDROID_SDK=
export ANDROID_NDK=
其中的路径根据实际情况填写。

//clone 源码到本地
git clone https://github.com/Bilibili/ijkplayer.git ijkplayer-android 

cd ijkplayer-android
//切换最新分支
git checkout -B latest k0.8.0

//流程化脚本编译
//1、编译前选择你的配置
//If you prefer more codec/format

cd config
rm module.sh
ln -s module-default.sh module.sh

//If you prefer less codec/format for smaller binary size (include hevc function)
cd config
rm module.sh
ln -s module-lite-hevc.sh module.sh

//If you prefer less codec/format for smaller binary size (by default)
cd config
rm module.sh
ln -s module-lite.sh module.sh

//执行脚本 会自动下载ffmpeg
./init-android.sh

//最后开始编译
cd android/contrib
./compile-ffmpeg.sh clean
./compile-ffmpeg.sh all

cd ..
./compile-ijk.sh all
  • 1

导入Android Studio运行

如果编译带HTTPS的so

./init-android-openssl.sh
./init-android.sh


./compile-openssl.sh clean//清除
./compile-ffmpeg.sh clean//清除
./compile-openssl.sh all//编译
./compile-ffmpeg.sh all//编译

./compile-ijk.sh all
  • 1

生成的so每种类型有三个,ffmepg的so大于3M就是https成功的标志啦!

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

苦茶子12138

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值