The previous piece of text talked about compiling in cygwin of windows. It was really a variety of pits. The soft link could not be recognized, the x86 and 86_64 so files could not be compiled, etc. I tossed for a few days and still did not perfect in cygwin. To compile ijkplayer, I used my colleague's ubuntu computer today. The mutation of ijkplayer-android is really fast and very fast.
Here are the official tips:
# install homebrew, git, yasm
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install git
brew install yasm
# Need to configure SDK and NDK path
# add these lines to your ~/.bash_profile or ~/.profile
# export ANDROID_SDK=<your sdk path
# export ANDROID_NDK=<your ndk path
# Software to be installed under Cygwin
# on Cygwin(unmaintained)
# install git, make, yasm
In ubuntu environment, enter home/xxx/
xxx represents your name. After entering the directory, press Ctrl+H to see the hidden files, and you can see:
. bashrc file, where you can configure environment variables similar to path under windows,
After opening, add your ANDROID_NDK and ANDROID_SDK paths. My configuration is as follows:
NDK=/home/hudong/platform-tools/android-ndk-r11b
export NDK
ADB=/home/hudong/Android/Sdk/platform-tools
export ADB
# Our ANDROID_NDK and ANDROID_SDK path
ANDROID_NDK=/home/hudong/platform-tools/android-ndk-r11b
export ANDROID_NDK
ANDROID_SDK=/home/hudong/android-sdk
export ANDROID_SDK
# Add to PATH
PATH=${PATH}:${NDK}:${ADB}:${ANDROID_NDK}:&{ANDROID_SDK}
Before compiling, we need to install some software. We don’t need to install make. Make needs to be installed under cygwin.
As for git, I think everyone has installed it. If it is not installed, enter the following commands to install git and yasm:
sudo apt-get update
sudo apt-get install git
sudo apt-get install yasm
# Pull the source code directly to the local
git clone https://github.com/Bilibili/ijkplayer.git ijkplayer-android
cd ijkplayer-android
# Check update code
git checkout -B latest k0.5.1
# Initialization, will pull the ffmpeg code to the local and so on
. /init-android.sh
cd android/contrib
. /compile-ffmpeg.sh clean
# Compile ffmpeg soft decoding library
. /compile-ffmpeg.sh all
cd ..
# Various versions of so files will be generated
. /compile-ijk.sh all
Executing ./compile-ffmpeg.sh all is to compile ffmpeg. It will take a little longer. As long as your configuration and software installation are correct, you can see:
It shows that ffmpeg has been compiled successfully, and the next step is to compile ijkplayer.
I don't need to explain this, it's the same as importing an ordinary project:
code address: https://github.com/Dawish/ijkplayer-demo
The directory after simplifying the code:
The above method to compile ijkplayer-android under ubuntu is all the content shared by the editor, I hope to give you a reference.
Recommended Posts