V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
nnegier
V2EX  ›  FFmpeg

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

  •  
  •   nnegier · 2019-07-28 15:40:34 +08:00 · 7235 次点击
    这是一个创建于 1726 天前的主题,其中的信息可能已经有所发展或是发生改变。
    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
    [email protected] 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 复制到相应位置,还是一点效果没有。

    第 1 条附言  ·  2019-08-09 14:16:17 +08:00
    这个是 NDK 配置错误,可能是路径错了。我已经解决了
    15 条回复    2019-07-29 09:04:04 +08:00
    fgodt
        1
    fgodt  
       2019-07-28 16:04:57 +08:00
    用 r12b 来编译吧,相对简单点
    pursuer
        2
    pursuer  
       2019-07-28 19:51:55 +08:00   ❤️ 1
    没编译过 ffmpeg,这个是交叉编译吧,报错没办法创建可以执行的程序,交叉编译创建不了 native 可执行程序的。看下怎么交叉编译 ffmpeg ?
    nnegier
        3
    nnegier  
    OP
       2019-07-28 19:59:15 +08:00
    @fgodt 失败,还是报错
    nnegier
        4
    nnegier  
    OP
       2019-07-28 19:59:56 +08:00
    @pursuer 放弃,准备直接拿别人编译好的用,只不过 4.1.4 两周前才发布,这个版本不好找
    hmoe
        5
    hmoe  
       2019-07-28 21:27:29 +08:00
    https://www.johnvansickle.com/ffmpeg/ 这里应该是最新的
    fgodt
        6
    fgodt  
       2019-07-28 23:06:04 +08:00
    报错看下 ffbuild/config.log 里面的信息,一般是环境配置问题,找不到 gcc 或者什么的。r20 用的 clang 你用低一点的版本才有 gcc
    B4a1n
        7
    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
        8
    ReZer0  
       2019-07-28 23:58:15 +08:00 via Android
    我不知道你那是不是有特定依赖一定要编译,不然可以用官网提供的静态文件,下载后直接运行就行,弄个环境变量就能用了。
    ReZer0
        9
    ReZer0  
       2019-07-28 23:59:33 +08:00 via Android
    就是 5 楼的那个地址。
    xmoiduts
        10
    xmoiduts  
       2019-07-28 23:59:53 +08:00 via Android
    想当年(三年前)刚买了千万云学生机,想要个 ffmpeg 就到处去找也找不到。后来……静态编译文件真香。
    mumbler
        11
    mumbler  
       2019-07-29 00:04:08 +08:00 via Android
    不用编译,直接用二进制版
    https://www.moerats.com/archives/719/
    bunnyblueair
        12
    bunnyblueair  
       2019-07-29 07:25:13 +08:00 via Android
    R20 把 gcc 废弃了 只能用 clang,难道你不看 change log?
    orannge
        13
    orannge  
       2019-07-29 07:38:55 +08:00
    你的编译脚本过时了,现在网上大部分教程都是按旧版本来的,用 r20 得改成用 clang 编译。
    binlaten
        14
    binlaten  
       2019-07-29 08:04:19 +08:00 via Android
    r20 用的 clang,但是最新的 ffmpeg 不支持 clang 编译。
    blindmt
        15
    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 会失败
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3059 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 14:44 · PVG 22:44 · LAX 07:44 · JFK 10:44
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.