0

I have followed lots of tutorials for buildinf ffmpeg.so file like

http://enoent.fr/blog/2014/06/20/compile-ffmpeg-for-android/

http://www.roman10.net/how-to-build-ffmpeg-with-ndk-r9/

and many more tutorials but at last i have stuck to this error every time i dont know how to resolve it please any one knows how to solve it then help me

my build.sh file look like this

  NDK=C:/Users/Benzatine/Downloads/android-ndk-r10e
  SYSROOT=$NDK/platforms/android-19/arch-arm/
  TOOLCHAIN=$NDK/toolchains//arm-linux-androideabi-4.8/prebuilt/windows-x86_64
 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 \
--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
make install
}
CPU=arm
PREFIX=$(pwd)/android/$CPU 
ADDI_CFLAGS="-marm"
build_one

But when it executes make command it gives following error

 LD      libswscale/libswscale-3.so
    c:/users/benzatine/downloads/android-ndk-r10e/toolchains/arm-linux-androideabi-4.8/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld.exe: error:     libavutil/libavutil.so:1:1: syntax error, unexpected '!', expecting $end
c:/users/benzatine/downloads/android-ndk-r10e/toolchains/arm-linux-androideabi-4.8/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld.exe: error: libavutil/libavutil.so: not an object or archive
collect2.exe: error: ld returned 1 exit status
library.mak:111: recipe for target 'libswscale/libswscale-3.so' failed
make: *** [libswscale/libswscale-3.so] Error 1

every time i try to build ffmpeg this error occure how to resolve it please someone help me

zella
  • 4,645
  • 6
  • 35
  • 60
user3269550
  • 452
  • 4
  • 15

1 Answers1

0

I am going to assume that you are building it on Windows system based on the error message.

I just found this post on Facebook group so I am not going to take any credit for it.Bascially he just use other project and tweak it to make it work forcefully.It use Android 'Love' version and compile it in Windows system.

FFMpeg (https://www.ffmpeg.org), one of the most used libary written in C programming language for multimedia related task. It has a lot of feature to add multimedia support for your application but the trouble being a 'C' library we have port it into other language if you don't want to create your application in C/C++. Trust me porting it into different language is a lot of work which are filled with error. Luckily you can find tutorial and easy build script in the internet but unfountenly , they are only written by assumption that you are porting it into nix based OS and the few tutorial on porting it on Windows OS does not work (atleast for me. :) ) But the main reason I am using ffmpeg is to add a multimedia feature to the android which are not provided by standard Android API. I found some pre-made android project on an internet which use FFMpeg 'Love' version. Here is the project.

In case you are wondering how to use it in your Android project , here are the step

1) Add a native support to the Android Project by right-clicking the Android Tools>Add Native Support...
2) Copy 'armeabi' folder to 'libs' folder of your project
3) Replace 'obj' folder with the 'obj' of ffmpeg project in the attached file
4) Add 'ffmpeg' folder to the 'jni' folder
5) Replace 'Androd.mk' folder  with the 'Android.mk' of the ffmpeg project in the attached file
6) Write your code in C/C++ and enjoy

As always if you have any trouble or question you can comment them and I will answer them as soon as possible

Attached file:http://robot-mitya.googlecode.com/files/MyFfmpegTest.zip

Source:http://dmitrydzz-hobby.blogspot.com/2012/04/how-to-build-ffmpeg-and-use-it-in.html

Sun Maung Oo
  • 183
  • 2
  • 11