Compiling FFmpeg lib and adding it to NDK sources in Windows8

I saw several articles on how to compile and use FFmpeg for Android.

Thess is a good example - example1 and example2

Unfortunately, not for them, or for others that I found helped me. In these two examples, build_android.sh is created and the FFmpeg configuration file is configured and called to create it. Each time I run the script, I get the following error:

c:\android\development\android-ndk-r9\sources\ffmpeg>sh build_android.sh c:/android/development/android-ndk-r9/toolchains/arm-linux-androideabi-4.8/prebu ilt/windows-x86_64/arm-linux-androideabi/bin/bin/arm-linux-androideabi-gcc is un able 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. Makefile:2: config.mak: No such file or directory Makefile:49: /common.mak: No such file or directory Makefile:92: /libavutil/Makefile: No such file or directory Makefile:92: /library.mak: No such file or directory Makefile:169: /doc/Makefile: No such file or directory Makefile:170: /tests/Makefile: No such file or directory make: *** No rule to make target `/tests/Makefile'. Stop. Makefile:2: config.mak: No such file or directory 

If someone encounters and solves this problem, it will be very helpful!

After trying the proposed script, I came across a new problem that I could not solve, this is the output of the script:

.... List of included components ....

At the end of the list, I got the following:

Included indevs: dv1394 v4l2i fbdev

Outdevs Included: fbdev v4l2

License: LGPL version 2.1 or later Creation of config.mak, config.h and doc / config.texi ...

WARNING: C: / android / development / android-ndk-r9 / toolchains / arm-linux-androideabi- 4.8 / prebuilt / windows-x86_64 / bin / arm-linux-androideabi-pkg-config was not found, libr may fail. make: * There is no rule to make the target libavfilter/libavfilter.so', needed by all-ye s'. Stop. make: * There is no rule for creating the install-libavfilter-shared', needed by target install-libavfilter-shared', needed by instal l-LIBS-yes. Stop.

+7
ffmpeg android-ndk
source share
2 answers

Can you paste what is in the build_android.sh file that you copied inside the FFmpeg directory?

I have the same error when one of the variables defined at the beginning of the script is set incorrectly. Make sure the NDK or SYSROOT or TOOLCHAIN ​​variables are set to a valid path!

I tried using the following steps and it worked for me:

1) Download FFmpeg

git clone git: //source.ffmpeg.org/ffmpeg.git ffmpeg

2) Create a file called build_android.sh inside the FFmpeg directory

cd ffmpeg; touch build_ffmpeg_for_android.sh;

3) Add the following file to the file

 #!/usr/bin/env bash NDK=$HOME/Software/Android/android-ndk-r10/ SYSROOT=$NDK/platforms/android-19/arch-arm/ TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-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 -j4 make install } CPU=arm PREFIX=$(pwd)/android/$CPU ADDI_CFLAGS="-marm" build_one 

4) Make an executable script

chmod + x build_ffmpeg_for_android.sh

5) Run the assembly FFmpeg for Android (ARM)
(run the script using Bash, i.e. / usr / bin / bash not / usr / bin / sh)

./build_ffmpeg_for_android.sh

+8
source share

I was getting the same errors as @powerX, and I was able to solve the problem using a different method from @ dZkF9RWJT6wN8ux.

Although I use Ubuntu 13.10, I hope you find my answer helpful. With the release of Android NDK r9 and FFMPEG 2.2 “Muybridge”, I was finally able to complete the third step called “Build FFMPEG” from @powerX example1 link: http://www.roman10.net/how-to-build-ffmpeg-with-ndk -r9 /

I finally fixed this by changing the SYSROOT variable in the build_android.sh file to point to "... / android-19 / arch-arm" instead of ... / android -9 / arch-arm ".

Hope this helps.

+1
source share

All Articles