# add these lines to your ~/.bash_profile or ~/.profile or ~/.zshrc (取决于你使用的终端工具) export ANDROID_SDK=<your sdk path> export ANDROID_NDK=<your ndk path> 【最好区别于你的开发环境变量配置】
armv5 armv7a arm64 x86 x86_64(指定编译哪个版本) all32(所有32位处理器版本,包含armv5 armv7a x86 all (所有通用版本,包含armv5 armv7a arm64 x86 x86_64) clean (清除之前编译的缓存) check (检测支持的版本)
cd config rm module.sh ln -s module-default.sh module.sh cd android/contrib # cd ios sh compile-ffmpeg.sh clean
if you prefer less codec/format for smaller binary size (include hevc function) 【hevc: HEVC是High Efficiency Video Coding的缩写,是一种新的视频压缩标准,用来以替代H.264/AVC编码标准,2013年1月26号,HEVC正式成为国际标准。】
cd config rm module.sh ln -s module-lite-hevc.sh module.sh cd android/contrib # cd ios sh compile-ffmpeg.sh clean
if you prefer less codec/format for smaller binnary size (by default)
cd config rm module.sh ln -s module-lite.sh module.sh cd android/contrib # cd ios sh compile-ffmpeg.sh clean
IJK_NDK_REL=$(grep -o '^Pkg\.Revision.*=[0-9]*.*'$ANDROID_NDK/source.properties 2>/dev/null | sed 's/[[:space:]]*//g' | cut -d "=" -f 2) echo"IJK_NDK_REL=$IJK_NDK_REL" case"$IJK_NDK_REL"in 11*|12*|13*|14*|15*|20*) iftest -d ${ANDROID_NDK}/toolchains/arm-linux-androideabi-4.9 then echo"NDKr$IJK_NDK_REL detected" else echo"You need the NDKr10e or later" exit 1 fi ;; *) echo"You need the NDKr10e or later" exit 1 ;;
WARNING: arm-linux-androideabi-pkg-config not found, library detection may fail.
-------------------- [*] compile ffmpeg -------------------- In file included from ./libavutil/internal.h:42:0, from ./libavutil/common.h:467, from ./libavutil/avutil.h:296, from ./libavutil/opt.h:31, from libavfilter/af_adelay.c:22: ./libavutil/timer.h:38:31: fatal error: linux/perf_event.h: No such file or directory # include <linux/perf_event.h> ^ compilation terminated. In file included from ./libavutil/internal.h:42:0, from ./libavutil/common.h:467, from ./libavutil/avutil.h:296, from libavfilter/avfilter.h:41, from libavfilter/audio.h:25, from libavfilter/af_acopy.c:19: ./libavutil/timer.h:38:31: fatal error: linux/perf_event.h: No such file or directory # include <linux/perf_event.h>