I used this and this methods to build latest (3.1.4) FFMPEG version for Android.
Build was succeed.
I got several folders with sources
/ headers
/ .o
files.
But unfortunately there are no .so
files I need.
Are there some updated script for building latest FFMPEG for android?
Or, how to convert .o
and other files to .so
?
Asked
Active
Viewed 509 times
2

Community
- 1
- 1

Volodymyr Kulyk
- 6,455
- 3
- 36
- 63
1 Answers
4
I've actually posted this as a few answers now. This works perfectly for ffmpeg 3.1.4:
#!/bin/bash
NDK=$HOME/Android/Sdk/ndk-bundle
SYSROOT=$NDK/platforms/android-19/arch-arm/
TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64
CPREFIX=$TOOLCHAIN/bin/arm-linux-androideabi-
function build_it {
./configure \
--prefix=$PREFIX \
--disable-static \
--enable-shared \
--disable-doc \
--disable-ffmpeg \
--disable-ffplay \
--disable-ffprobe \
--disable-ffserver \
--disable-avdevice \
--disable-doc \
--disable-symver \
--cross-prefix=$CPREFIX \
--target-os=linux \
--arch=arm \
--enable-cross-compile \
--enable-gpl \
--sysroot=$SYSROOT \
--extra-cflags="-Os -fpic $ADDI_CFLAGS" \
--extra-ldflags="$ADDI_LDFLAGS" \
$ADDITIONAL_CONFIGURE_FLAG
make clean
make -j9
make install
}
CPU=arm
PREFIX=$(pwd)/android/$CPU
ADDI_CFLAGS="-marm"
build_it
You will find the android libraries and headers in android/arm/...

WLGfx
- 1,169
- 15
- 31
-
It generates `.a` (static libraries), how about `.so`? Thank you anyway, I think I can use static libraries as well. – Volodymyr Kulyk Oct 20 '16 at 14:55
-
--enable-shared or static will give you the right libs .so or .a – WLGfx Oct 20 '16 at 15:52
-
it generates `.so`s for me. how do I get `.a` ? – TheWaterProgrammer Oct 05 '17 at 19:46
-
Switch between `--enable-shared` and `--enable-static` to what you need. Don't forget to disable the other. – WLGfx Oct 05 '17 at 21:30