How to compile ffmpeg-2.2.2 on windows with cygwin and android ndk r9c

Hansjörg Hofer

did someone successfully compile

ffmpeg-2.2.2 on windows with cygwin and android ndkr9c ?

Or can point me to an up to date tutorial ?

(http://www.roman10.net/how-to-build-ffmpeg-with-ndk-r9/ isn't working for me i get Makefile:2: config.mak: No such file... cygwin admin devel gnome is completely installed and make -v ok )

I need to convert a video to images(for live-wallpaper)... do you know a better method or is ffmpeg the best ?

thx

Alex Cohn

Start with Roman's tutorial. Following changes apply to Windows: you should use the NDK make.exe, not the one from cygwin. So, I simply wrote d:/dev/Android/ndk/prebuilt/windows-x86_64/bin/make.exe in my build_android.sh. For some weird reason, I could not run make clean - but I simply chose to ignore this problem for now.

Following the tutorial, don't forget to set

TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.8/prebuilt/windows-x86_64

Also, use mixed-style paths, i.e. d:/dev/whatever and not cygwin style /cygdrive/d/dev/whatever. Be careful not to use paths with spaces - neither for ndk installation, nor for ffmpeg git clone.

With ffmpeg 2.2, you can use --target-os=android for ./configure, instead of mangling ./configure file as described in step 2.

On my machine, I did not have pr and od commands. I chose simply to fake them, writing

echo 'cat $3' > ./pr
echo 'echo od' > ./od

These do not spoil the build.

So, my build process is as follows:

git clean -d -f -x
./configure --enable-shared --disable-static --disable-doc --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --disable-avdevice --disable-doc --disable-symver --cross-prefix=d:/android-ndk-r9c/toolchains/arm-linux-androideabi-4.8/prebuilt/windows-x86_64/bin/arm-linux-androideabi- --target-os=android --arch=arm --enable-cross-compile --sysroot=d:/android-ndk-r9c/platforms/android-9/arch-arm/ --extra-cflags="-Os -fpic"

Compilation does display some warnings, but the .so files are all produced.

To enable NEON, I used

--extra-cflags="-Os -fpic -marm -march=armv7-a -mfloat-abi=softfp -mfpu=neon"
--extra-ldflags="-Wl,--fix-cortex-a8"

Now, libavcodec.so could not be built anymore: too many files on the linker list. So, after it crashed, I launched the linker manually:

$ d:/Dev/Android/ndk/toolchains/arm-linux-androideabi-4.8/prebuilt/windows-x86_64//bin/arm-linux-androideabi-gcc  -shared -Wl,-Bsymbolic -Wl,--version-script,libavcodec/libavcodec.ver -Llibavcodec -Llibavdevice -Llibavfilter -Llibavformat -Llibavresample -Llibavutil -Llibpostproc -Llibswscale -Llibswresample -Wl,--fix-cortex-a8  --sysroot=d:/Dev/Android/ndk/platforms/android-9/arch-arm/ -isysroot d:/Dev/Android/ndk/platforms/android-9/arch-arm/ -Wl,--as-needed -Wl,--warn-common -Wl,-rpath-link=libpostproc:libswresample:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil:libavresample @libavcodec/libavcodec.list -lswresample -lavutil -lm -lz -pthread -o libavcodec/libavcodec.so.55

I patch the library.mak file as follows: for $(SUBDIR)$(SLIBNAME_WITH_MAJOR), replace

$$(LD) $(SHFLAGS) $(LDFLAGS) $$(LD_O) $$(filter %.o,$$^) $(FFEXTRALIBS)

with

$(Q)echo >$(SUBDIR)lib$(NAME).list $(wordlist 1,400,$(filter %.o,$$<))
$(Q)echo >>$(SUBDIR)lib$(NAME).list $(wordlist 401,999,$(filter %.o,$$<))
$$(LD) $(SHFLAGS) $(LDFLAGS) $$(LD_O) @$(SUBDIR)lib$(NAME).list $(FFEXTRALIBS)

.. and from there, make proceeded smoothly.

PS: I used make -n libavcodec/libavcodec.so.55 to prepare the response file libavcodec/libavcodec.list.

PPS: Here is another article that helps to build and use ffmpeg for Android.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to compile ffmpeg-2.2.2 on windows with cygwin and android ndk r9c

From Dev

Is there a legacy toolchain for Android NDK r9c?

From Dev

Setting up Cygwin + Android NDK + cocos2Dx to work with Eclipse

From Dev

How to configure FFmpeg library with ndk r12 using windows 7 64 bit operating system for android

From Dev

euca2ools for Windows/Cygwin?

From Dev

Android Dagger 2 compile errors

From Dev

How to create Cocos2d-x v3.0 Beta 2 android ndk project

From Dev

How to create Cocos2d-x v3.0 Beta 2 android ndk project

From Dev

How to install AWS CLI Version 2 on Cygwin

From Dev

How to compile ocaml graphics windows cygwin

From Dev

How to solve this situation about ffmpeg with Android NDK

From Dev

How to compile android ndk binder source code

From Dev

How to compile dumpsys as an standalone application with Android NDK?

From Dev

How to solve the compile error in Android NDK?

From Dev

FFMPeg 2 pass c#

From Dev

Set NDK_MODULE_PATH for cocos2dx Android

From Dev

NDK step-by-step debugging with Android Studio 2.0 (Beta 2)

From Dev

Building libxml2 into NDK with Android Studio and Gradle Experimental

From Dev

Display WebP image on Android 2.x with libwebp and NDK

From Dev

android ndk open gl es 2 setup without java

From Dev

NDK r9c - does not support std::future

From Dev

NDK r9c - does not support std::future

From Dev

Android NDK C++ openGL ES 2 context gives bad display

From Dev

Compile OpenALPR for Android with NDK

From Dev

Compile OpenALPR for Android with NDK

From Dev

How to install/compile SDL2 C code on Linux/Ubuntu

From Dev

How to compile a C++ program with SDL2 on OS X?

From Dev

How to install/compile SDL2 C code on Linux/Ubuntu

From Dev

How to compile Linux kernel with multimedia as module on Odroid C2

Related Related

  1. 1

    How to compile ffmpeg-2.2.2 on windows with cygwin and android ndk r9c

  2. 2

    Is there a legacy toolchain for Android NDK r9c?

  3. 3

    Setting up Cygwin + Android NDK + cocos2Dx to work with Eclipse

  4. 4

    How to configure FFmpeg library with ndk r12 using windows 7 64 bit operating system for android

  5. 5

    euca2ools for Windows/Cygwin?

  6. 6

    Android Dagger 2 compile errors

  7. 7

    How to create Cocos2d-x v3.0 Beta 2 android ndk project

  8. 8

    How to create Cocos2d-x v3.0 Beta 2 android ndk project

  9. 9

    How to install AWS CLI Version 2 on Cygwin

  10. 10

    How to compile ocaml graphics windows cygwin

  11. 11

    How to solve this situation about ffmpeg with Android NDK

  12. 12

    How to compile android ndk binder source code

  13. 13

    How to compile dumpsys as an standalone application with Android NDK?

  14. 14

    How to solve the compile error in Android NDK?

  15. 15

    FFMPeg 2 pass c#

  16. 16

    Set NDK_MODULE_PATH for cocos2dx Android

  17. 17

    NDK step-by-step debugging with Android Studio 2.0 (Beta 2)

  18. 18

    Building libxml2 into NDK with Android Studio and Gradle Experimental

  19. 19

    Display WebP image on Android 2.x with libwebp and NDK

  20. 20

    android ndk open gl es 2 setup without java

  21. 21

    NDK r9c - does not support std::future

  22. 22

    NDK r9c - does not support std::future

  23. 23

    Android NDK C++ openGL ES 2 context gives bad display

  24. 24

    Compile OpenALPR for Android with NDK

  25. 25

    Compile OpenALPR for Android with NDK

  26. 26

    How to install/compile SDL2 C code on Linux/Ubuntu

  27. 27

    How to compile a C++ program with SDL2 on OS X?

  28. 28

    How to install/compile SDL2 C code on Linux/Ubuntu

  29. 29

    How to compile Linux kernel with multimedia as module on Odroid C2

HotTag

Archive