0

I was trying to compile FFMPEG library under ubuntu for android with including all possible codecs. i followed this tutorial http://www.roman10.net/2013/08/18/how-to-build-ffmpeg-with-ndk-r9/. but when i execute ./build_android.sh it gives me this Error:

root@AK-74:/home/rango/Desktop/android-ndk-r10e/sources/ffmpeg-3.0# ./build_android.sh ERROR: libfaac not found

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 solve the problem.

Here is my build_android.sh content:

#!/bin/bash
NDK=/home/rango/Desktop/android-ndk-r10e
SYSROOT=$NDK/platforms/android-19/arch-arm/
TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86

function build_one
{
./configure \
    --prefix=$PREFIX \
    --enable-shared \
    --disable-static \
    --disable-doc \
    --disable-ffmpeg \
    --disable-ffplay \
    --disable-ffprobe \
    --disable-ffserver \
    --disable-avdevice \
    --disable-doc \
    --disable-symver \
    --enable-gpl \
    --enable-version3 \
    --enable-nonfree \
    --enable-shared \
    --enable-libopencore-amrnb \
    --enable-libopencore-amrwb \
    --enable-libfaac \
    --enable-libgsm \
    --enable-libmp3lame \
    --enable-libtheora \
    --enable-libvorbis \
    --enable-libx264 \
    --enable-libxvid \
    --cross-prefix=$TOOLCHAIN/bin/arm-linux-androideabi- \
    --target-os=linux \
    --arch=arm \
    --enable-cross-compile \
    --sysroot=$SYSROOT \
    --extra-cflags="-Os -fpic $ADDI_CFLAGS" \
    --extra-ldflags="$ADDI_LDFLAGS" \
    $ADDITIONAL_CONFIGURE_FLAG
make clean
make -j4
make install
}

CPU=arm
PREFIX=$(pwd)/android/$CPU
ADDI_CFLAGS="-marm"

build_one
SaidTagnit
  • 115
  • 3
  • 14

4 Answers4

1

libfaac sucks. Remove --enable-libfaac and --enable-nonfree. You can use the native FFmpeg AAC encoder instead and you won't need an additional external library to use it.

llogan
  • 121,796
  • 28
  • 232
  • 243
  • Thank you for replying does FFmpeg have AAC encoder by default ?. i tought i should compile it with it. – SaidTagnit Mar 03 '16 at 17:22
  • @SaidTagnit Yes. FFmpeg has its own AAC encoder: `-c:a aac`. – llogan Mar 04 '16 at 04:40
  • The link you gave contradicts what you said (that libfaac sucks). That page says: "For AAC-LC: libfdk_aac > Native FFmpeg AAC encoder (aac)." libfdk_aac is better than the native AAC encoder. – ffxsam Nov 18 '21 at 00:35
0

Finally i got it to work . The problem was that it can't find the lib's location. I typed this command : locate libfaac. and from the output i realized that its under "/usr/lib/i386-linux-gnu/" :

/usr/lib/i386-linux-gnu/libfaac.a

/usr/lib/i386-linux-gnu/libfaac.so

/usr/lib/i386-linux-gnu/libfaac.so.0

/usr/lib/i386-linux-gnu/libfaac.so.0.0.0

so what i did next is adding this line to "./build_android.sh" to tell it to look there:

--extra-ldflags=-L/usr/lib/i386-linux-gnu/

so the script becomes:

#!/bin/bash
NDK=/home/rango/Desktop/android-ndk-r10e
SYSROOT=$NDK/platforms/android-19/arch-arm/
TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86

function build_one
{
echo $PREFIX
./configure \
--prefix=$PREFIX \
--enable-shared \
--disable-static \
--disable-doc \
--disable-ffmpeg \
--disable-ffplay \
--disable-ffprobe \
--disable-ffserver \
--disable-avdevice \
--disable-doc \
--enable-nonfree \
--disable-symver \
--enable-gpl \
--enable-version3 \
--enable-shared \
--enable-libmp3lame \
--enable-libopencore-amrnb \
--enable-libopencore-amrwb \
--enable-libtheora \
--enable-libvorbis \
--enable-libx264 \
--enable-libxvid \
--enable-libgsm \
--enable-libfaac \
--extra-ldflags=-L/usr/lib/i386-linux-gnu/
--cross-prefix=$TOOLCHAIN/bin/arm-linux-androideabi- \
--target-os=linux \
--arch=arm \
--enable-cross-compile \
--sysroot=$SYSROOT \
--extra-cflags="-Os -fpic $ADDI_CFLAGS" \
--extra-ldflags="$ADDI_LDFLAGS" \
$ADDITIONAL_CONFIGURE_FLAG
make clean
make -j4
make install
}

CPU=arm
PREFIX=$(pwd)/android/$CPU
ADDI_CFLAGS="-marm"

build_one
Community
  • 1
  • 1
SaidTagnit
  • 115
  • 3
  • 14
0

install faac-1.26-1.el6.rf.x86_64.rpm and faac-devel-1.26-1.el6.rf.x86_64.rpm from below link.

http://pkgs.repoforge.org/faac/
Prasad Revanaki
  • 783
  • 4
  • 10
  • 23
0

Install libfdk-aac-dev to resolve this error

apt install libfdk-aac-dev

aVeRTRAC
  • 121
  • 5