Ask Your Question

vega83mv's profile - activity

2015-04-13 14:47:18 -0600 received badge  Notable Question (source)
2014-05-19 06:34:59 -0600 received badge  Popular Question (source)
2013-10-31 12:23:29 -0600 received badge  Student (source)
2013-01-28 04:11:44 -0600 received badge  Editor (source)
2013-01-28 04:03:56 -0600 asked a question 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