Linux under compilation ANDROID-VLC open source player detailed (with source download)

Source: Internet
Author: User

These two days need to do audio and video playback related things, so re-find the current Android under the decoding library. Android's own decoding library is not fully supported, so many third-party players are self-powered decoders, most of them using ffmpeg as a decoding library. I had a video player for 11 years, and I did it based on FFmpeg. At that time, there is not much information about the Android video decoding library on the internet, just find a person in git to transplant ffmpeg, get it down to compile, interested can look at the article: Android video player Faplayer compiled.

Back to the present, the protagonist is the famous VLC, has done video player, should have heard its name, basically all platforms have its figure. The beta version is also released this year on Android. This compilation is not very smooth, mainly because I read some other people on the net before compiling the compilation process. Then choose one to follow it to compile. Finally in a place to toss for a long time. The reason: The article was last year, and now the VLC project has been re-updated and the compilation method is simplified. Of course, most of the compilation process is consistent. Finally looked for a half-day, found the VLC official website compiling instructions,

In the end, it was re-compiled at the official time. The description of VLC here does not say, interested can go to the official website to understand.

Official Compilation Instructions : click here

1, the following is the environment I compiled:

    • Host system : WINDOW7 64-bit flagship edition
    • virtual machines : Vmware Workstation 7.1.2
    • Linux version : Ubuntu 10.10
    • androidsdk: adt-bundle-linux-x86-20130522
    • JDK: Jdk-7u25-linux-i586.tar
    • NDK: Android-ndk-r8e-linux-x86.tar

Release Notes: SDK, JDK, NDK I am currently using the latest version, are all on the official website to download. But Linux is the older version, because this system I spent more than two years, has not upgraded to 12.04. This finally led me to compile the time I encountered some because some software department version is low, resulting in a compile interrupt. So if you haven't installed a Linux system, it's recommended that you install the 12.04 stable version directly. ANDROIDSDK is Google's integration pack, which contains Eclipse and ADT as well as the 4.2 SDK. We recommend that you download this integration pack if you do not have the environment configured. Before configuring the JDK, SDK, NDK, install some of the third-party packages required for LVC compilation.

2, please ensure that your machine has installed the following software (preferably install the latest version of the software)

    • Apt-get Install GCC
    • Apt-get Install g++
    • Apt-get BUILD-DEP VLC
    • Apt-get Install git
    • Apt-get Install wget
    • Apt-get Install autoconf
    • Apt-get Install Libtool
    • Apt-get Install Subversion
    • Apt-get Install CMake
    • Apt-get Install Ant

This is the software that must be installed, and it is best to install the latest version of the software, I compile, because Ant used the older version, resulting in the creation of the APK, the time of the failure, ant must be more than 1.8 version of the line.

3. JDK Installation Configuration

Download JDK from Oracle website: click here

I use the latest jdk7,32 bit or 64-bit according to your system to choose, I choose here is 32 bit

Download the compressed package and put it into a directory, I put it in the/home/mythou/android-dev/directory, the following SDK, NDK I will also put in this directory. After decompression, need to configure environment variables, online also a lot of tutorials, I simply say:

Terminal input: sudo gedit/etc/profile

Add the environment variable, the path is the path to the JDK you unzipped, and here is the path I actually configured. Easy to use in the terminal, join path path inside.

Export java_home=/home/mythou/android-dev/jdk/jdk1.7.0_25
Export JRE_HOME=/HOME/MYTHOU/ANDROID-DEV/JDK/JDK1.7.0_25/JRE
Export classpath=.: $CLASSPATH: $JAVA _home/lib: $JAVA _home/jre/lib
Export path= $JAVA _home/bin: $JAVA _home/jre/bin: $PATH: $HOME/bin: $ANT _home

Modifying the Environment configuration

Terminal input: sudo gedit/etc/environment

Path= "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" Export JAVA_HOME=/home/mythou/ Android-dev/jdk/jdk1.7.0_25export Jre_home=/home/mythou/android-dev/jdk/jdk1.7.0_25/jreexport CLASSPATH=.:$ CLASSPATH: $JAVA _home/lib: $JAVA _home/jre/lib

4. Configuring the Android SDK

1. Download SDK Integration Development package from Google Android website: click here

I chose Linux 32-bit here, it is recommended to download the ADT Bundle Integration Development Package, if you download the SDK only, you have to download the configuration Eclipse and ADT, more complex. After the download is also extracted to the destination folder, I am here:/home/mythou/android-dev/adt-bundle-linux-x86-20130522 directory.

Also need to configure environment variables

Terminal input: sudo gedit/etc/profile adds the following configuration.

Export android_sdk=/home/mythou/android-dev/adt-bundle-linux-x86-20130522/sdkpath= $PATH: $ANDROID _sdk/tools:$ Android_sdk/platform-tools

5. Configuring the NDK

Download DNK from Google website: click here

Similarly, I download the 32bit version of Linux here.

After downloading, the same unzip to the target folder, I here is:/home/mythou/android-dev/

After decompression, the terminal input: sudo gedit/etc/profile added below configuration.

Export android_ndk=/home/mythou/android-dev/android-ndk-r8epath= $PATH: $NDKR 6 B: $ANDROID _NDK

Here, the JDK, NDK, SDK are configured, you can open the adt-bundle-linux-x86-20130522 directory of the Eclipse software, if you can open the description of the basic configuration of the environment.

You can also make a direct application test. or a terminal check version, such as checking the JDK version:

6. Other environment variable configuration

In addition to the above several, there are some environment variables need to be configured, of course you can choose directly in the terminal configuration, do not write configuration files, see personal likes. Because I often need to repeat the compilation,

So writing in the configuration file is more convenient.

adding Ant variables

Export ant_home=/home/mythou/android-dev/apache-ant-1.8.0

It is necessary to note that my ant is re-downloading the source package installation, because the system default installation version is too low. This is the question that will be mentioned later.

You need to configure the CPU type, the type of CPU supported by Android includes Arm and X86, so you need to specify the CPU type before compiling.

    • of the X86 series
Export Android_abi=x86
    • ARM's CORTEX-A8 or CORTEX-A9 series
Export android_abi=armeabi-v7a
    • ARMv6
Export Android_abi=armeabi
    • ARMv6 without FPU
Export Android_abi=armeabiexport no_fpu=1
    • ARMV5 or simulator
Export Android_abi=armeabiexport no_armv6=1
    • MIPS Series
Export Android_abi=mips

Above you can enter the environment variables directly or in profile settings. The above configuration, I compiled the time, chose android_abi=armeabi-v7a because I test the machine is the arm A9 series. Here, the environment configuration is complete. If you are modifying etc/profile you need to log off the restart, or the terminal update User Configuration source/etc/profile will take effect.

Here is the last style I configured for profile

Export Android_ndk=/home/mythou/android-dev/android-ndk-r8eexport Ndkr5c=/home/mythou/ndkr5cexport NDKR6B=/home/ Mythou/ndkr6bpath= $PATH: $NDKR 6 B: $ANDROID _ndkexport android_abi=armeabi-v7aexport java_home=/home/mythou/ Android-dev/jdk/jdk1.7.0_25export Jre_home=/home/mythou/android-dev/jdk/jdk1.7.0_25/jreexport CLASSPATH=.:$ CLASSPATH: $JAVA _home/lib: $JAVA _home/jre/libexport ant_home=/home/mythou/android-dev/apache-ant-1.8.0export PATH= $JAVA _home/bin: $JAVA _home/jre/bin: $PATH: $HOME/bin: $ANT _homeexport android_sdk=/home/mythou/android-dev/ Adt-bundle-linux-x86-20130522/sdkpath= $PATH: $ANDROID _sdk/tools: $ANDROID _sdk/platform-tools

7, access to the source code:

Get source code from git:

git clone git://git.videolan.org/vlc-ports/android.git

After getting it, it will create the Android directory in your current directory, which contains the following files

At this time actually did not download VLC source code, this is the directory structure of VLC and compiled configuration.

Perform:

SH compile.sh

The default is to compile the debug version, if you need to compile release version, you need to perform

SH compile.sh Release

The first compilation compiles the debug version first.

This is the time to start downloading VLC source code. There are probably 200M of source code.

It will then be automatically compiled until the VLC apk file is generated.

8, the compilation process encountered problems

Although it is automatically compiled, but there are some problems in the middle, the following is my compilation process encountered problems.

(1) The problem of checkout

This looks like a case mismatch. can be modified Complie or re-execute SH compile.sh can be resolved.

(2) LIBMPEG2 Library cannot download

One thing to note is that during the compilation process, many third-party libraries need to be downloaded, which makes the entire compilation process lengthy. Of course this is related to your network situation.

Since unable to download the library, can only manually download one of their own, Baidu find a LIBMPEG2 library to download down, put in the designated folder.

Copy the downloaded LIBMPEG2 library to the following path:

(3) Config.sub file too old problem

10.10 version of Ubuntu, there is a problem with system files too old

Download these two files to replace: Config.guess and config.sub, copy the two files to /usr/share/misc to cover, re- line compile the command.

(4) GetText version too low

This is what I said above. Getext requires version 0.18. Manually find a version 0.18, and then compile the installation.

Once this is resolved, the decoding library can be successfully compiled:

I am compiling the armeabi-v7a version here and will automatically copy the decoding library to the Libs folder under the LVC Android project.

Then there was a problem when compiling the package apk:

The ant version is too low and requires ant1.8 or later. Old method, you find the corresponding version of the compiled installation.

Finally, you can successfully compile the VLC APK installation package:

Because it is the debug version, comes out is the vlc-debug.apk file.

Even if the project is successfully compiled, you can also migrate Java projects to eclipse and use the modifications. (Vlc-android directory below is the corresponding Android application engineering)

If it's a transplant, you should also transplant the 3 projects associated with the Java-libs folder below. Project Associations under Eclipse:

Let's run the following two:

Below is the project that can be used under Eclipse, I only compile under 4.2SDK, the others do not try.

The whole containing decoding library of the compilation project is too large, there are 1.6G, I will not put up, interested in compiling themselves. Just give the project that can be compiled under Eclipse, and make it easy to change the interface.

However, it is recommended that you compile it yourself, because now VLC is only beta version, behind the official version, but also need to recompile the decoding library.

VLC is available under Eclipse Engineering Source:

(VLC official has been updated several times, and in the beta version, so no longer provide the old version of the download, the need for friends please compile themselves)

A friend who has problems can take note of:

Edited by Mythou

Original blog, reproduced please indicate the source: http://www.cnblogs.com/mythou/p/3162595.html

Linux under compilation ANDROID-VLC open source player detailed (with source download)

Related Article

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.