FFmpeg 在 Ubuntu 下的编译问题?实在不明,特来求助

2019-07-28 15:40:34 +08:00
 nnegier
me@ubuntu:~/Android/Sdk/ndk-bundle/sources/ffmpeg$ ./build_ffmpeg.sh
/home/me/Android/Sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc is unable to create an executable file.
C compiler test failed.

If you think configure made a mistake, make sure you are using the latest
version from Git.  If the latest version fails, report the problem to the
ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "ffbuild/config.log" produced by configure as this will help
solve the problem.
Makefile:163: /tests/Makefile: No such file or directory
make: *** No rule to make target '/tests/Makefile'.  Stop.
Makefile:163: /tests/Makefile: No such file or directory
make: *** No rule to make target '/tests/Makefile'.  Stop.
Makefile:163: /tests/Makefile: No such file or directory
make: *** No rule to make target '/tests/Makefile'.  Stop.

报错:C compiler test failed.

NDK:android-ndk-r20-linux-x86_64.zip

FFmpeg:4.1.4 (目前最新)

网上的方法我尝试了个遍,没有成功,什么解锁啦,什么乱七八糟的都试了。

我自己的方法也试了,因为 linux-androideabi-gcc 这个文件在目录中没有,我下载了老版本 NDK(android-ndk-r15c-linux-x86_64.zip),将里面的 linux-androideabi-gcc 复制到相应位置,还是一点效果没有。

7255 次点击
所在节点    FFmpeg
15 条回复
fgodt
2019-07-28 16:04:57 +08:00
用 r12b 来编译吧,相对简单点
pursuer
2019-07-28 19:51:55 +08:00
没编译过 ffmpeg,这个是交叉编译吧,报错没办法创建可以执行的程序,交叉编译创建不了 native 可执行程序的。看下怎么交叉编译 ffmpeg ?
nnegier
2019-07-28 19:59:15 +08:00
@fgodt 失败,还是报错
nnegier
2019-07-28 19:59:56 +08:00
@pursuer 放弃,准备直接拿别人编译好的用,只不过 4.1.4 两周前才发布,这个版本不好找
hmoe
2019-07-28 21:27:29 +08:00
https://www.johnvansickle.com/ffmpeg/ 这里应该是最新的
fgodt
2019-07-28 23:06:04 +08:00
报错看下 ffbuild/config.log 里面的信息,一般是环境配置问题,找不到 gcc 或者什么的。r20 用的 clang 你用低一点的版本才有 gcc
B4a1n
2019-07-28 23:21:58 +08:00
别编译了 试试
apt-get install software-properties-common python-software-properties
add-apt-repository ppa:jonathonf/ffmpeg-4
apt-get update
apt-get install ffmpeg
ReZer0
2019-07-28 23:58:15 +08:00
我不知道你那是不是有特定依赖一定要编译,不然可以用官网提供的静态文件,下载后直接运行就行,弄个环境变量就能用了。
ReZer0
2019-07-28 23:59:33 +08:00
就是 5 楼的那个地址。
xmoiduts
2019-07-28 23:59:53 +08:00
想当年(三年前)刚买了千万云学生机,想要个 ffmpeg 就到处去找也找不到。后来……静态编译文件真香。
mumbler
2019-07-29 00:04:08 +08:00
不用编译,直接用二进制版
https://www.moerats.com/archives/719/
bunnyblueair
2019-07-29 07:25:13 +08:00
R20 把 gcc 废弃了 只能用 clang,难道你不看 change log?
orannge
2019-07-29 07:38:55 +08:00
你的编译脚本过时了,现在网上大部分教程都是按旧版本来的,用 r20 得改成用 clang 编译。
binlaten
2019-07-29 08:04:19 +08:00
r20 用的 clang,但是最新的 ffmpeg 不支持 clang 编译。
blindmt
2019-07-29 09:04:04 +08:00
前几天编译了 ffmpeg,版本是 4.1.4,用的是 r15c,抄 github 上别人的编译脚本一把过,基本没有什么问题。
然后编了一把 libvpx,r15c 编不了,因为是用 clang 编译的,所以弄了个 r20 编过了。
再之后我把 ffmpeg 的 libvpx 给 enable 了,就出现了各种爆炸的问题,虽然最后也是 ok 了。

有一条额外的经验
自己 enable 的额外带依赖的编解码库的-I 和-L,-l 要放在 configure 的--extra-ldflags 参数里,不然 configure 会失败

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/586898

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX