步骤什么的,参考了以下两篇,帮助很大:
1、http://my.oschina.net/wangqin/blog/80345
2、http://superonion.iteye.com/blog/1609777
遇到的几个问题:
1、android-ndk-r8d/build/core/build-binary.mk:41: *** target file `clean' has both : and :: entries. Stop
解决办法:因为在libavfilter目录中的Makefile的末尾处多了 Clean 这个玩意儿 将其注释掉或者删掉就可以了
2、parseutils.c文件多处报错
jni/ffmpeg/libavutil/parseutils.c:555:15: error: storage size of 'dt' isn't known
jni/ffmpeg/libavutil/parseutils.c:650:20: error: variable 'dt2' has initializer but incomplete type
jni/ffmpeg/libavutil/parseutils.c:650:38: error: invalid type argument of unary '*' (have 'int')
jni/ffmpeg/libavutil/parseutils.c:650:54: error: invalid type argument of unary '*' (have 'int')
jni/ffmpeg/libavutil/parseutils.c:650:23: error: storage size of 'dt2' isn't known
解决办法:打开 libavutil/parseutils.h,把 #include <time.h> 替换为 #include <sys/../time.h>
3、
/home/usr/android-ndk-r9c/platforms/android-19/arch-arm/usr/include/stdlib.h:54:14: error: expected ')' before numeric constant
搜到一种解决方案 :
添加了I,应该是stdlib的头文件没有找对导致的
解决方案二:
自做主张把stdlib.h 中的 extern char *getenv(const char *);改成extern char *_getenv(const char *);
变量名加个下划线,编译完再改回来。
总觉得不正统啊,会引起问题啊,不知道编译出来的库会不会哪里哪里的就冒出问题稀奇古怪的问题来。
但是问题解决了,编译通过了。。。
4、修改jni/ffmpeg/config.h下的
教程里说 #define restrict restrict 改为 #define restrict
这里该是#define av_restrict restrict 改为 #define av_restrict
5、libavutil/libm.h的static方法记得注释或者删除掉,不然会报错
6、error: libavcodec/codec_names.h: No such file or directory
解决办法:在ffmpeg目录下运行
cat libavcodec/avcodec.h | libavcodec/codec_names.sh config.h libavcodec/codec_names.h
7、multiple definition of `ff_inverse'
解决办法:修改libavcodec/Makefile,删掉:
OBJS-$(!CONFIG_SMALL) += inverse.o