本文将从零开始详细讲述怎么在ijkplayer中添加使用librtmp库
编译环境:
ubuntu 16.10
1.安装必要的软件
sudo apt-get install git make yasm
2.下载并编译ijkplayer,确保源码无错
git clone https://github.com/Bilibili/ijkplayer.git ijkplayer-android
cd ijkplayer-android
git checkout -B latest k0.7.5
./init-android.sh
cd android/contrib
./compile-ffmpeg.sh clean
./compile-ffmpeg.sh all
cd ..
./compile-ijk.sh all
3.添加openssl支持
cd ../..
./init-android-openssl.sh
./android/contrib/compile-openssl.sh all
编译成功后,在ijkplayer-android/android/contrib/build/目录下会有对应cpu架构的ssl静态库
4.编译librtmp生成对应静态库
cd android/contrib
git clone git://git.ffmpeg.org/rtmpdump
cd rtmpdump
进入rtmpdump目录内,新建4个文件:
Android.mk
AndroidManifest.xml
jni/Application.mk
librtmp/Android.mk
其中Android.mk: