|
本帖最后由 ffmpeg_video 于 2013-11-4 18:56 编辑
我的编译过程如下:
1. 下载libx264
git clone git://git.videolan.org/x264.git
./configure --enable-shared --enable-static
make
make install
2.下载ffmpeg源码
git clone git://source.ffmpeg.org/ffmpeg.git
编写了一个 shell.sh 脚本
如果一开始执行shell.sh的话会报错: 找不到 config.mak 等一系列的.mak文件
所以
./configure
make
make install
然后再执行
./shell.sh
这里报错,找不到libx264
shell.sh如下:
export ANDROID_NDK=/home/cjc/android_/android-ndk-r9
export TOOLCHAIN=/tmp/ffmpeg2
export SYSROOT=$TOOLCHAIN/sysroot/
$ANDROID_NDK/build/tools/make-standalone-toolchain.sh --platform=android-14 --install-dir=$TOOLCHAIN
export PATH=$TOOLCHAIN/binPATH
export CC=arm-linux-androideabi-gcc
export LD=arm-linux-androideabi-ld
export AR=arm-linux-androideabi-ar
CFLAGS="-O3 -Wall -mthumb -pipe -fpic -fasm \
-finline-limit=300 -ffast-math \
-fstrict-aliasing -Werror=strict-aliasing \
-fmodulo-sched -fmodulo-sched-allow-regmoves \
-Wno-psabi -Wa,--noexecstack \
-D__ARM_ARCH_5__ -D__ARM_ARCH_5E__ \
-D__ARM_ARCH_5T__ -D__ARM_ARCH_5TE__ \
-DANDROID -DNDEBUG"
EXTRA_CFLAGS="-march=armv7-a -mfpu=neon -mfloat-abi=softfp -mvectorize-with-neon-quad -I/usr/local/include"
EXTRA_LDFLAGS="-Wl,--fix-cortex-a8 -L/usr/local/lib"
FFMPEG_FLAGS="--prefix=/home/cjc/android_/tmp/ffmpeg2/build \
--target-os=linux \
--arch=arm \
--enable-cross-compile \
--cross-prefix=arm-linux-androideabi- \
--enable-shared \
--disable-symver \
--disable-doc \
--disable-ffplay \
--disable-ffmpeg \
--disable-ffprobe \
--disable-ffserver \
--disable-avdevice \
--disable-avfilter \
--disable-encoders \
--disable-muxers \
--disable-bsfs \
--disable-filters \
--disable-devices \
--disable-everything \
--enable-protocols \
--enable-parsers \
--enable-demuxers \
--disable-demuxer=sbg \
--enable-decoders \
--enable-encoders \
--enable-gpl \
--enable-libx264 \
--enable-network \
--enable-swscale \
--enable-asm \
--enable-version3"
./configure $FFMPEG_FLAGS --extra-cflags="$CFLAGS $EXTRA_CFLAGS" --extra-ldflags="$EXTRA_LDFLAGS"
make clean
make -j4
make install
rm libavcodec/inverse.o
$CC -lm -lz -shared --sysroot=$SYSROOT -Wl,--no-undefined -Wl,-z,noexecstack $EXTRA_LDFLAGS libavutil/*.o libavutil/arm/*.o libavcodec/*.o libavcodec/arm/*.o libavformat/*.o libswresample/*.o libswscale/*.o -o $PREFIX/libffmpeg.so
请高手指点一下,谢谢.......
|
|