Ask Your Question

OpenCV and FFmpeg for Android

asked 2013-01-28 04:03:56 -0600

this post is marked as community wiki

This post is a wiki. Anyone with karma >50 is welcome to improve it.

Hi everyone, this is my project situation: I compiled ffmpeg on windows using this tutorial and I imported the ffmpeg folder generated (with inside 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 I'm using the code below to import opencv and compile the jni_part.cpp

include $(CLEAR_VARS)
include ../../sdk/native/jni/
LOCAL_MODULE    := mixed_sample
LOCAL_SRC_FILES := jni_part.cpp
LOCAL_LDLIBS +=  -llog -ldl 
LOCAL_SHARED_LIBRARY := ffmpeg-prebuilt

But what code I should use to import also ffmpeg? I tried to use this code pasted into file:

include $(CLEAR_VARS)
LOCAL_MODULE := ffmpeg-prebuilt
LOCAL_SRC_FILES := ffmpeg-0.8/android/armv7-a/
LOCAL_EXPORT_C_INCLUDES := ffmpeg-0.8/android/armv7-a/include/
LOCAL_EXPORT_LDLIBS := ffmpeg-0.8/android/armv7-a/

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 ****

Prebuilt       : <= jni/ffmpeg-0.8/android/armv7-a/
Install        : => libs/armeabi-v7a/
"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

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2013-10-31 08:32:34 -0600

iReallyUbuntu gravatar image

Try this and follow the instructions under "Quick Start for OpenCV and FFmpeg"

edit flag offensive delete link more

answered 2013-01-29 12:11:14 -0600

this post is marked as community wiki

This post is a wiki. Anyone with karma >50 is welcome to improve it.

FFMPEG is not officially supported in OpenCV4Android OpenCV team works on this problem and I belive FFMPEG support appears in future releases. You can track task status here.

edit flag offensive delete link more

Question Tools


Asked: 2013-01-28 04:03:56 -0600

Seen: 5,422 times

Last updated: Oct 31 '13