1:
Git clone git: // source.ffmpeg.org/ffmpeg.git ffmpeg
Git checkout 5e99df019a850e9ffa96d73e72b8a47a93a61de8
2:
Export ANDROID_NDK =/home/shilingkai/android_app_dev/android-ndk-r9
Export TOOLCHAIN =/tmp/ffmpeg
Export SYSROOT = $ TOOLCHAIN/sysroot/
$ ANDROID_NDK/build/tools/make-standalone-toolchain.sh -- platform = android-14 -- install-dir = $ TOOLCHAIN
3:
Export PATH = $ TOOLCHAIN/bin: $ PATH
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-allow-regmoves
-Wno-psabi-Wa, -- noexecstack
-D1_arm_arch_5 _-d1_arm_arch_5e __
-D1_arm_arch_5t _-d1_arm_arch_5te __
-DANDROID-DNDEBUG
EXTRA_CFLAGS =-march = armv7-a-mfpu = neon-mfloat-abi = softfp-mvectorize-with-neon-quad
EXTRA_LDFLAGS =-Wl, -- fix-cortex-a8
FFMPEG_FLAGS = -- prefix =/tmp/ffmpeg/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-filters
-- Disable-devices
-- Disable-everything
-- Enable-protocols
-- Enable-parsers
-- Enable-demuxers
-- Disable-demuxer = sbg
-- Enable-decoders
-- Enable-bsfs
-- 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 libffmpeg. so
Arm-linux-androideabi-strip -- strip-unneeded libffmpeg. so