本文主要是介绍Android下编译libx264库,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
Android NDK:https://download.csdn.net/download/tong5956/10678081
x264:git clone http://git.videolan.org/git/x264.git
编译脚本:
#!/bin/bash
NDK=/home/vbird/workspace/android-ndk-r14b
PLATFORM=$NDK/platforms/android-18/arch-arm/
TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64
ARM_INC=$PLATFORM/usr/include/
ARM_LIB=$PLATFORM/usr/lib/
PREFIX=/home/vbird/workspace/x264_android/x264/build_android
function build_one {./configure --prefix=$PREFIX --enable-pic --enable-static --enable-shared --disable-lavf --disable-asm --host=arm-linux --cross-prefix=$TOOLCHAIN/bin/arm-linux-androideabi- --sysroot=$PLATFORM --extra-cflags="-fPIC -marm -DX264_VERSION -DANDROID -DHAVE_PTHREAD -DNDEBUG -static -D__ARM_ARCH_7__ -D__ARM_ARCH_7A__ -O3 -march=armv7-a -mfpu=neon -mtune=generic-armv7-a -mfloat-abi=softfp -ftree-vectorize -mvectorize-with-neon-quad -ffast-math"
make clean
make -j4
make install
}
build_one
参考文章:https://blog.csdn.net/weixin_42277689/article/details/82560606
这篇关于Android下编译libx264库的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!