使用 android ndk r5b 编译 ffmpeg
使用 android ndk r5b 编译 ffmpeg。
ffmpeg 0.6.1
android ndk r5b
cygwin 1.7
构建参考 url : 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 是相同的结果。
怎么了?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
我很难让它在 Windows 中运行,但最终我成功了!
之前的帖子是正确的 - Cygwin 路径和 Windows 路径存在问题。
我首先尝试了上面帖子中描述的解决方案,但它不起作用。最后我明白了原因:即使您将 Windows 路径放入 build_android.sh 文件中,FFmpeg 的配置仍然包含错误的路径。
因此,就我而言,我已将 FFmpeg 根目录中的配置文件部分从: 更改
为:
此后,我对其进行了编译。
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:
to this:
After this, I got it compiling.
您没有设置 tmp 目录。您可以在 /etc/profile 中设置它,也可以在终端中使用
export TMPDIR=/your/tmp/directory
进行设置。注意:
1、如果用cygwin编译,目录必须是D:/tmp这样的。您不能使用/cygdrive/d/tmp。
2.您必须拥有该文件夹的权限。
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.
我也无法让它工作,我遇到了完全相同的问题。但是我能够使用“android-ndk-r4”进行编译。我目前不确定是什么原因导致了这个问题,但如果我有时间弄清楚它,我也会发布它。
所以现在的解决方法是使用 ndk r4。
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.
我成功地使用 NDK R6、cygwin 构建了它。确实,它不支持/cydrive/路径,只需使用像windows这样的路径;下面的例子:
I managed to build it, using NDK R6, cygwin. Indeed, it does not support /cydrive/ paths, simply use paths like windows; example below:
如果还没有解决这个问题,请检查ffmpeg目录下config.log的最后部分;这很可能是路径或 CC 参数问题。
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.
我在 r6 上也遇到了完全相同的问题。我已经尝试过 Lambage 的 r4 建议,但仍然无法使其工作。
我已经对这个问题进行了很多研究,我想我已经找到了原因。
1)configure正在调用android交叉编译器,它是一个windows .exe文件。
2)它通过cygwin调用它,它使用unix文件命名约定。 EG /cygdrive/c/directory 而不是 C:\directory
3)它在 android NDK 工具链文档中说交叉编译器不接受 cygwin 样式文件路径(来源:NDK/docs/STANDALONE_TOOLCHAIN.html):
5.1/ Windows 支持:
Windows 二进制文件不依赖于 Cygwin。好消息是他们
因此速度更快,坏消息是他们不理解 Cygwin
路径规范如 /cygdrive/c/foo/bar (而不是 C:/foo/bar)。
我仍在努力寻找一种方法来做到这一点。如果我解决了它,我会回来编辑这篇文章......tbc
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