ubuntu14.04 编辑 ffmpeg2.2.3 问题集合以及解决方法

96 篇文章 0 订阅
80 篇文章 1 订阅

遇到的几个问题:

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>



android-ndk-r8d/build/core/build-binary.mk:41: *** target file 


`clean' has both : and :: entries.  Stop.
 
 
我也遇到了相同的问题,不过经过一步步排查,是因为在libavfilter目录中的Makefile的末尾处多了 Clean 这个玩意儿 将其注释掉或者删掉就可以了
 
 
恢复改方法
/libavutil/libm.h:183:40: error: static declaration of 'truncf' follows non-static declaration
 
libm.h的static方法删除掉
 
/*#define av_restrict restrict*/
#define restrict
 
 
 file included from jni/ffmpeg/libavcodec/aacdec.c:82:0:
jni/ffmpeg/libavcodec/../libavutil/float_dsp.h:150:50: error: expected ';', ',' or ')' before 'v1'
jni/ffmpeg/libavcodec/aacdec.c: In function 'apply_mid_side_stereo':
jni/ffmpeg/libavcodec/aacdec.c:1746:29: error: 'AVFloatDSPContext' has no member named 'butterflies_float'
make: *** [obj/local/armeabi/objs/avcodec/aacdec.o] Error 1
 
 
c、修改jni/ffmpeg/config.h下的 
#define avrestrict restrict为#define restrict

这个应该改为 #define av_restrict
 
 
stdlib 的错误
 /home/usr/android-ndk-r9/platforms/android-18/arch-arm/usr/include/stdlib.h:54:14: error: expected identifier or '(' before 'void'
/home/usr/android-ndk-r9/platforms/android-18/arch-arm/usr/include/stdlib.h:54:14: error: expected ')' before numeric constant
 
--extra-cflags="-I${NDK_ROOT}/platforms/${PLATFORM}/arch-arm/usr/include -fPIC -DANDROID -std=c99" \
添加了I,应该是stdlib的头文件没有找对导致的
 
 
 


jni/ffmpeg/libavutil/parseutils.c:541:15: error: storage size of 'dt' isn't known
jni/ffmpeg/libavutil/parseutils.c:634:20: error: variable 'dt2' has initializer but incomplete type
jni/ffmpeg/libavutil/parseutils.c:634:38: error: invalid type argument of unary '*' (have 'int')
jni/ffmpeg/libavutil/parseutils.c:634:54: error: invalid type argument of unary '*' (have 'int')
jni/ffmpeg/libavutil/parseutils.c:634:23: error: storage size of 'dt2' isn't known

这个问题的解决方法是:打开 libavutil/parseutils.h,把 #include <time.h> 替换为 #include <sys/../time.h>
 
 
undefined reference to 'inflateReset'
在libAvcodec的mk文件里做修改、
参考
http://blog.sina.com.cn/s/blog_5c4dd3330100mpdx.html
 
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
include $(LOCAL_PATH)/../av.mk
LOCAL_SRC_FILES := $(FFFILES)
LOCAL_C_INCLUDES :=        \
    $(LOCAL_PATH)        \
    $(LOCAL_PATH)/..
LOCAL_CFLAGS += $(FFCFLAGS)
LOCAL_LDLIBS := -lz
LOCAL_STATIC_LIBRARIES := $(FFLIBS)

LOCAL_MODULE := $(FFNAME)
include $(BUILD_STATIC_LIBRARY)
 
/home/wjh/fox/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: error: /home/wjh/fox/android-ndk-r9c/samples/player/obj/local/armeabi/libavcodec.a(log2_tab.o): multiple definition of 'ff_log2_tab'
/home/wjh/fox/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /home/wjh/fox/android-ndk-r9c/samples/player/obj/local/armeabi/libavformat.a(log2_tab.o): previous definition here
/home/wjh/fox/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: error: /home/wjh/fox/android-ndk-r9c/samples/player/obj/local/armeabi/libavutil.a(log2_tab.o):  multiple definition of 'ff_log2_tab'
/home/wjh/fox/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /home/wjh/fox/android-ndk-r9c/samples/player/obj/local/armeabi/libavformat.a(log2_tab.o): previous definition here
 
去掉libavforma里Android.mk里的zlib
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
include $(LOCAL_PATH)/../av.mk
LOCAL_SRC_FILES := $(FFFILES)
LOCAL_C_INCLUDES :=        \
    $(LOCAL_PATH)        \
    $(LOCAL_PATH)/..
LOCAL_CFLAGS += $(FFCFLAGS)
LOCAL_CFLAGS += -include "string.h" -Dipv6mr_interface=ipv6mr_ifindex
#LOCAL_LDLIBS := -lz
#LOCAL_STATIC_LIBRARIES := $(FFLIBS)

LOCAL_MODULE := $(FFNAME)
include $(BUILD_STATIC_LIBRARY)
 
 
libavformat/libavformat.a(log2_tab.o):(.rodata+0x0): multiple definition of `ff_log2_tab'
libavcodec/libavcodec.a(log2_tab.o):(.rodata+0x0): first defined here
libavutil/libavutil.a(log2_tab.o):(.rodata+0x0): multiple definition of `ff_log2_tab'
libavcodec/libavcodec.a(log2_tab.o):(.rodata+0x0): first defined here
移植ffmpeg的时候如果遇到这样的情况,在两个文件的Makefile中删掉一个log2_tab.o文件就可以了
 
 
打开libavformat的Makefile文件
 
       lfg.o                                                            \
       lls1.o                                                           \
       lls2.o                                                           \
       log.o                                                            \
#      log2_tab.o                                                       \
       mathematics.o                                                    \
       md5.o                                                            \
       mem.o                                                            \                                                   \
 
删除文件,如果是多行,就不要用注释了,直接删除掉
 
 
修改libavcodec的Makefile
OBJS-$(CONFIG_RDFT)                    += rdft.o $(RDFT-OBJS-yes)
OBJS-$(CONFIG_SHARED)                  += log2_tab.o
OBJS-$(CONFIG_SINEWIN)                 += sinewin.o
 
------------------------------------------
 
-------------------------------------------

3、

/home/usr/android-ndk-r9c/platforms/android-19/arch-arm/usr/include/stdlib.h:54:14: error: expected identifier or '(' before 'void'
/home/usr/android-ndk-r9c/platforms/android-19/arch-arm/usr/include/stdlib.h:54:14: error: expected ')' before numeric constant


搜到一种解决方案 :

--extra-cflags="-I${PLATFORM}/arch-arm/usr/include -fPIC -DANDROID -std=c99"

添加了I,应该是stdlib的头文件没有找对导致的

经实验,未成功

解决方案二:
自做主张把stdlib.h 中的 extern char *getenv(const char *);改成extern char *_getenv(const char *); 
变量名加个下划线,编译完再改回来。
总觉得不正统啊,会引起问题啊,不知道编译出来的库会不会哪里哪里的就冒出问题稀奇古怪的问题来。
但是问题解决了,编译通过了。。。

4、修改jni/ffmpeg/config.h下的
教程里说 #define restrict restrict 改为 #define restrict

restrict

5、libm.h的static方法记得注释或者删除掉,不然会报错



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值