7

compile ffmpeg with android ndk r5b.

ffmpeg 0.6.1

android ndk r5b

cygwin 1.7

build reference url : http://www.cnblogs.com/scottwong/archive/2010/12/17/1909455.html

but, ffmpeg ./configure result error! (below config.err file)

check_cc
BEGIN /tmp/ffconf.GlDiY1P8.c
    1   int main(void){ return 0; }
END /tmp/ffconf.GlDiY1P8.c
/android-ndk-r5b/toolchains/arm-eabi-4.4.0/prebuilt/windows/bin/arm-eabi-gcc -fPIC -DANDROID -c -o /tmp/ffconf.1kQLpGaU.o /tmp/ffconf.GlDiY1P8.c
arm-eabi-gcc.exe: /tmp/ffconf.GlDiY1P8.c: No such file or directory

arm-eabi-gcc.exe: no input files

C compiler test failed.

so, i just try test code.

// test.c code
int main(){
  return 0;
}

/android-ndk-r5b/toolchains/arm-eabi-4.4.0/prebuilt/windows/bin/arm-eabi-gcc -fPIC -DANDROID -c -o ./test.o ./test.c

ok!!!! no problem.

but, cp ./test.c /tmp (copy to /tmp)

/android-ndk-r5b/toolchains/arm-eabi-4.4.0/prebuilt/windows/bin/arm-eabi-gcc -fPIC -DANDROID -c -o ./test.o /tmp/test.c

arm-eabi-gcc.exe: /tmp/test.c: No such file or directory
arm-eabi-gcc.exe: no input files

fail!!! difference is only file path. /tmp directory exist, and permission is right. /home/test.c is same result.

what's wrong?

null
  • 89
  • 1
  • 4

6 Answers6

6

I have had a hard time to get it working in Windows, but finally I've managed to do it! The previous posts were correct - there's a problem with Cygwin paths and Windows paths. I have tried the solution described in the post above as the very first thing, but it was not working. Finally I've understand the reason: even if you put into your build_android.sh file the Windows path, the config for FFmpeg still contains the wrong path.

So in my case I have changed partially the config file in FFmpeg root directory from:

#set temporary file name
: ${TMPDIR:=$TEMPDIR} 
: ${TMPDIR:=$TMP}
: ${TMPDIR:=/tmp}

to this:

# set temporary file name
#: ${TMPDIR:=$TEMPDIR}
#: ${TMPDIR:=$TMP}
: ${TMPDIR:=D:/InstallTools/Android/Cygwin_Root/tmp}

After this, I got it compiling.

agf
  • 148,965
  • 36
  • 267
  • 227
Ivan
  • 184
  • 2
  • 14
3

You don't set the tmp directory. You can set it in /etc/profile or just in the terminal with export TMPDIR=/your/tmp/directory. Notice: 1. If you compile with cygwin, the directory must be like D:/tmp. You can't use /cygdrive/d/tmp. 2. You must have the permission of the folder.

Bryce
  • 2,048
  • 1
  • 16
  • 23
1

I could not get this to work either, I had the exact same problem. However I was able to compile using "android-ndk-r4". I am not sure at the moment what is causing the problem but if I ever get around to figuring it out I'll post that too.

So for now workaround is to use ndk r4.

Lambage
  • 227
  • 3
  • 7
1

I managed to build it, using NDK R6, cygwin. Indeed, it does not support /cydrive/ paths, simply use paths like windows; example below:

NDK=e:/AndroidSDK/NDK6
PLATFORM=$NDK/platforms/android-9/arch-arm/
PREBUILT=$NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows
agf
  • 148,965
  • 36
  • 267
  • 227
intox
  • 11
  • 1
0

If you have not solved this problem, check the last part of config.log in the ffmpeg directory; it is most likely a path or CC parameter problem.

yogihw
  • 11
  • 3
0

I have been having the exact same problem with r6. I have tried Lambage's suggestion with r4 but still could not get this to work.

I have been looking into the problem quite a lot and I think I've discovered the reason.

1)configure is calling the android cross compiler which is a windows .exe file.

2)It is calling it through cygwin which uses unix file naming conventions. E.G /cygdrive/c/directory instead of C:\directory

3)It says in the android NDK toolchain documentation that the cross compilers do NOT accept cygwin style filepaths (source: NDK/docs/STANDALONE_TOOLCHAIN.html):


5.1/ Windows support:

The Windows binaries do not depend on Cygwin. The good news is that they are thus faster, the bad news is that they do not understand the Cygwin path specification like /cygdrive/c/foo/bar (instead of C:/foo/bar).


I'm still trying to find a way to do this. If i solve it then I'll come back and edit this post...tbc

JConway
  • 569
  • 5
  • 13