簡體   English   中英

FFMPEG Android編譯錯誤

[英]FFMPEG android compile error

我正在嘗試使用ndk為Android編譯ffmpeg。 os:ubuntu 13.10。 我遵循了教程。 但是當我運行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源根目錄中。 如何解決? 請幫我..

看起來, NDK=$HOME/sujith/ndk9d是錯誤的。 它可能應該閱讀

NDK=$HOME/ndk9d
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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM