FFmpeg compilation for Android (setup, creation)

I want to compile ffmpeg for Android ver.
But every time I try, I can not compile ffmpeg source.
I think my configuration option might be invalid.

I used this script for configure.

#!/bin/sh
NDK_PATH=$HOME/android-ndk-r8
PREBUILT=$NDK_PATH/toolchains/arm-linux-androideabi-4.4.3/prebuilt/darwin-x86

LDFLAGS="-Wl,-T,$PREBUILT/armelf_linux_eabi.x -Wl,-rpath-link=$NDK_PATH/platforms/android-8/arch-arm/usr/lib \
     -L$NDK_PATH/platforms/android-8/arch-arm/usr/lib -nostdlib $PREBUILT/lib/gcc/arm-linux-androideabi/4.4.3/crtbegin.o \
     $PREBUILT/lib/gcc/arm-linux-androideabi/4.4.3/crtend.o -lc -lm -ldl"
COMMON_CONFIG="\
          ./configure --target-os=linux \
          --arch=arm \
          --enable-cross-compile \
          --cc=$PREBUILT/bin/arm-linux-androideabi-gcc \
          --as=$PREBUILT/bin/arm-linux-androideabi-gcc \
          --cross-prefix=$PREBUILT/bin/arm-linux-androideabi- \
          --sysinclude=$NDK_PATH/platforms/android-8/arch-arm/usr/include \
          --nm=$PREBUILT/bin/arm-linux-androideabi-nm \
          --extra-ldflags=\"$LDFLAGS\" \
          --extra-cflags=-I$NDK_PATH/platforms/android-8/arch-arm/usr/include \

eval "$COMMON_CONFIG"
if [ $? -ne 0 ]; then
  exit 1
fi

I need to give the compiler a new path to the header file (by -extra-cflags), because when I typed 'make', the compiler did not know where the header files were (for example, math.h, ctime.h)

After configuring using these scripts and type "make", I got this error.

CC  libavdevice/alldevices.o
In file included from /Users/gyeongmingim/android-ndk-r8/platforms/android-8/arch-arm/usr/include/stdlib.h:42,
             from ./libavutil/common.h:35,
             from ./libavutil/avutil.h:126,
             from libavdevice/avdevice.h:22,
             from libavdevice/alldevices.c:22:
/Users/gyeongmingim/android-ndk-r8/platforms/android-8/arch-arm/usr/include/strings.h:49: warning: redundant redeclaration of 'index'
/Users/gyeongmingim/android-ndk-r8/platforms/android-8/arch-arm/usr/include/string.h:47: note: previous declaration of 'index' was here
/Users/gyeongmingim/android-ndk-r8/platforms/android-8/arch-arm/usr/include/strings.h:50: warning: redundant redeclaration of 'strcasecmp'
/Users/gyeongmingim/android-ndk-r8/platforms/android-8/arch-arm/usr/include/string.h:57: note: previous declaration of 'strcasecmp' was here
/Users/gyeongmingim/android-ndk-r8/platforms/android-8/arch-arm/usr/include/strings.h:51: warning: redundant redeclaration of 'strncasecmp'
/Users/gyeongmingim/android-ndk-r8/platforms/android-8/arch-arm/usr/include/string.h:58: note: previous declaration of 'strncasecmp' was here
In file included from ./libavutil/internal.h:178,
             from ./libavutil/common.h:342,
             from ./libavutil/avutil.h:126,
             from libavdevice/avdevice.h:22,
             from libavdevice/alldevices.c:22:
./libavutil/libm.h:62: error: static declaration of 'lrint' follows non-static declaration
./libavutil/libm.h:69: error: static declaration of 'lrintf' follows non-static declaration
./libavutil/libm.h:76: error: static declaration of 'round' follows non-static declaration
./libavutil/libm.h:90: error: static declaration of 'trunc' follows non-static declaration
make: *** [libavdevice/alldevices.o] Error 1

What happened?
Does my configuration have the wrong information? or any missing flag?

OS: Mac Lion
Android-ndk ver: android-ndk-r8

+3
2

, FFMPEg script bambuser ( ) Ubuntu ( VM VM, Ubuntu Windows).

+3

FFmpeg Mac. :

config.h (, configure) lrint friends 1. : #define HAVE_LRINT 1

.

configure, config.h.

+1

All Articles