1.download latest ffmpeg from http://ffmpeg.org/download.html
git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg
2.create a config.sh file to compile the ffmpeg.
because of my project only refers to audio,I disabled all the options that refer to video.
the content of this file:
#!/usr/bin/env bash
NDK=$HOME/androidProj/android-ndk-r9/
SYSROOT=$NDK/platforms/android-18/arch-arm/
TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86
function build_one
{
./configure \
--prefix=$PREFIX \
--enable-shared --disable-static --extra-cflags=-g \
--disable-ffmpeg \
--disable-avdevice --disable-swscale \
--disable-avfilter --disable-decoders --disable-encoders \
--disable-hwaccels --disable-muxers --disable-demuxers \
--disable-parsers --disable-protocols --disable-bsfs \
--disable-devices --disable-filters --disable-yasm \
--enable-demuxer=aac --enable-demuxer=asf --enable-demuxer=latm \
--enable-demuxer=mov --enable-demuxer=mp3 --enable-demuxer=pcm_alaw \
--enable-demuxer=pcm_f32be --enable-demuxer=pcm_f32le --enable-demuxer=pcm_f64be \
--enable-demuxer=pcm_f64le --enable-demuxer=pcm_mulaw --enable-demuxer=pcm_s16be \
--enable-demuxer=pcm_s16le --enable-demuxer=pcm_s24be --enable-demuxer=pcm_s24le \
--enable-demuxer=pcm_s32be --enable-demuxer=pcm_s32le --enable-demuxer=pcm_s8 \
--enable-demuxer=pcm_u16be --enable-demuxer=pcm_u16le --enable-demuxer=pcm_u24be \
--enable-demuxer=pcm_u24le --enable-demuxer=pcm_u32be --enable-demuxer=pcm_u32le \
--enable-demuxer=pcm_u8 --enable-demuxer=wav --enable-demuxer=xwma \
--enable-demuxer=aiff \
--enable-parser=aac --enable-parser=aac_latm --enable-parser=mpegaudio \
--enable-protocol=file --enable-protocol=pipe \
--enable-bsf=aac_adtstoasc --enable-bsf=mp3_header_decompress --enable-bsf=noise \
--enable-decoder=aac --enable-decoder=aac_latm \
--enable-decoder=mp3 --enable-decoder=mp3adu --enable-decoder=mp3adufloat --enable-decoder=mp3float --enable-decoder=mp3on4 --enable-decoder=mp3on4float \
--enable-decoder=wmapro --enable-decoder=wmav1 --enable-decoder=wmav2 --enable-decoder=wmavoice \
--enable-decoder=pcm_alaw --enable-decoder=pcm_bluray --enable-decoder=pcm_dvd --enable-decoder=pcm_f32be --enable-decoder=pcm_f32le --enable-decoder=pcm_f64be --enable-decoder=pcm_f64le --enable-decoder=pcm_lxf --enable-decoder=pcm_mulaw --enable-decoder=pcm_s16be --enable-decoder=pcm_s16le --enable-decoder=pcm_s16le_planar --enable-decoder=pcm_s24be --enable-decoder=pcm_s24daud --enable-decoder=pcm_s24le --enable-decoder=pcm_s32be --enable-decoder=pcm_s32le --enable-decoder=pcm_s8 --enable-decoder=pcm_s8_planar --enable-decoder=pcm_u16be --enable-decoder=pcm_u16le --enable-decoder=pcm_u24be --enable-decoder=pcm_u24le --enable-decoder=pcm_u32be --enable-decoder=pcm_u32le --enable-decoder=pcm_u8 --enable-decoder=pcm_zork \
--enable-decoder=adpcm_ima_qt --enable-decoder=mace3 --enable-decoder=mace6 --enable-decoder=gsm --enable-decoder=qcelp \
--cross-prefix=$TOOLCHAIN/bin/arm-linux-androideabi- \
--target-os=linux \
--arch=arm \
--enable-cross-compile \
--sysroot=$SYSROOT \
--extra-cflags="-Os -fpic $ADDI_CFLAGS" \
--extra-ldflags="$ADDI_LDFLAGS" \
$ADDITIONAL_CONFIGURE_FLAG
make clean
make -j4
make install
}
PREFIX=/home/androidProj/tmp
ADDI_CFLAGS="-marm"
build_one
3.execute this file then the *.so files will be installed in your PREFIX folder.
4.you can get the the attached file if you dont want to compile it.
over.