How exactly do I build OpenCV for Android with an FFMPEG/GStreamer backend?

asked 2018-06-18 05:08:33 -0600

Gensoukyou1337 gravatar image

I've built OpenCV for Android several times from source using CMake's GUI, but my current project needs me to have an FFMPEG/GStreamer (either opens MP4 files, right?) backend for its videoio. This got me stumped even now.

My FFMPEG isn't exactly installed, but unzipped in F:/, while my GStreamer (Windows binary install) is in E:/

Every time I add the WITH_FFMPEG entry to the CMakeconfig, it disappears when I configure it again. The WITH_GSTREAMER_0_10 flag doesn't seem to do anything either, as the Video I/O part of the config remains blank.

What exactly am I supposed to do here? I've been searching all over Google and no one's saying anything about this. Am I supposed to provide the path to either FFMPEG or GStreamer into the OpenCV CMake config? Because I don't see the option to do so anywhere.

edit retag flag offensive close merge delete

Comments

My FFMPEG isn't exactly installed, but unzipped in F:/, while my GStreamer (Windows binary install) is in E:/

and both are entirely useless, since you need arm (or whatever) versions, so you have to (cross-) compile those first.

berak gravatar imageberak ( 2018-06-18 08:13:27 -0600 )edit

Compile both of them for android-arm? By the way, I just downloaded the gstreamer-1.0-android-universal-1.14.1. Would that work? Also, after (cross-)compiling either one or both of them, what do I do in the cmake config?

Gensoukyou1337 gravatar imageGensoukyou1337 ( 2018-06-18 08:21:17 -0600 )edit

i have no idea, what will work for you in the end (never done that), but for sure, the win binaries are useless (and thus ignored from cmake)

berak gravatar imageberak ( 2018-06-18 08:27:03 -0600 )edit

In the most recent repo of OpenCV, I see a ffmpeg-download.ps1.in file in <opencv-master-dir>/3rdparty/ffmpeg. Should I make a custom CMake toolchain if I want to use it?

Gensoukyou1337 gravatar imageGensoukyou1337 ( 2018-06-18 11:49:08 -0600 )edit

again, idk. but i guess, it's more related to the windows (prebuilt ffmpeg) version, than to android.

berak gravatar imageberak ( 2018-06-18 11:57:56 -0600 )edit