Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to compile latest FFmpeg Library for Android?

Struggling to put together a working and generally best practice build of current FFmpeg. There seems to be no up-to-date documents or tutorials. What does exist is full of outdated links or build-scripts that do not work.

like image 979
Timo Schuck Avatar asked May 26 '16 23:05

Timo Schuck


People also ask

How long does it take to compile FFmpeg?

Depend on the speed of you Internet and the hardware specification of your computer, it may take 10~30 minutes to complete the compilation.

How do I enable FFmpeg configuration?

Type ./configure to create the configuration. A list of configure options is printed by running configure --help . configure can be launched from a directory different from the FFmpeg sources to build the objects out of tree. To do this, use an absolute path when launching configure , e.g. /ffmpegdir/ffmpeg/configure .


2 Answers

Build the standalone NDK Toolchain

Download the latest NDK and run make_standalone_toolchain.py

Configure FFmpeg

./configure \
--cross-prefix=arm-linux-androideabi- \
--sysroot="${ANDROID_STANDALONE_NDK}/sysroot" \
--target-os=linux \
--arch=arm \
--cpu=cortex-a8 \
--enable-cross-compile \
--enable-pic \
--enable-shared \
--extra-cflags="-fpic"

Then of course

make -j4

You probably don't want to compile a lot of the components, so you'll need to see what to enable/disable in ./configure --help

like image 200
Cameron Lowell Palmer Avatar answered Oct 15 '22 09:10

Cameron Lowell Palmer


Solution found!

Please check following links:

  • https://github.com/WritingMinds/ffmpeg-android
  • https://github.com/WritingMinds/ffmpeg-android-java
  • http://writingminds.github.io/ffmpeg-android/
  • http://writingminds.github.io/ffmpeg-android-java/
like image 29
Timo Schuck Avatar answered Oct 15 '22 11:10

Timo Schuck