nnegier
V2EX  ›  FFmpeg

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

  •  
  •   nnegier · Jul 28, 2019 · 8716 views
    This topic created in 2655 days ago, the information mentioned may be changed or developed.
    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 复制到相应位置,还是一点效果没有。

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

    有一条额外的经验
    自己 enable 的额外带依赖的编解码库的-I 和-L,-l 要放在 configure 的--extra-ldflags 参数里,不然 configure 会失败
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   4213 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 42ms · UTC 01:06 · PVG 09:06 · LAX 17:06 · JFK 20:06
    ♥ Do have faith in what you're doing.