ijkplayer编译

ijkplayer

安装homebrew、git、yasm

# install homebrew, git, yasm
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install git
brew install yasm

根据自己需要,进行如下设置

If you prefer more codec/format

cd config
rm module.sh
ln -s module-default.sh module.sh
cd android/contrib
# cd ios
sh compile-ffmpeg.sh clean

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
cd android/contrib
# cd ios
sh compile-ffmpeg.sh clean

If you prefer less codec/format for smaller binary size (by default)

cd config
rm module.sh
ln -s module-lite.sh module.sh
cd android/contrib
# cd ios
sh compile-ffmpeg.sh clean

编译

git clone https://github.com/Bilibili/ijkplayer.git ijkplayer-android
cd ijkplayer-android
git checkout -B latest k0.8.4

./init-android.sh

cd android/contrib
./compile-ffmpeg.sh clean
./compile-ffmpeg.sh all

cd ..
./compile-ijk.sh all

执行到:

./compile-ffmpeg.sh all

报错:
ANDROID_NDK=
You must define ANDROID_NDK before starting.
They must point to your NDK directories.

解决办法:

1. open .bash_profile
2. 添加:export ANDROID_NDK=你的NDK路径
3. 保存文件
4. source .bash_profile

然后重新执行:

./compile-ffmpeg.sh all

继续报错:

build on Darwin x86_64
ANDROID_NDK=/Users/xxx/Library/Android/sdk/ndk-bundle
IJK_NDK_REL=16.0.4442984
You need the NDKr10e or later

原因是我们的NDK版本太高,还不支持。

解决办法:
1.下载低版本ndk,NDK下载
2.下载版本号14的android-ndk-r14b-darwin-x86_64.zip
3.重新设置ANDROID_NDK为新下载的NDK路径

然后编译成功,我们就可以使用编译好的android目录下的ijkplayer了。

IjkVideoPlayer的简单实现源码

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值