源码获取
git clone https://github.com/bilibili/ijkplayer.git
git version 2.21.0 (Apple Git-122)
== pull ffmpeg base ==
Cloning into 'extra/ffmpeg'...
remote: Enumerating objects: 539029, done.
error: RPC failed; curl 56 LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54
fatal: the remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
git config --global http.postBuffer 1048576000
ijk_bibl$ git branch -a
master
remotes/origin/HEAD -> origin/master
remotes/origin/k0.3.1
remotes/origin/master
remotes/origin/r0.6.2-fix-bintray
remotes/origin/r0.6.2-fix-bintray-rebase2
remotes/origin/r0.6.3-build-exo-on-travis
remotes/origin/r0.7.5-subtitile
ijk_bibl$ git checkout -b r0.7.5-subtitile origin/r0.7.5-subtitile
2 android 编译
2.1 源码编译
sh ./init-android.sh // 拉取所需要的资源 ( ffmpeg openssl )
cd android/contrib
0 drwxr-xr-x 58 ** staff 1856 3 6 20:47 ffmpeg-arm64
0 drwxr-xr-x 58 ** staff 1856 3 6 20:36 ffmpeg-armv5
0 drwxr-xr-x 64 ** staff 2048 3 6 22:23 ffmpeg-armv7a
0 drwxr-xr-x 58 ** staff 1856 3 6 20:47 ffmpeg-x86
0 drwxr-xr-x 58 ** staff 1856 3 6 20:48 ffmpeg-x86_64
0 drwxr-xr-x 57 ** staff 1824 3 6 20:04 openssl-arm64
0 drwxr-xr-x 57 ** staff 1824 3 6 20:04 openssl-armv5
0 drwxr-xr-x 61 ** staff 1952 3 6 22:11 openssl-armv7a
0 drwxr-xr-x 57 ** staff 1824 3 6 20:04 openssl-x86
0 drwxr-xr-x 57 ** staff 1824 3 6 20:04 openssl-x86_64
- 2.1.3 编译 ffmpeg
- 目录 ijk_bibl/android/contrib
sh compile-ffmpeg.sh //选择自己需要的平台为参数
- 2.1.4 裁剪 ffmpeg
- 目录 ijk_bibl/config 修改 module-lite.sh 这个文件
- 2.1.5 编译 jni
sh compile-ijk.sh
- 2.1.6 android studio 导入项目
ijk_bibl/android/ijkplayer
2.2 可能产生错误
====================
[*] check archs
====================
FF_ALL_ARCHS = armv5 armv7a arm64 x86 x86_64
FF_ACT_ARCHS = armv7a
--------------------
[*] make NDK standalone toolchain
--------------------
build on Darwin x86_64
ANDROID_NDK=/xx/adt-bundle-mac-x86_64-20140321/android-ndk-r9
IJK_NDK_REL=14.1.3816874
You need the NDKr10e or later
# 升级下ndk 我是用的是 r13 ,升级方式可自行 google
ERROR: Could not find com.android.tools.build:gradle:3.3.1.
Searched in the following locations:
- https://jcenter.bintray.com/com/android/tools/build/gradle/3.3.1/gradle-3.3.1.pom
- https://jcenter.bintray.com/com/android/tools/build/gradle/3.3.1/gradle-3.3.1.jar
Required by:
project :
Add Google Maven repository and sync project
Open File
网友评论