使用android ndk r5b编译ffmpeg。
ffmpeg 0.6.1
安卓 ndk r5b
Cygwin 1.7
构建引用网址:http://www.cnblogs.com/scottwong/archive/2010/12/17/1909455.html
但是,ffmpeg ./configure 结果报错! (在 config.err 文件下面)
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.
所以,我只是尝试测试代码。
// 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
好的!!!!没问题。
但是, cp ./test.c/tmp (复制到/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
失败!!! 区别仅在于文件路径。/tmp 目录存在,权限正确。/home/test.c 是相同的结果。
怎么了?
最佳答案
我很难让它在 Windows 中运行,但我终于成功了! 之前的帖子是正确的 - Cygwin 路径和 Windows 路径存在问题。 我已经尝试了上面帖子中描述的解决方案作为第一件事,但它没有用。最后我明白了原因:即使您将 Windows 路径放入 build_android.sh 文件中,FFmpeg 的配置仍然包含错误的路径。
所以在我的例子中,我已经部分更改了 FFmpeg 根目录中的配置文件:
#set temporary file name
: ${TMPDIR:=$TEMPDIR}
: ${TMPDIR:=$TMP}
: ${TMPDIR:=/tmp}
为此:
# set temporary file name
#: ${TMPDIR:=$TEMPDIR}
#: ${TMPDIR:=$TMP}
: ${TMPDIR:=D:/InstallTools/Android/Cygwin_Root/tmp}
在此之后,我编译了它。
关于android - 用android ndk r5b编译ffmpeg,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5204251/