Recently compiling ijkPlayer, I encountered some problems, here are some notes, the specific use needs baidu query.Copy the code
Environment to prepare
| my environment is VMware + ubuntu (20.04.2.0), install the virtual machine, install ubuntu.
-
Modify the Linux software source
Open the command line, enter the following commands, and follow the prompts. 1. Backup source file sudo cp/etc/apt/sources list/etc/apt/sources list. The back 2. Sudo gedit /etc/apt/sources.list In the editor that pops up, clear all the contents. Copy the following and paste it in. Source (ali) deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse 3. Save, then close the editor. Sudo apt-get update 5. You are advised to run sudo apt-get updateCopy the code
For details, see Modifying Linux Software Sources
-
Install the required software
- Install git
sudo apt-get install git
- Install yasm
sudo apt-get install yasm
- Install python
sudo apt-get install python
Python was installed to address compile-time reportingERROR: Failed to create toolchain
- Install file, libnCURES, and execute the following commands in turn
sudo apt install apt-file sudo apt-file update sudo apt-file find libncurses.so.5 sudo apt install libncurses5 Copy the code
Solve the problem when compiling FFMPEG
BFD: libncurses.so.5: cannot open shared object file: No such file or directory
The problem of
- Install git
-
The development environment
- You can download the Jdk directly from Oracle’s official website.
2. Modify the environment variable sudo gedit /etc/profile 3. At the end of the open file, #set oracle JDK environment export JAVA_HOME=/usr/lib/ JVM/jdK-14.0.1 # JRE_HOME=${JAVA_HOME}/jre export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib export PATH=${JAVA_HOME}/bin:$PATH 4. Source /etc/profile 5. JDK sudo update-alternatives --install /usr/bin/java /usr/lib/jvm/jdk-14.0.1/bin/ Java 300 Test whether Java -version ' 'was successfully installedCopy the code
-
Android Sdk download address
2. Update the SDK, run the following command (upgrade all) 'sudo tools/android update SDK --no-ui', if the prompt y/n, always enter y, press Enter. 3. Set the environment variable sudo gedit /etc/profile. At the end of the open file, Add the following content # android SDK (the path will be subject to their own) export ANDROID_SDK = / home/bingjiazheng ANDROID_SDK/android SDK - Linux export PATH=${PATH}:$ANDROID_SDK/tools:$ANDROID_SDK/platform-tools 5. Enable environment variables to take effect source /etc/profile 6. Adb version is tested successfully (if not, restart it again)Copy the code
-
Android NDK download address (r10E or R14B)
Sudo./android-ndk-r10e-linux-x86_64.bin If you do not have permission to operate the directory (a lock has been added), Enter 'sudo chown -r STG android-ndk-r10e' 2. Set the environment variable sudo gedit /etc/profile 3. #android NDK export ANDROID_NDK= Installation PATH /android-ndk-r10e/ export PATH=$PATH:$ANDROID_NDK 4. Enable environment variables to take effect source /etc/profile 5. Check whether the test is successful. (If the test does not take effect, restart the test again.Copy the code
- The network environment
- It is recommended to configure proxy in network environment to improve the speed of Clone ijkPlayer-Android and FFMPEG download.
- It is recommended to set git network proxy, ffmPEG, Openssl and other libraries sometimes clone error
Git config --global http.proxy http://127.0.0.1:1089 git config --global HTTPS http://127.0.0.1:1089 // Set the socks5 proxy git config --global http.proxy socks5://127.0.0.1:1080 git config --global Proxy git config --global --unset http.proxy git config --global --unset . The HTTPS proxy / / view the git set up git config - global - l check the environment variable env | grep -i proxyCopy the code
Ready to compile
1. Pull ijkplayer
1. The git pull ijkplayer ` git clone https://github.com/Bilibili/ijkplayer.git ijkplayer - android ` 2. Go to the directory 'CD ijkplayer-android' 3. Git checkout -b latest k0.8.8 '3 Sudo./init-android.sh '4. Run the following code to support HTTPS 'sudo./init-android-openssl.sh' 5. Clean and compile ffmpeg CD android/ contrib. /compile-ffmpeg.sh clean./compile-ffmpeg.sh all ' '6. Build ijkPlayer, add all to so library, add all to armV7A CD.. ./compile-ijk.sh all ```Copy the code
Compiling ijkPlayer for Ubuntu 2