FFMpeg on Android, undefined references to libavcodec functions, although it is listed on command line

后端 未结 3 1282
别那么骄傲
别那么骄傲 2020-12-14 04:40

I have a problem with unresolved references to ffmpeg\'s libavcodec functions, so far failed to find the answer in other places (including my mind) :)

Let me descri

3条回答
  •  我在风中等你
    2020-12-14 05:12

    I've been using ffmpeg for some Android work too. I do my build a bit different though. I take the lib*.a files and the include dir from the bambuser.com build and just directly include them in my jni directory, my Android.mk looks like this:

    LOCAL_PATH := $(call my-dir)
    
    include $(CLEAR_VARS)
    
    LOCAL_MODULE    := ndk1
    LOCAL_SRC_FILES := native.c
    
    LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
    LOCAL_LDLIBS := -L$(NDK_PLATFORMS_ROOT)/$(TARGET_PLATFORM)/arch-arm/usr/lib -L$(LOCAL_PATH) -lavformat -lavcodec -lavdevice -lavfilter -lavutil -lswscale -llog -ljnigraphics -lz -ldl -lgcc
    
    include $(BUILD_SHARED_LIBRARY)
    

    There might be some cruft in there, but maybe it'll help point you in the right direction. I tried following some of the forms laid out in the NDK example projects like you have. Bundling up the libs into a module and then referencing that. But ended up falling back on the simple direct include just to get things working, and so far haven't had reason to revisit it.

提交回复
热议问题