I am trying to compile FFMPEG to work with my Android app. I've looked at: https://github.com/halfninja/android-ffmpeg-x264 which is almost what I want but I need a later version of FFMPEG (so I'm trying to use the latest, 2.2).
I'm using most of the scripts located there, but the problem is after I run compile_make_everything.sh, I try to run ndk-build but I get errors (basically it can't find the main function in ffmpeg.c).
This is my Android.mk:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
#LOCAL_ALLOW_UNDEFINED_SYMBOLS := true
LOCAL_MODULE := videokit
LOCAL_SRC_FILES := videokit/com_myapp_example_FFMpegService.c
LOCAL_LDLIBS := -llog -ljnigraphics -lz -landroid
LOCAL_STATIC_LIBRARIES :=ffmpeg
include $(BUILD_SHARED_LIBRARY)
$(call import-module,ffmpeg-2.0.1/android/arm)
If I modify my LOCAL_SRC_FILES to include ffmpeg.c, it fails when I tries to find some of the helper libraries it requires: LOCAL_SRC_FILES := videokit/com_myapp_example_FFMpegService.c ffmpeg/ffmpeg.c ffmpeg/cmdutils.c
The error:
In file included from /home/me/ffmpeg/new-android-ffmpeg/Project/jni/ffmpeg/ffmpeg.c:44:0: /home/me/ffmpeg/new-android-ffmpeg/Project/jni/ffmpeg/libavformat/avformat.h:255:32: fatal error: libavcodec/avcodec.h: No such file or directory compilation terminated.
How can I include the latest ffmpeg library while still being able to call the main function?