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.
3 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
5 Comments
make_stanalone_toolchain.py do? Should i run it right where it is located or i should copyt it to my projects directoty ?Solution found!
Please check following links:
1 Comment
After reading so many post, I've managed to find the way to generate the ffmpeg library for an android
Download below mentioned code and having it as ffmpeg.sh and execute the same in your ffmpeg source root folder and do make
#!/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" Fore details, visit https://sites.google.com/site/greateindiaclub/mobil-apps/android/buildffmpegprebuiltlibraryforanandroid