Android NDK w / ffmpeg库 - 错误运行项目

时间:2014-10-08 00:03:30

标签: android android-ndk ffmpeg

使用本指南http://www.roman10.net/how-to-build-ffmpeg-with-ndk-r9/,我成功使用Android NDK 10编译了ffmpeg-2.4.2,但现在我在我的eclipse项目中使用它时遇到了问题。

我得到的错误:

*** Android NDK: Aborting    .  Stop.

在prebuilt-library.mk中指向了这个:

ifndef prebuilt
$(call __ndk_info,ERROR:$(LOCAL_MAKEFILE):$(LOCAL_MODULE): LOCAL_SRC_FILES points to a missing file)
$(call __ndk_info,Check that $(prebuilt_path) exists, or that its path is correct)
$(call __ndk_error,Aborting) <----- ***** This line is specifically pointed out by the error log
endif

这是我的...... jni / Android.mk:

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE    := VideoTest
LOCAL_SRC_FILES := videotest.c
LOCAL_LDLIBS := -llog -ljnigraphics -lz -landroid
LOCAL_SHARED_LIBRARIES := libavformat libavcodec libswscale libavutil

include $(BUILD_SHARED_LIBRARY)
$(call import-module,ffmpeg-2.4.2/android/arm)

这是我的android-ndk / sources / ffmpeg-2.4.2 / android / arm / Android.mk:

LOCAL_PATH:= $(call my-dir)


include $(CLEAR_VARS)
LOCAL_MODULE:= libavcodec
LOCAL_SRC_FILES:= lib/libavcodec-55.so
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE:= libavformat
LOCAL_SRC_FILES:= lib/libavformat-55.so
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE:= libswscale
LOCAL_SRC_FILES:= lib/libswscale-2.so
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE:= libavutil
LOCAL_SRC_FILES:= lib/libavutil-52.so
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE:= libavfilter
LOCAL_SRC_FILES:= lib/libavfilter-3.so
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE:= libwsresample
LOCAL_SRC_FILES:= lib/libswresample-0.so
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
include $(PREBUILT_SHARED_LIBRARY)

这是我的项目结构:

http://imgur.com/2vMryOS

所以在我看来,该项目并没有建立,因为LOCAL_SRC_FILES并没有指向任何东西,但是它指的是jni / Android.mk中的LOCAL_SRC_FILES或... ffmpeg-中的那个2.4.2 /安卓/ ARM / Android.mk?无论哪种方式,似乎他们实际上指的是某种东西。我也尝试过这个解决方案Android NDK: Aborting stop?,但我很难理解它。哪个Android.mk文件需要更改?

2 个答案:

答案 0 :(得分:1)

ffmpeg 2.4.2使用更新的库:

libavcodec-56.so, libavformat-56.so, libswscale-3.so, libavutil-54.so, libavfilter-5.so, libswresample-1.so

更新: 而且我认为你在android-ndk / sources / ffmpeg-2.4.2 / android / arm / Android.mk中输入了一个拼写错误。从结尾开始的第4行 - 它应该是LOCAL_MODULE:= libswresample

答案 1 :(得分:0)

您的项目结构和构建命令对我来说似乎很好。我建议尝试一些要点: 1.尝试在jni中添加Application.mk文件。 2.尝试使用linux ndk在linux环境中构建VideoTest.so,并使用较低且稳定版本的ndk。