gpt4 book ai didi

带有 ffmpeg 库的 Android NDK - 运行项目时出错

转载 作者:行者123 更新时间:2023-12-04 23:16:54 25 4
gpt4 key购买 nike

使用本指南,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/android/arm 中的那个/Android.mk?无论哪种方式,似乎他们实际上都在指向某些东西。我也试过查看这个解决方案, Android NDK: Aborting stop? ,但我很难理解它。哪个 Android.mk 文件需要更改?

最佳答案

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

关于带有 ffmpeg 库的 Android NDK - 运行项目时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26247206/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com