How to use android ndk r9b to compile FFMPEG for A

2019-03-29 07:39发布

问题:

I want to design an Android app which can play and edit video by FFMPEG commands. But I don't know how to use FFMPEG on Android. I have tried many methods searched from Google, but they are too old to implement. Now, the newest version of FFMPEG is 2.1.1 and the Android-NDK's version is r9b. My operating system is Linux mint 15. How can I use eclipse IDE on my OS to implement an Android app which has FFMPEG's newest decoder and encoder?

回答1:

IJKplayer compiles ffmpeg for android using ndk as part of its make process. The configuration files can be slightly modified to enable generation of ffmpeg binary for android.

Specifically comment out lines in config/module-lite.sh before running the compile-ffmpeg script:

export COMMON_FF_CFG_FLAGS="$COMMON_FF_CFG_FLAGS --disable-programs"
export COMMON_FF_CFG_FLAGS="$COMMON_FF_CFG_FLAGS --disable-ffmpeg"
export COMMON_FF_CFG_FLAGS="$COMMON_FF_CFG_FLAGS --disable-avfilter"

And it will generate the ffmpeg executable.

The IJKplayer project will also give you a hint on how to use ffmpeg in android programs.