I have tried to compile the last version of ffmpeg with the android ndk r8b, but i always have errors and i dont know how to solve them. I am reading this tutorial http://www.roman10.net/how-to-build-ffmpeg-for-android/ but the script doesnt work with my environment, i am using this: -Ubuntu 12.04 LTS. -Intel Core i7. -Android ndk r8b -Last version ffmeg (1.0)
Basically i want to encode films from one format to other.
And that is the script that i am using:
NDK=../android-ndk-r8b
PLATFORM=$NDK/platforms/android-8/arch-arm/
PREBUILT=$NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86
function build_r8b
{
bash configure \
--disable-shared \
--enable-static \
--enable-gpl \
--enable-version3 \
--enable-nonfree \
--disable-doc \
--disable-ffmpeg \
--disable-ffplay \
--disable-ffprobe \
--disable-ffserver \
--disable-avdevice \
--disable-avfilter \
--disable-postproc \
--enable-small \
--cross-prefix=$PREBUILT/bin/arm-linux-androideabi- \
--enable-cross-compile \
--target-os=linux \
--extra-cflags="-I$PLATFORM/usr/include" \
--extra-ldflags="-L$PLATFORM/usr/lib -nostdlib" \
--arch=arm \
--disable-symver \
--disable-debug \
--disable-stripping \
$ADDITIONAL_CONFIGURE_FLAG
sed -i 's/HAVE_LRINT 0/HAVE_LRINT 1/g' config.h
sed -i 's/HAVE_LRINTF 0/HAVE_LRINTF 1/g' config.h
sed -i 's/HAVE_ROUND 0/HAVE_ROUND 1/g' config.h
sed -i 's/HAVE_ROUNDF 0/HAVE_ROUNDF 1/g' config.h
sed -i 's/HAVE_TRUNC 0/HAVE_TRUNC 1/g' config.h
sed -i 's/HAVE_TRUNCF 0/HAVE_TRUNCF 1/g' config.h
make clean
make -j4 install
$PREBUILT/bin/arm-linux-androideabi-ar d libavcodec/libavcodec.a inverse.o
$PREBUILT/bin/arm-linux-androideabi-ld -rpath-link=$PLATFORM/usr/lib -L$PLATFORM/usr/lib -soname libffmpeg.so -shared -nostdlib -z,noexecstack -Bsymbolic --whole-archive --no-undefined -o $PREFIX/libffmpeg.so libavcodec/libavcodec.a libavformat/libavformat.a libavutil/libavutil.a libswscale/libswscale.a -lc -lm -lz -ldl -llog --warn-once --dynamic-linker=/system/bin/linker $PREBUILT/lib/gcc/arm-linux-androideabi/4.4.3/libgcc.a
}
#arm v7vfpv3
CPU=armv7-a
OPTIMIZE_CFLAGS="-mfloat-abi=softfp -mfpu=vfpv3-d16 -marm -march=$CPU "
PREFIX=./android/$CPU
ADDITIONAL_CONFIGURE_FLAG=
#build_one
build_r8b
And that is the terminal result
jllarraz@ubuntu:~/Descargas/ffmpeg$ bash build_android.sh
/android-ndk-r8b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc is unable to create an executable file.
C compiler test failed.
If you think configure made a mistake, make sure you are using the latest
version from Git. If the latest version fails, report the problem to the
ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "config.log" produced by configure as this will help
solving the problem.
make: execvp: ./version.sh: Permiso denegado
make: execvp: ./version.sh: Permiso denegado
HOSTCC doc/print_options.o
CC cmdutils.o
CC libavdevice/alldevices.o
CC libavdevice/avdevice.o
In file included from doc/print_options.c:104:0:
./libavcodec/options_table.h: En la función ‘show_codec_opts’:
./libavcodec/options_table.h:85:1: aviso: ‘sub_id’ es obsoleto (declarado en ./libavcodec/avcodec.h:1505) [-Wdeprecated-declarations]
./libavcodec/options_table.h:149:1: aviso: ‘luma_elim_threshold’ es obsoleto (declarado en ./libavcodec/avcodec.h:1740) [-Wdeprecated-declarations]
./libavcodec/options_table.h:150:1: aviso: ‘chroma_elim_threshold’ es obsoleto (declarado en ./libavcodec/avcodec.h:1747) [-Wdeprecated-declarations]
./libavcodec/options_table.h:284:1: aviso: ‘color_table_id’ es obsoleto (declarado en ./libavcodec/avcodec.h:1986) [-Wdeprecated-declarations]
./libavcodec/options_table.h:307:1: aviso: ‘inter_threshold’ es obsoleto (declarado en ./libavcodec/avcodec.h:2049) [-Wdeprecated-declarations]
./libavcodec/options_table.h:312:1: aviso: ‘quantizer_noise_shaping’ es obsoleto (declarado en ./libavcodec/avcodec.h:2056) [-Wdeprecated-declarations]
cmdutils.c:52:21: error fatal: version.h: No existe el archivo o el directorio
compilación terminada.
make: *** [cmdutils.o] Error 1
make: *** Se espera a que terminen otras tareas....
build_android.sh: línea 59: ../android-ndk-r8b/toolchains/arm-linux-androideabi- 4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-ar: Permiso denegado
build_android.sh: línea 60: ../android-ndk-r8b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-ld: Permiso denegado