【问题标题】:FFMPEG android compile errorFFMPEG android编译错误
【发布时间】:2014-03-16 05:09:46
【问题描述】:

我正在尝试使用 ndk 为 android 编译 ffmpeg。操作系统:Ubuntu 13.10。我跟着this 教程。但是当我运行 build_android.sh 它给了我以下错误-

sujith@Vaio:~$ cd /home/sujith/ndk9d/sources/ffmpeg
sujith@Vaio:~/ndk9d/sources/ffmpeg$ sudo chmod +x build_android.sh
[sudo] password for sujith: 
sujith@Vaio:~/ndk9d/sources/ffmpeg$ ./build_android.sh
/home/sujith/sujith/ndk9d/toolchains/arm-linux-androideabi-4.8/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 "config.log" produced by configure as this will help
solving the problem.
Makefile:2: config.mak: No such file or directory
Makefile:53: /common.mak: No such file or directory
Makefile:93: /libavutil/Makefile: No such file or directory
Makefile:93: /library.mak: No such file or directory
Makefile:95: /doc/Makefile: No such file or directory
Makefile:178: /tests/Makefile: No such file or directory
make: *** No rule to make target `/tests/Makefile'.  Stop.
Makefile:2: config.mak: No such file or directory
Makefile:53: /common.mak: No such file or directory
Makefile:93: /libavutil/Makefile: No such file or directory
Makefile:93: /library.mak: No such file or directory
Makefile:95: /doc/Makefile: No such file or directory
Makefile:178: /tests/Makefile: No such file or directory
make: *** No rule to make target `/tests/Makefile'.  Stop.
Makefile:2: config.mak: No such file or directory
Makefile:53: /common.mak: No such file or directory
Makefile:93: /libavutil/Makefile: No such file or directory
Makefile:93: /library.mak: No such file or directory
Makefile:95: /doc/Makefile: No such file or directory
Makefile:178: /tests/Makefile: No such file or directory
make: *** No rule to make target `/tests/Makefile'.  Stop.

这是我的 build_android.sh

#!/bin/bash
NDK=$HOME/sujith/ndk9d
SYSROOT=$NDK/platforms/android-9/arch-arm/
TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64
function build_one
{
 ./configure \
--prefix=$PREFIX \
--enable-shared \
--disable-static \
--disable-doc \
--disable-ffmpeg \
--disable-ffplay \
--disable-ffprobe \
--disable-ffserver \
--disable-avdevice \
--disable-doc \
--disable-symver \
--cross-prefix=$TOOLCHAIN/bin/arm-linux-androideabi- \
--target-os=linux \
--arch=arm \
--enable-cross-compile \
--sysroot=$SYSROOT \
--extra-cflags="-Os -fpic $ADDI_CFLAGS" \
--extra-ldflags="$ADDI_LDFLAGS" \
$ADDITIONAL_CONFIGURE_FLAG
make clean
make
make install
}
CPU=arm
PREFIX=$(pwd)/android/$CPU 
ADDI_CFLAGS="-marm"
build_one

我的 build_android.sh 位于 ffmpeg 源码根目录。 如何解决这个问题?请帮帮我..

【问题讨论】:

  • sourceforge.net/projects/ffmpeg4android 可能会有所帮助。
  • 同样的错误。使用 ndk32 和 ndk64。
  • config.log 中有什么错误?
  • 请确保此文件存在且可执行:/home/sujith/sujith/ndk9d/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x8‌​6_64/bin/arm-linux-androideabi -gcc
  • 报错信息是“... not found C compiler test failed”,你可以尝试手动运行上面的命令看看会发生什么。

标签: android android-ndk ffmpeg makefile


【解决方案1】:

看起来,NDK=$HOME/sujith/ndk9d 是错误的。它应该,可能,阅读

NDK=$HOME/ndk9d

【讨论】:

    【解决方案2】:
    I had the same problem , and i dig into it and found that.
    #!/bin/bash
    NDK=$HOME/sujith/ndk9d
    SYSROOT=$NDK/platforms/android-9/arch-arm/
    TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64
    
    Step 1  : Verify all the above path. 
    Step 2 :  Remove all the escape sequence and carriage return like below
    
    #!/bin/bash
    
    NDK=$HOME/FFMPEG/android-ndk/
    
    SYSROOT=$NDK/platforms/android-24/arch-arm/
    
    TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64
    
    function build_one
    
    {
    ./configure --prefix=$PREFIX --enable-shared --disable-static --disable-doc --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --disable-avdevice --disable-doc --disable-symver --cross-prefix=$TOOLCHAIN/bin/arm-linux-androideabi- --target-os=linux --arch=arm --enable-cross-compile --sysroot=$SYSROOT --extra-cflags=-Os -fpic $ADDI_CFLAGS --extra-ldflags=$ADDI_LDFLAGS $ADDITIONAL_CONFIGURE_FLAG 
    make clean
    make
    make install
    }
    
    CPU=arm
    
    PREFIX=$(pwd)/android/work
    
    ADDI_CFLAGS="-marm"
    
    build_one
    
    
    
    
    Step 3 : As i can see in the your terminal 
    sujith@Vaio:~/ndk9d/sources/ffmpeg , you have kept the code in here . 
    But i have copied the source code directly in folder sources/ 
    I didn't put the code inside any other folder. ./Configure file and build_android.sh are present in the sources/ folder with libavcodec etc folder and code. 
    
    Please try this and let me know if it solves your problem
    

    【讨论】:

      猜你喜欢
      • 2013-10-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-02-10
      • 2016-07-08
      • 2015-07-24
      • 2018-10-10
      相关资源
      最近更新 更多