gpt4 book ai didi

android - 使用 android-ndk-r14b 构建 ffmpeg 3.3

转载 作者:行者123 更新时间:2023-12-04 23:26:37 25 4
gpt4 key购买 nike

ffmpeg 的配置文件中所做的更改:

SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
LIB_INSTALL_EXTRA_CMD='$$(RANLIB) "$(LIBDIR)/$(LIBNAME)"'
SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
SLIB_INSTALL_LINKS='$(SLIBNAME)'

build_configure.sh
#!/bin/bash
######################################################
# Usage:
# put this script in top of FFmpeg source tree
# ./build_android
# It generates binary for following architectures:
# ARMv6
# ARMv6+VFP
# ARMv7+VFPv3-d16 (Tegra2)
# ARMv7+Neon (Cortex-A8)
# Customizing:
# 1. Feel free to change ./configure parameters for more features
# 2. To adapt other ARM variants
# set $CPU and $OPTIMIZE_CFLAGS
# call build_one
######################################################
NDK=$HOME/Fame/android-ndk-r14b
PLATFORM=$NDK/platforms/android-9/arch-arm/
TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64
function build_one
{
./configure --target-os=linux \
--prefix=$PREFIX \
--enable-cross-compile \
--arch=arm \
--cc=$PREBUILT/bin/arm-linux-androideabi-gcc \
--cross-prefix=$PREBUILT/bin/arm-linux-androideabi-4.9 \
--nm=$PREBUILT/bin/arm-linux-androideabi-nm \
--sysroot=$PLATFORM \
--extra-cflags=" -O3 -fpic -DANDROID -DHAVE_SYS_UIO_H=1 -Dipv6mr_interface=ipv6mr_ifindex -fasm -Wno-psabi -fno-short-enums -fno-strict-aliasing -finline-limit=300 $OPTIMIZE_CFLAGS " \
--disable-shared \
--enable-static \
--disable-everything \
--enable-demuxer=mov \
--enable-demuxer=h264 \
--disable-ffplay \
--enable-protocol=file \
--enable-avformat \
--enable-avcodec \
--enable-decoder=rawvideo \
--enable-decoder=mjpeg \
--enable-decoder=h263 \
--enable-decoder=h265 \
--enable-decoder=mpeg4 \
--enable-decoder=h264 \
--enable-parser=h264 \
--enable-parser=h265
--enabled-network \
--enable-zlib \
--disable-avfilter \
--disable-avdevice \
--disable-yasm \
--disable-ffmpeg
--disable-ffprobe
--disable-ffserver
$ADDITIONAL_CONFIGURE_FLAG

make clean
make -j4 install
$PREBUILT/bin/arm-linux-androideabi-ar d libavcodec/libavcodec.a inverse.o
$PREBUILT/bin/arm-linux-androideabi-ld -rpath-link=$PLATFORM/usr/lib -L$PLATFORM/usr/lib \
-soname libffmpeg.so -nostdlib,noexecstack -Bsymbolic \
--whole-archive --no-undefined \
-o $PREFIX/libffmpeg.so libavcodec/libavcodec.a libavformat/libavformat.a \
libavutil/libavutil.a libswscale/libswscale.a \
$PLATFORM/usr/lib/libc.so $PLATFORM/usr/lib/libm.so \
$PLATFORM/usr/lib/libz.so \
$PLATFORM/usr/lib/libdl.so $PLATFORM/usr/lib/liblog.so \
--dynamic-linker=/system/bin/linker \
$PREBUILT/lib/gcc/arm-linux-androideabi/4.9/libgcc.a
}

#arm v6
#CPU=armv6
#OPTIMIZE_CFLAGS="-marm -march=$CPU"
#PREFIX=./android/$CPU
#ADDITIONAL_CONFIGURE_FLAG=
#build_one

#arm v7vfpv3
CPU=armv7-a
OPTIMIZE_CFLAGS="-mfloat-abi=softfp -mfpu=vfpv3-d16 -marm -march=$CPU "
PREFIX=./android/$CPU
ADDITIONAL_CONFIGURE_FLAG=
build_one

#arm v7vfp
#CPU=armv7-a
#OPTIMIZE_CFLAGS="-mfloat-abi=softfp -mfpu=vfp -marm -march=$CPU "
#PREFIX=./android/$CPU-vfp
#ADDITIONAL_CONFIGURE_FLAG=
#build_one

#arm v7n
#CPU=armv7-a
#OPTIMIZE_CFLAGS="-mfloat-abi=softfp -mfpu=neon -marm -march=$CPU -mtune=cortex-a8"
#PREFIX=./android/$CPU
#ADDITIONAL_CONFIGURE_FLAG=--enable-neon
#build_one

#arm v6+vfp
#CPU=armv6
#OPTIMIZE_CFLAGS="-DCMP_HAVE_VFP -mfloat-abi=softfp -mfpu=vfp -marm -march=$CPU"
#PREFIX=./android/${CPU}_vfp
#ADDITIONAL_CONFIGURE_FLAG=
#build_one

我得到的控制台错误:
./build_android.sh

./configure: 466: ./configure: 无法创建 ffbuild/config.log: 目录不存在
./configure: 466: ./configure: 无法创建 ffbuild/config.log: 目录不存在
/bin/arm-linux-androideabi-gcc 无法创建可执行文件。
C 编译器测试失败。

最佳答案

您可以尝试使用 Standalone Toolchain .它们有助于解决为 NDK 构建第三方代码的问题。不能保证,但值得一试。

关于android - 使用 android-ndk-r14b 构建 ffmpeg 3.3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44137066/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com