The VLC multimedia player (English: VLC media player, originally VideoLAN Client, is the VideoLAN program's open source multimedia player. Support a wide range of audio and video decoders and file formats, and support DVD CD-ROM, VCD and various types of streaming protocols, it is an open source and support a variety of platforms.
Official website: Https://wiki.videolan.org/AndroidCompile#Get_VLC_Source
Environment:
Host: Windows XP
Virtual machine: Virtualbox-4.3.12-93733-win.exe
Virtual machine system: ubuntu14.04
Environment Construction Requirements:
On a Linux system, I installed the Ubuntu14.04
Tools that need to be installed:
Apache-ant (or Ant), autoconf, Automake, Autopoint, CMake, gawk (or Nawk), GCC, g++, Libtool, Git,
M4, Patch, Pkg-config, Ragel, Subversion, unzip.
Tips:
1, if is to compile android-x86 device, should install Yasm
One, Android SDK
1. Create a directory named Android_tools
2. Download the latest SDK http://developer.android.com/sdk/index.html
3 on the official website. Unzip to the Android directory
4. Run: Tools/android (can also run: "tools/android update sdk-u-T Platform,platform-tool,extra")
5. In the tool directory, install "SDK Platform Android 4.3, API 18", follow the instructions
Note: VLC Engineering properties File Project.Properties target=android-18 must have been installed, otherwise it will report the problem three:
II, Android NDK
1. Make sure the SDK is installed successfully NDK to R9 version above, because in the compile.sh file is already configured, if the version is too low will prompt: You need the NDKV9 or later
2. Download NDK for Linux/HTTP/ Developer.android.com/intl/zh-cn/tools/sdk/ndk/index.html
3. Unzip to the Android_tools directory and make sure the SDK is in the same directory
Note When installing the SDK and NDK be sure to note whether the machine is 64 or 32 bits, download the corresponding version of the installation, otherwise there will be some inexplicable problems
SDK and NDK installation, are extracted under the current directory Android_tools
[email protected]:~/android_tools$ sudo tar-xvf/mnt/shared/ ANDROID-NDK-R9D-LINUX-X86.TAR.BZ2
[email protected]:~/android_tools$ sudo unzip/mnt/shared/ Adt-bundle-linux-x86-20140702.zip
Three, configuring environment variables
Environment Setup
Last added in ~/.BASHRCsudo gedit ~/.bashrc
Export ANDROID_SDK=/HOME/DZT/ANDROID_TOOLS/ADT-BUNDLE-LINUX-X86_64-20140321/SDK
Export android_ndk=/home/dzt/android_tools/android-ndk-r9d
Export path= $PATH: $ANDROID _sdk/platform-tools: $ANDROID _sdk/tools
Write according to the actual installation path
Setting environment variables is equivalent:
[Email protected]:~/android_tools$sudo source ~/.BASHRC
devices specifies the device on the command line, which is not configured in the file, and will need to be reset after each compilation and exit.
[email protected]:/home/dzt/android_vlc/android# export Android_abi=armeabi
[Email protected]:/home/dzt/android_vlc/android# export no_fpu=1
Iv. compiling
1.Get VLC Source
Run the following command under the previously created Android directory
git clone git://git.videolan.org/vlc-ports/android.git
2.Compile
Run: Sh compile.sh
[Email protected]:/home/dzt/android_vlc/android#SH compile.sh
For an ARMv6 device without FPU:
$ Export No_fpu=1
For an ARMV5 device:
$ Export No_armv6=1
If you plan to use a release build, run ' compile.sh release '
VLC source not found, cloning
Cloning to ' VLC ' ...
Remote:counting objects:426425, done.
Remote:compressing objects:100% (80869/80869), done.
Remote:total 426425 (Delta 343977), reused 425830 (Delta 343585)
In the Receiving object: 100% (426425/426425), 237.54 MiB | 201.00 kib/s, done.
Processing Delta: 100% (343977/343977), done.
Check the connection ... Complete.
Checking out files:100% (3413/3413), done.
Switch to a new branch ' Android '
Building Tools
I downloaded the r9d.
Need to update the compile.sh file if the NDK version is too low or too high will prompt: You need the NDKV9 or later
You need to modify the compile.sh file at this time
[Email protected]:/home/dzt/android_vlc/android#gedit compile.sh
# try to detect NDK version
rel=$ (grep-o ' ^r[0-9]*.* ' $ANDROID _ndk/release. TXT 2>/dev/null|cut-b2-)
Echo $REL//Print out version
Case ' $REL ' in
9|9*) #主要修改这一行
gccver=4.8
Cxxstl= "/" ${gccver}
;;
7|8| *)
echo "You need the NDKV9 or later"
Exit 1
;;
Esac
Downloads for related libraries: http://download.videolan.org/pub/contrib/might not get in, I used a VPN.
Depending on the library, these libraries will be downloaded during compilation, but may fail to download, it is necessary to manually download, copy to this directory.
[email protected]:~/android_vlc/android/vlc/contrib/tarballs$ lsa52dec-0.7.4.tar.gz libebml-1.3.0.tar.bz2 libvncserver-0.9.9.tar.gzffmpeg-2763179.tar.gz libgcrypt-1.6.1.tar.bz2 Libvorbis-1.3.4.tar.xzflac-1.3.0.tar.xz libgpg-error-1.13.tar.bz2 libxml2-2.9.1.tar.gzfreetype-2.5.3.tar.gz libgsm_1.0.13.tar.gz Live.2014.05.27.ta r.gzfribidi-0.19.6.tar.bz2 libiconv-1.14.tar.gz nettle-2.6.tar.gzgmp-6.0.0.tar.bz2 libmad-0.15.1b.tar.gz Openjpeg-1.5.0.tar.gzgnutls-3.1.25.tar.xz libmatroska-1.4.1.tar.bz2 opus-1.1.tar.gzjpegsrc.v9a.tar.gz Li bmodplug-0.8.8.5.tar.gz postproc-git.tar.gzlibass-0.11.2.tar.gz libmpeg2-0.5.1.tar.gz Speexdsp-git.tar.gzlibdvb psi-1.2.0.tar.bz2 libogg-1.3.2.tar.xz speex-git.tar.gzlibdvdcss-1.2.13.tar.bz2 libpng-1.6.12.tar.xz taglib -1.9.1.tar.gzlibdvdnav-git.tar.xz libssh2-1.4.3.tar.gz zlib-1.2.8.tar.gzlibdvdread-4.9.9.tar.bz2 libtheora-1.1 .1.tar.xz
Of the above libraries: Http://pan.baidu.com/s/1jGJukq6
Collation of issues encountered during the compilation process
Question one
= = = Configuring in Gettext-runtime (/home/dzt/android_vlc/android/vlc/contrib/ Contrib-android-arm-linux-androideabi/gettext/gettext-runtime)
Configure:running/bin/bash./configure--disable-option-checking '--prefix=/home/dzt/android_vlc/android/vlc/ Contrib/arm-linux-androideabi '--datarootdir=/home/dzt/android_vlc/android/vlc/contrib/arm-linux-androideabi/ Share '--includedir=/home/dzt/android_vlc/android/vlc/contrib/arm-linux-androideabi/include '--libdir=/home/ Dzt/android_vlc/android/vlc/contrib/arm-linux-androideabi/lib '--build=i686-linux-gnu '--host= Arm-linux-androideabi '--target=arm-linux-androideabi '--program-prefix= '--enable-static '--disable-shared '- -disable-dependency-tracking '--with-pic '--disable-java '--disable-native-java '--without-emacs ' build_alias= I686-linux-gnu ' Host_alias=arm-linux-androideabi ' Target_alias=arm-linux-androideabi ' CC= ARM-LINUX-ANDROIDEABI-GCC--sysroot=/home/dzt/android_vlc/android/android-ndk-r9d/platforms/android-9/arch-arm ' ' Cflags=-g-mfpu=vfpv3-d16-mcpu=cortex-a8-mthumb-mfloat-abi=softfp-o2-i/home/dzt/android_vlc/android/ android-ndk-r9d/sources/cxx-stl/gnu-libstdc++/4.8/include-i/home/dzt/android_vlc/android/android-ndk-r9d/sources/cxx-stl/gnu-libstdc++/4.8/ Libs/armeabi-v7a/include-i/home/dzt/android_vlc/android/vlc/contrib/arm-linux-androideabi/include-g ' LDFLAGS=- L/home/dzt/android_vlc/android/vlc/contrib/arm-linux-androideabi/lib ' cppflags=-g-mfpu=vfpv3-d16-mcpu= cortex-a8-mthumb-mfloat-abi=softfp-o2-i/home/dzt/android_vlc/android/android-ndk-r9d/sources/cxx-stl/ gnu-libstdc++/4.8/include-i/home/dzt/android_vlc/android/android-ndk-r9d/sources/cxx-stl/gnu-libstdc++/4.8/ Libs/armeabi-v7a/include-i/home/dzt/android_vlc/android/vlc/contrib/arm-linux-androideabi/include ' CXX= arm-linux-androideabi-g++--sysroot=/home/dzt/android_vlc/android/android-ndk-r9d/platforms/android-9/arch-arm ' ' Cxxflags=-g-mfpu=vfpv3-d16-mcpu=cortex-a8-mthumb-mfloat-abi=softfp-o2-i/home/dzt/android_vlc/android/ android-ndk-r9d/sources/cxx-stl/gnu-libstdc++/4.8/include-i/home/dzt/android_vlc/android/android-ndk-r9d/ Sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi-v7a/include-i/home/dzt/android_vlc/android/vlc/contrib/arm-linux-androideabi/include-g '-- Cache-file=/dev/null--srcdir=.
Checking for a bsd-compatible install .../usr/bin/install-c
Checking whether build environment is sane ... yes
Checking for Arm-linux-androideabi-strip ... Arm-linux-androideabi-strip
Checking for a thread-safe mkdir-p .../bin/mkdir-p
Checking for gawk ... no
Checking for Mawk ... Mawk
Checking whether make sets $ (make) ... yes
Checking whether make supports nested variables ... yes
Checking for ARM-LINUX-ANDROIDEABI-GCC ... arm-linux-androideabi-gcc--sysroot=/home/dzt/android_vlc/android/ Android-ndk-r9d/platforms/android-9/arch-arm
checking whether the C compiler works ... no
Configure:error:in '/home/dzt/android_vlc/android/vlc/contrib/contrib-android-arm-linux-androideabi/gettext/ Gettext-runtime ':
Configure:error:c compiler cannot create executables
See ' Config.log ' for more details
Configure:error:./configure failed for Gettext-runtime
Make: * * * [. gettext] Error 77
FIX:
Because of the 32 bits of my machine, I used 64-bit software, and replaced the SDK and NDK with 32-bit without this problem.
Question two:
Checking whether byte ordering is Bigendian ... no
Checking for pthread_create in-lpthread ... no
Configure:error:pthread needed
Make: * * * [. Dvdnav] Error 1
Fix:
I downloaded the above steps again without reporting the error.
I was before.
First step git clone git://git.videolan.org/vlc-ports/android.git
After doing the next thing, so only reported this problem, I deleted all after the above steps to perform quite smoothly.
question three:
-set-mode-check:
-set-debug-files:
-check-env:
[Checkenv] Android SDK Tools Revision 23.0.2
[Checkenv] Installed AT/HOME/DZT/ANDROID_TOOLS/ADT-BUNDLE-LINUX-X86-20140702/SDK
-setup:
[Echo] Project NAME:VLC
[GetType] Project type:application
-set-debug-mode:
-debug-obfuscation-check:
-pre-build:
-build-setup:
[Getbuildtools] Using Latest Build tools:20.0.0
[Echo] Resolving Build Target for VLC ...
BUILD FAILED
/home/dzt/android_tools/adt-bundle-linux-x86-20140702/sdk/tools/ant/build.xml:542:unable to resolve project Target ' android-19 '
Total Time:6 seconds
Make: * * [vlc-android/bin/vlc-debug.apk] Error 1
RM android-libs/libmedia.c ANDROID-LIBS/LIBUTILS.C android-libs/libstagefright.c android-libs/libbinder.c
[Email protected]:/home/dzt/android_vlc/android#
Fix:
Cause of error
BUILD FAILED
/home/dzt/android_tools/adt-bundle-linux-x86-20140702/sdk/tools/ant/build.xml:542:unable to resolve project Target ' android-19 '
Because I don't have the SDK for "android-19" installed,
There are two ways to solve this problem
1. Modify the project properties file Vlc-android/project.properties file
# This file was automatically generated by Android Tools.
# Do not modify the This file--YOUR changes'll be erased!
#
# This file must is checked in Version Control Systems.
#
# to customize properties used by the Ant build system use,
# "Ant.properties", and override values to adapt the script to your
# project structure.
# Project Target.
target=android-18
android.library.reference.1=. /java-libs/appcompat
Android.library.reference.2=. /java-libs/slidingmenu
android.library.reference.3=. /java-libs/wheelview
2, install the "android-19" SDK, run the following command
[Email protected]:/home/dzt/android_tools/adt-bundle-linux-x86-20140702/sdk# tools/android
The following screen appears, download the SDK you need, but not all can download, because recently even Google can not connect, you know
Summarize:
In the process of compiling encountered many problems, there are problems can first Baidu, to see if others have encountered a similar situation, the general can find the answer on the Internet, the need for concrete analysis of specific problems, if you do not find the next step of their own implementation of the official network is consistent;
There is no way to follow the steps to try a few times may be OK.
VLC for Android Ubuntu14.04 build environment