ijkplayer环境搭建及编译

来源:互联网 发布:php手机考试系统 编辑:程序博客网 时间:2024/05/22 20:51

参考博文

http://blog.csdn.net/buleriver/article/details/26407695

https://github.com/Bilibili/ijkplayer


上面博主的文章有点过时,但是可以和github上的搭配一起看。


操作系统:Ubuntu 15.04虚拟机

软件环境:除Ubuntu预装的所有应用,还需要以下工具:git, make, yasm , sdk, ndk。


1.安装 git,make,yasm  

  直接通过 apt-get inastll  xxx 安装

2.安装配置SDK和NDK_r10e注意:建议环境变量的所有操作都切换成root用户操作,不然会导致后面编译时NDK版本错误

点击下载,sdk为压缩包,ndk为安装包,请自行配置安装

SDK:http://pan.baidu.com/s/1qWJh4wk

NDK:http://pan.baidu.com/s/1dDAqnK1

设置ANDROID_SDK和ANDROID_NDK环境变量,并添加PATH环境变量中。

修改$HOME/.bashrc文件,在最后面添加如下代码:(注意自行修改对应目录

             NDK环境变量搭建

    1. export ANDROID_SDK=~/Development/adt-bundle-linux-x86-20130917/sdk  
    2. export ANDROID_NDK=~/Development/android-ndk-r9b  
    3. export PATH=$PATH:$ANDROID_SDK:$ANDROID_NDK:$ANDROID_SDK/platform-tools/  


3.ijkplayer配置github地址

参考github配置

第一步:克隆项目

git clone https://github.com/Bilibili/ijkplayer.git

第二步:配置ijkplayer支持格式

  • If you prefer more codec/format
cd configrm module.shln -s module-default.sh module.shcd android/contrib# cd iossh compile-ffmpeg clean
  • If you prefer less codec/format for smaller binary size (include hevc function)
cd configrm module.shln -s module-lite-hevc.sh module.shcd android/contrib# cd iossh compile-ffmpeg clean
  • If you prefer less codec/format for smaller binary size (by default)
cd configrm module.shln -s module-lite.sh module.shcd android/contrib# cd iossh compile-ffmpeg clean
如上,进入config目录,根据你需要支持的格式,进行修改,一般选择第三种。

# choose [No] to use bashsudo dpkg-reconfigure dash
编译前改变编译方式,记得选no


4.下载编译

./init-android.sh    //下载ffmpegcd android/contrib./compile-ffmpeg.sh clean  //清理./compile-ffmpeg.sh all    //编译cd .../compile-ijk.sh all       //生成ijk需要的.so文件

如果不想编译的同学,下面是我已经编译好的项目,可以直接在android studio上使用

点我下载

1 0
原创粉丝点击