因此,我试图在Ubuntu上从源代码构建FFmpeg。这是我从这里到那里组装的脚本:
#!/bin/bash
NDK=$HOME/Desktop/adt/android-ndk-r19b
SYSROOT=$NDK/platforms/android-26/arch-arm/
TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64
function build_one
{
./configure
--prefix=$PREFIX
--arch=arm
--target-os=linux
--enable-cross-compile
--cross-prefix=$TOOLCHAIN/bin/arm-linux-androideabi-
--sysroot=$SYSROOT
--extra-cflags="-Os -fpic $ADDI_CFLAGS"
--extra-ldflags="$ADDI_LDFLAGS"
$ADDITIONAL_CONFIGURE_FLAG
make clean
make -j9
make install
}
CPU=arm
PREFIX=$(pwd)/android/$CPU
ADDI_CFLAGS="-marm"
build_one
不幸的是,我得到以下输出的列表:
ffbuild/config.sh is unchanged
./build_android_2.sh: line 26: --prefix=/home/maxest/Desktop/adt/android-ndk-r19b/sources/ffmpeg-4.1/android/arm: No such file or directory
./build_android_2.sh: line 27: --arch=arm: command not found
./build_android_2.sh: line 28: --target-os=linux: command not found
./build_android_2.sh: line 29: --enable-cross-compile: command not found
./build_android_2.sh: line 30: --cross-prefix=/home/maxest/Desktop/adt/android-ndk-r19b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-: No such file or directory
./build_android_2.sh: line 31: --sysroot=/home/maxest/Desktop/adt/android-ndk-r19b/platforms/android-26/arch-arm/: No such file or directory
./build_android_2.sh: line 32: --extra-cflags=-Os -fpic -marm: command not found
./build_android_2.sh: line 34: --extra-ldflags=: command not found
我已经仔细检查了所有路径是否正确。尽管我手动创建了文件夹/home/maxest/Desktop/adt/android-ndk-r19b/sources/ffmpeg-4.1/android/arm
,因为没有文件夹android/arm
。