我正在尝试开发Android应用程序,它可以将图像从相机流式传输到服务器。所以我找到了一个流向浏览器的项目,你可以在这里找到:http://code.google.com/p/ipcamera-for-android/
我正在尝试运行此代码,但出现错误:
06-28 12:43:47.030:E / AndroidRuntime(31749): java.lang.UnsatisfiedLinkError:无法加载库:link_image [1963]: 1567无法为'libipcamera.so'加载所需的库'libffmpeg.so' (load_library [1105]:未找到库'libffmpeg.so')
我加载它们的代码部分:
public static void LoadLibraries() {
System.loadLibrary("teaonly");
System.loadLibrary("ipcamera");
}
以下是编译本机代码图像:(无错误)
http://i.imm.io/ujSE.png(因为我是新来的,我无法发布图片)
这是 Android.mk 文件:
#####################################################################
# the build script for NDK for droidipcam project
#
LOCAL_PATH:= $(call my-dir)
###########################################################
# the third prebuild library for linking
#
include $(CLEAR_VARS)
LOCAL_MODULE := libffmpeg-prebuild
LOCAL_SRC_FILES := libffmpeg.so
LOCAL_MODULE_TAGS := prebuild
include $(PREBUILT_SHARED_LIBRARY)
###########################################################
# build android libteaony
# libteaonly: clone from libjingle, for generat NDK appplicaton
# threads, socket, signal/slot and messages, etc.
#
include $(CLEAR_VARS)
LOCAL_MODULE := libteaonly
LOCAL_CPP_EXTENSION := .cc
LOCAL_CPPFLAGS := -O2 -Werror -Wall -DHAMMER_TIME=1 -DLOGGING=1 -DHASHNAMESPACE=__gnu_cxx -DHASH_NAMESPACE=__gnu_cxx -DPOSIX -DDISABLE_DYNAMIC_CAST -D_REENTRANT -DOS_LINUX=OS_LINUX -DLINUX -D_DEBUG -DANDROID
#including source files
include $(LOCAL_PATH)/lib_build.mk
LOCAL_LDLIBS := -llog
include $(BUILD_SHARED_LIBRARY)
###########################################################
# the native jni interface library
#
include $(CLEAR_VARS)
LOCAL_MODULE := ipcamera
LOCAL_CPPFLAGS := -O2 -Werror -Wall -DHAMMER_TIME=1 -DLOGGING=1 -DHASHNAMESPACE=__gnu_cxx -DHASH_NAMESPACE=__gnu_cxx -DPOSIX -DDISABLE_DYNAMIC_CAST -D_REENTRANT -DOS_LINUX=OS_LINUX -DLINUX -D_DEBUG -DANDROID
LOCAL_C_INCLUDES := ./ $(LOCAL_PATH)/ffmpeg
LOCAL_SHARED_LIBRARIES := libffmpeg-prebuild libteaonly
LOCAL_LDLIBS := -llog
include $(LOCAL_PATH)/build.mk
include $(BUILD_SHARED_LIBRARY)
我的问题是:
答案 0 :(得分:0)
尝试使用
LOCAL_SHARED_LIBRARIES += libffmpeg-prebuild
而不是
LOCAL_SHARED_LIBRARIES := libffmpeg-prebuild libteaonly
希望这能解决你的问题......