OpenCV and FFmpeg for Android
Hi everyone, this is my project situation: I compiled ffmpeg on windows using this tutorial and I imported the ffmpeg folder generated (with inside libffmpeg.so file) inside my android project (under jni folder). In my project I have a jni_part.cpp where I inserted my jni function to operate with opencv. In my Android.mk I'm using the code below to import opencv and compile the jni_part.cpp
include $(CLEAR_VARS)
include ../../sdk/native/jni/OpenCV.mk
LOCAL_MODULE := mixed_sample
LOCAL_SRC_FILES := jni_part.cpp
LOCAL_LDLIBS += -llog -ldl
LOCAL_SHARED_LIBRARY := ffmpeg-prebuilt
include $(BUILD_SHARED_LIBRARY)
But what code I should use to import also ffmpeg? I tried to use this code pasted into Android.mk file:
include $(CLEAR_VARS)
LOCAL_MODULE := ffmpeg-prebuilt
LOCAL_SRC_FILES := ffmpeg-0.8/android/armv7-a/libffmpeg.so
LOCAL_EXPORT_C_INCLUDES := ffmpeg-0.8/android/armv7-a/include/
LOCAL_EXPORT_LDLIBS := ffmpeg-0.8/android/armv7-a/libffmpeg.so
LOCAL_PRELINK_MODULE := true
include $(PREBUILT_SHARED_LIBRARY)
but if from my jni_part.cpp code I try to include some ffmpeg files as for example #include <libavutil/avstring.h>
I get this error:
**** Build of configuration Default for project OpenCV Tutorial 4 - Mix Java+Native OpenCV ****
C:\android-ndk-r8c\ndk-build.cmd
Prebuilt : libffmpeg.so <= jni/ffmpeg-0.8/android/armv7-a/
Install : libffmpeg.so => libs/armeabi-v7a/libffmpeg.so
"Compile++ thumb : mixed_sample <= jni_part.cpp
jni/jni_part.cpp:24:32: fatal error: libavutil/avstring.h: No such file or directory
compilation terminated.
make: *** [obj/local/armeabi-v7a/objs/mixed_sample/jni_part.o] Error 1
**** Build Finished ****
Thanks in advance for you suggestions