Ubuntu 14 compilation video third-party library Ijkplayer, can be used under winows

Source: Internet
Author: User

1. Install the relevant environment first, specifically here Http://blog.163.com/[email protected]/blog/static/98334653201612310647799/According to the above installation, there will be a direct eclipse+sdk. SDK that only one version but not to upgrade, do not affect.
2. Download the NDK r10e:http://blog.csdn.net/ultrapro/article/details/according to the API requirements of this official Https://github.com/Bilibili/ijkplayer 46008805 according to your Ubuntu installation is how many bit to download, my is 64 bit, so download Android-ndk-r10e-linux-x86_64.bin 3. Install the NDK by command. 3.1 Download it and pull it right in Ubuntu.
3.2 Open the console, because directly in the root directory, so directly usechmod a+x Android-ndk-r10e-linux-x86_64.bin then right-click to view the path, type:/home/admins/android-ndk-r10e-linux-x86_64.bin He'll be able to see him in this directory when he's installed.4. Set the environment variable 4.1 directly in the root directory, alt+h, show hidden files, locate the. bashrc file. Add the following environment variables
  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/
The specific file name is based on the actual, because we already have the SDK before, so it needs to be configured. This is done after the configuration is complete:
Save it. 5. Then go into how to compile a third-party library Ijkplayer
5.1 Make sure that git and yasm are already installed on your machine, and if not, execute the following command at the terminal: sudo apt-get updatesudo apt-get install gitsudo apt-get Install Yasm
5.2 Make sure the android_sdk=xxx and android_ndk=xxx are correct in the configuration file (Note: the name of the declaration path variable must be named after Android_sdk and ANDROID_NDK, or the following compilation will be problematic, My paths are all declared in the. bashrc) 5.3 First from Bilibili on GitHub in the code base can be long a copy of the source git clone https://github.com/Bilibili/ijkplayer.git Ijkplayer-android (note: Need some time to download 5.4 cd ijkplayer-android (note: Navigate to this directory) 5.5 switching branches

Git checkout-b latest k0.4.5

5.6 Execute Command

./init-android.sh

Note: This problem may occur here:

Solution:

Open a. pull-repo-ref.sh file under/ijkplayer-android/tools:

Delete "--dissociate"

[CPP]View Plain Copyprint?
  1. Remote_repo=$1
  2. Local_workspace=$2
  3. Ref_repo=$3
  4. If [-Z $1-o-Z $2-o-Z $]; Then
  5. echo "Invalid call pull-repo.sh ' $"
  6. elif [!-d $LOCAL _workspace]; Then
  7. git clone--dissociate--reference $REF _repo $REMOTE _repo $LOCAL _workspace# Erase--dissociate
  8. Cd$local_workspace
  9. Git repack-a
  10. Else
  11. CD $LOCAL _workspace
  12. git fetch--all--tags
  13. CD-
  14. Fi
  15. #! /USR/BIN/ENV Bash

Then save the file and execute it again./init-android.sh then continue ...

Or upgrade git to the latest version, which will support the "dissociate" command


5.7 After the download is done, execute

cd android/contrib./compile-ffmpeg.sh clean./compile-ffmpeg.sh all  (注:all是编译所有cpu下支持的库,是可以选择的,这里我们还是选默认,如果你的ANDROID_SDK=xxx和ANDROID_NDK=xxx的路径没有问题话,就开始成功执行编译了。这是个漫长的等待过程)

The final appearance, congratulations can proceed to the next step.

Following the prompts, we go back to the Ijkplayer-android/android directory and execute the script

Cd..

./compile-ijk.sh All (note: If all is removed, only the so file of the ARMV7A schema will be compiled, otherwise it will be all)

Once all of the above commands have been successfully executed, you can now import Ijkplayer into Android studio in the/ijkplayer-android/android/directory.

We hereby update:

I am in other articles are to here is finished, in Ubuntu, according to the above compilation is ready to run, but helpless my computer too card, or accustomed to use under the winows as the students how to do not write at all, here I tried the next, The following method can be used to get the compiled project to Winows:

1. First we want to download the entire project directly under Winows: Https://github.com/Bilibili/ijkplayer

2. Import into as inside, this time you run to the player here will hang up, it doesn't matter.

3. Let's look at what is generated in the compiled support library.

Here we select one of the arm64, generating the Libs and obj two folders


Another important thing is that he will generate a new. mk File in Jni, this MK will be used


4. Open as we now this pit-daddy project, will be compiled in Ubuntu Libs, obj copied over, and the JNI under the Android.mk cover out the original

I chose arm-64, and the other support libraries are the same.


5. Then run it again, and you'll be able to play it all over again ~ ~ haha


The following articles are referenced:

http://www.jianshu.com/p/b447f6601501

http://blog.csdn.net/liuyuejinqiu/article/details/50728013

Https://github.com/Bilibili/ijkplayer

Finally: There is also a tutorial to modify it to eclipse available:

http://blog.csdn.net/fatiao101/article/details/49586379

Ubuntu 14 compilation video third-party library Ijkplayer, can be used under winows

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.