我想为android平台构建ffmpeg源代码。
我已经按照一些教程,但构建失败了。
这是我的配置
build_android.sh文件
#!/bin/bash
NDK=/Users/***/Library/Android/ndk/android-ndk-r14b
SYSROOT=$NDK/platforms/android-19/arch-arm/
TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-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)/androidtest/$CPU
ADDI_CFLAGS="-marm"
build_one
配置文件
我还更改了configure
文件
更改
SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)'
LIB_INSTALL_EXTRA_CMD='$$(RANLIB) "$(LIBDIR)/$(LIBNAME)"'
SLIB_INSTALL_NAME='$(SLIBNAME_WITH_VERSION)'
SLIB_INSTALL_LINKS='$(SLIBNAME_WITH_MAJOR) $(SLIBNAME)'
到
SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
LIB_INSTALL_EXTRA_CMD='$$(RANLIB)"$(LIBDIR)/$(LIBNAME)"'
SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
SLIB_INSTALL_LINKS='$(SLIBNAME)'
... INSTALL doc/examples/demuxing_decoding.c INSTALL doc/examples/encode_audio.c INSTALL doc/examples/encode_video.c INSTALL doc/examples/extract_mvs.c INSTALL doc/examples/filter_audio.c INSTALL doc/examples/filtering_audio.c INSTALL doc/examples/filtering_video.c INSTALL doc/examples/http_multiclient.c INSTALL doc/examples/hw_decode.c INSTALL doc/examples/metadata.c INSTALL doc/examples/muxing.c INSTALL doc/examples/qsvdec.c INSTALL doc/examples/remuxing.c INSTALL doc/examples/resampling_audio.c INSTALL doc/examples/scaling_video.c INSTALL doc/examples/transcode_aac.c INSTALL doc/examples/transcoding.c INSTALL doc/examples/vaapi_encode.c INSTALL doc/examples/vaapi_transcode.c INSTALL doc/examples/README INSTALL doc/examples/Makefile INSTALL libavdevice/libavdevice.a /bin/sh: ranlib/usr/local/lib/libavdevice.a: No such file or directory make: *** [install-libavdevice-static] Error 127
答案 0 :(得分:1)
我也遇到了同样的问题。虽然它已经解决了,但我仍然不知道具体原因。 使用在Android Studio和ffmpeg 4.0中下载的NDK时遇到此错误。解决方案是用3.3.7版本替换ffmepg并重新下载rd版本的ndk而不是使用Android studio中提供的版本。希望这对你有用。 ndk下载链接
答案 1 :(得分:0)