- The company needs to do technical research on live broadcast, so we need to study the technology of the player. Just I collected ijkplayer on GitHub, I have not studied it before, now just clone down research.
I first in Windows install Cygwin compile, various error, various pits, decisively give up. Then use the VMware installed Ubuntu 16.04, one-time complete. Ha ha
So get to the chase!
Compiling the environment
Ubuntu 16.04
ndkr11b
Android SDK 24
Lantern (FQ tool, recommended installation,: Https://github.com/getlantern/lantern)
Prepare before compiling
1. Install git command: $ sudo apt-get install git
2. Install the YASM command: $ sudo apt-get install yasm
3. Configure Environment variables
Command: $sudo gedit ~./BASHRC
Add the following two environment variables
Export android_sdk= SDK Path
Export android_ndk= NDK Path
Start compiling
1. Download the project to the local
git clone https://github.com/Bilibili/ijkplayer.git ijkplayer-android
CD ijkplayer-android
Git checkout-b latest k0.5.1
2. Perform initialization operations
./init-android.sh
3. Compiling ffmpeg
CD Android/contrib
./compile-ffmpeg.sh Clean
./compile-ffmpeg.sh All
4. Start compiling so
Cd..
./compile-ijk.sh All
Complete
If compiled correctly, it will be in ijkplayer-arm64, IJKPLAYER-ARMV5, ijkplayer-armv7a, ijkplayer-x86, ijkplayer-x86_64 of these items src/main/libs /corresponding name directory to generate libijkffmpeg.so, libijkplayer.so, libijksdl.so, respectively, the three so files
After the compilation is successful, import the directory Android/ijkplayer project into Android studio to run
Friendly Tips
Most of the problems that may arise are due to environmental variables, and it is recommended that you examine the environment variables carefully
Note: There are many problems with compiling in Windows environment, it is highly recommended to use Linux environment for compiling
Android about compilation Ijkplayer under so experience sharing