Build ffmpeg prebuilt library for an android

Post date: Jul 13, 2017 11:03:55 AM

After been a long time to getting into trouble, this time it is ffmpeg. Here the objective is to download the ffmpeg source code from portal http://ffmpeg.org/releases/ and have to build for different arm, arch or cpu for an Android.

Pre-requirements:

Steps to build ffmpeg for android:-

ffmpeg.sh

#!/bin/bash

BASEDIR=$(pwd)

TOOLCHAIN_PREFIX=/opt/android-ndk-r9b/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64

CFLAGS='-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all'

LDFLAGS='-Wl,-z,relro -Wl,-z,now -pie'

./configure \

--target-os=linux \

--cross-prefix=/opt/android-ndk-r9b/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/arm-linux-androideabi- \

--arch=arm \

--cpu=armv7-a \

--enable-runtime-cpudetect \

--sysroot=/opt/android-ndk-r9b/platforms/android-9/arch-arm/ \

--enable-pic \

--enable-pthreads \

--enable-cross-compile \

--disable-debug \

--disable-ffserver \

--enable-version3 \

--enable-hardcoded-tables \

--disable-ffplay \

--disable-ffprobe \

--enable-gpl \

--enable-yasm \

--disable-doc \

--disable-shared \

--enable-static \

--extra-cflags="-I${TOOLCHAIN_PREFIX}/include $CFLAGS" \

--extra-ldflags="-L${TOOLCHAIN_PREFIX}/lib $LDFLAGS"

If you want to build for linux then just use

Please comment here, if you need any support