Ubuntu12.04 compiling vlc-android detailed process

Source: Internet
Author: User

Wainiwann Source: http://www.cnblogs.com/wainiwann/This article copyright belongs to the author, welcome reprint, but without the author's consent must retain this paragraph statement, and in the article page obvious location to the original link, otherwise reserves the right to pursue legal responsibility.

absrtact: This article mainly introduces the process of compiling vlc-android under Ubuntu.

Recently studied the compilation of the next Vlc-android, a search on the internet is indeed a lot of information, but most of them are times (and do not deny that there is very detailed). Can't say that these are worthless, how much can also give the compilation VLC to bring some clues.

The compilation environment uses the latest source code for the 64-bit ubuntu12.04 source code vlc-android. The entire compilation process takes nearly a day, because the network reasons need to download a lot of things, the entire VLC source code to achieve the compile conditions when the total size of nearly 2 G.

There are also many other resources needed to download the compilation. Finally, the compilation is successful, the so library and the corresponding apk are generated, and the streaming media can be played on the phone.

Here is a detailed summary of the compilation vlc-android the entire process, in case of future needs, and let more people need it to take a few detours.

------------------------------------------------------------------------------------------I'm a golden-split------------------------- -------------------------------------------------------

Build a Build environment:

1. Download the configuration NDK environment:

The NDK used this time is " android-ndk-r9d-linux-x86_64.tar.bz2 "

: http://developer.android.com/tools/sdk/ndk/index.html#Installing (sometimes will not open)

For the NDK environment build can refer to the previous article ffmpeg2.2 compilation: Http://www.cnblogs.com/wainiwann/p/3785485.html

It contains the decoding directory, and the configuration of the NDK environment variable is written in very detailed.

2. Download the Configuration SDK environment:

The SDK environment is required for compiling and needs to be downloaded in the SDKs directory under the "Platform-tools" directory of the Adb.exe and other tools. So download the SDK need to be careful!

Download the SDK here is best not to download similar "Android-sdk_r20-linux.tar" or other version because these versions are not included in the "Platform-tools" file directory!!!

What I'm downloading here is the ADT version that contains eclipse is " adt-bundle-linux-x86_64-20131030.zip ".

: http://pan.baidu.com/share/link?shareid=2608460318&uk=2099951531

Then create a new "develop" directory in the Home directory (previously the NDK was also placed in this directory). Create a new directory "Android-sdk-linux" directory under the Develop directory (you can do this step by yourself).

Then extract the Adt-bundle-linux-x86_64-20131030.zip, the inside of the entire directory of the SDK files are fully copied to the previous develop directory under the Android-sdk-linux directory.

3. Download the configuration JDK environment:

If you simply want to compile the so library of VLC, the JDK can not be installed and configured. But if you want to compile a VLC apk then this step is no less!

The JDK used here is: " jdk-6u45-linux-x64.bin "

: http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javase6-419409.html

Click on Accept License agreement to select the JDK you want to download.

Here's a look at the installation of the JDK:

1) Copy the downloaded Jdk-6u45-linux-x64.bin to the/home directory and create a new directory named "JDK";

2) The terminal root account enters the JDK directory above to add permissions to Jdk-6u45-linux-x64.bin:

# chmod 777./jdk-6u45-linux-x64.bin

3) Execute the installation command:

#./jdk-6u45-linux-x64.bin

4. Configure the NDK, SDK, and JDK environment variables:

1) terminal root account command:

# gedit ~/.BASHRC

To pop up the edit page add the following lines at the end of the page (depending on your directory):

Export ndk=/home/song/develop/android-ndk-r9d
Export Android_sdk=/home/song/develop/android-sdk-linux
Export android_ndk=/home/song/develop/android-ndk-r9d
Export android_abi=armeabi-v7a
Export No_neon=1
Export java_home=/home/song/jdk/jdk1.6.0_45
Export classpath=.: $JAVA _home/lib: $JAVA _home/jre/lib
Export path= $PATH: $ANDROID _sdk/tools: $ANDROID _sdk/platform-tools: $JAVA _home/bin: $JAVA _home/jre/bin

2) then save to make it effective terminal command line:

# source ~/.BASHRC

3) Check that the environment variable is configured correctly:

The NDK can enter the Hello-jni of the NDK under the sample directory for $ndk/ndk-build command compilation. The JDK can be executed under the root command (non-root needs to be edited ~/.BASHRC): Java-version If the JDK-related

The version number is installed correctly.

Tools to download and install before compiling the two:

1. Download and install the Git tool:

# apt-get Install git

2. Download the Install Ant tool:

# apt-get Install Ant

Note: Download and install ant here will download the installation OpenJDK, but does not affect the compilation.

3. Download and install the tool:

# Apt-get Install wget

# Apt-get Install autoconf

# Apt-get Install Libtool

# Apt-get Install Subversion

Note: If some of the installation does not have to care.

4. Download and install something that requires 32-bit compilation:

If you do not need to compile the build apk you can do this.

# Apt-get Update
# Apt-get Install Ia32-libs

Three compiled vlc-android:

1) in the home directory, create a new directory here named "Vlc-code" directory. Then the root user Terminal command:

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

Here the download will be downloaded shortly after entering the directory, Terminal command:

# CD Android

2) perform the compile operation:

# sh./compile.sh

The following will be a lengthy download of the resources required for VLC compilation ....

3) errors may occur several times in the middle of the download:

Because some resource bundles may request a download time-out, and so on, a compilation failure occurs, you can view the failure information. So so

The failure message says that the resource bundle failed, as well as download the resource, you can change a network or a computer to copy the download failed resource bundle, manually to download.

Manually copy to this directory after download:/vlc-code/android/vlc/contrib/tarballs/directory.

Then re-perform the compile operation on the terminal:

# sh./compile.sh

Note: You may need to repeat steps 3 several times during the download process.

After the last resource pack is fully downloaded, you can view the/vlc-code/android/vlc/contrib/tarballs/directory with approximately 40 resource bundles as follows:

4) If the resource download ends and the final compilation appears

"BUILD sucessful"

Indicates that the compilation was successful, and if the prompt does not appear, you need to repeat the compilation operation:

# sh./compile.sh

Note: This command is always in the process of VLC compilation.

If there are other errors in the compilation, you can review the error message and find the answer online (if the above environment is set up, the download installation and so on are correct, you should be able to compile successfully).

5) after successful compilation:

After success will be in

See the compiled so library under the/vlc-code/android/vlc-android/libs/directory.

Will be in

/vlc-code/android/vlc-android/bin/directory to see the compiled APK file, which can be installed directly on the Android phone.

Four finally attach the compile succeeded:

---------------------------------------------------------------------------------------------------I'm a golden-split---------------- --------------------------------------------------------------------------------------------------------------

End: The compilation process must have enough patience and confidence!!!

Wainiwann Source: http://www.cnblogs.com/wainiwann/This article copyright belongs to the author, welcome reprint, but without the author's consent must retain this paragraph statement, and in the article page obvious location to the original link, otherwise reserves the right to pursue legal responsibility.

Summary: This article mainly describes the process of compiling vlc-android under Ubuntu.

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.