美文网首页
ijkplayer(一) 编译

ijkplayer(一) 编译

作者: 爱玩保龄球 | 来源:发表于2020-03-11 12:28 被阅读0次

    源码获取

    • 源码拉取
      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 源码编译

    • 2.1.1 根目录执行
    sh ./init-android.sh  // 拉取所需要的资源 ( ffmpeg openssl )
    cd android/contrib
    
    • 2.1.2 查看 会有下面的文件生成
    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
      • 目录 ijk_bibl/android
    sh compile-ijk.sh
    
    • 2.1.6 android studio 导入项目
      • 目录
     ijk_bibl/android/ijkplayer
    
    • 导入后删除不需要的module 参考

    2.2 可能产生错误

    • 2.2.1 错误 NDKr10e 版本需要升级
    ====================
    [*] 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
    

    相关文章

      网友评论

          本文标题:ijkplayer(一) 编译

          本文链接:https://www.haomeiwen.com/subject/isforhtx.html