compile ffmpeg with android ndk r5b

null picture null · Mar 5, 2011 · Viewed 8.4k times · Source

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?

Answer

Ivan picture Ivan · Aug 12, 2011

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.