写点什么

音视频高手课 01-Clang 交叉编译最新 FFmpeg

用户头像
Android架构
关注
发布于: 14 小时前

export NDK=/root/ndk/android-ndk-r20

当前系统

export HOST_TAG=linux-x86_64

支持的 Android CUP 架构

export ARCH=aarch64

export CPU=armv8-a

export ARCH=armv7aexport CPU=armv7-a

支持的 Android 最低系统版本

export MIN=21export ANDROID_NDK_PLATFORM=android-21


export PREFIX=CPU


export MIN_PLATFORM=MINexport SYSROOT=NDK/toolchains/llvm/prebuilt/TOOLCHAIN/bin/arm-linux-androideabi-arexport AS=TOOLCHAIN/bin/MIN-clangecho "-----------------------------"echo TOOLCHAIN/bin/MIN-clang++export LD=TOOLCHAIN/bin/arm-linux-androideabi-nmexport RANLIB=TOOLCHAIN/bin/arm-linux-androideabi-strip


OPTIMIZE_CFLAGS="-DANDROID -IMIN_PLATFORM/arch-arm/usr/lib -L$MIN_PLATFORM/arch-arm/usr/lib -no


《Android学习笔记总结+最新移动架构视频+大厂安卓面试真题+项目实战源码讲义》
浏览器打开:qq.cn.hn/FTe 免费领取
复制代码


stdlib"


sed -i "" "s/SLIBNAME_WITH_MAJOR='(LIBMAJOR)'/SLIBNAME_WITH_MAJOR='(FULLNAME)-(SLIBSUF)'/" configuresed -i "" "s/LIB_INSTALL_EXTRA_CMD='$(LIBDIR)\/(LIBDIR)\/(SLIBNAME_WITH_VERSION)'/SLIB_INSTALL_NAME='(SLIBNAME_WITH_MAJOR) (SLIBNAME)'/" configuresed -i -e 's/#define getenv(x) NULL//*#define getenv(x) NULL*//g' config.h

sed -i "" "s/SHFLAGS='-shared -Wl,-soname,(SLIBNAME)'/" configure

sed -i "" "s/-Wl//g" configure

./configure


--prefix=$PREFIX


--ar=$AR


--as=$AS


--cc=$CC


--cxx=$CXX


--nm=$NM


--ranlib=$RANLIB


--strip=$STRIP


--arch=$ARCH


--target-os=android


--enable-cross-compile


--disable-asm


--enable-shared


--disable-static


--disable-ffprobe


--disable-ffplay


--disable-ffmpeg


--disable-debug


--disable-symver


--disable-stripping


--extra-cflags="-Os -fpic $OPTIMIZE_CFLAGS"


--extra-ldflags="$ADDI_LDFLAGS"


sed -i "" "s/#define HAVE_TRUNC 0/#define HAVE_TRUNC 1/" config.hsed -i "" "s/#define HAVE_TRUNCF 0/#define HAVE_TRUNCF 1/" config.hsed -i "" "s/#define HAVE_RINT 0/#define HAVE_RINT 1/" config.hsed -i "" "s/#define HAVE_LRINT 0/#define HAVE_LRINT 1/" config.hsed -i "" "s/#define HAVE_LRINTF 0/#define HAVE_LRINTF 1/" config.hsed -i "" "s/#define HAVE_ROUND 0/#define HAVE_ROUND 1/" config.hsed -i "" "s/#define HAVE_ROUNDF 0/#define HAVE_ROUNDF 1/" config.hsed -i "" "s/#define HAVE_CBRT 0/#define HAVE_CBRT 1/" config.hsed -i "" "s/#define HAVE_CBRTF 0/#define HAVE_CBRTF 1/" config.hsed -i "" "s/#define HAVE_COPYSIGN 0/#define HAVE_COPYSIGN 1/" config.hsed -i "" "s/#define HAVE_ERF 0/#define HAVE_ERF 1/" config.hsed -i "" "s/#define HAVE_HYPOT 0/#define HAVE_HYPOT 1/" config.hsed -i "" "s/#define HAVE_ISNAN 0/#define HAVE_ISNAN 1/" config.hsed -i "" "s/#define HAVE_ISFINITE 0/#define HAVE_ISFINITE 1/" config.hsed -i "" "s/#define HAVE_INET_ATON 0/#define HAVE_INET_ATON 1/" config.hsed -i "" "s/#define getenv(x) NULL/\/\/ #define getenv(x) NULL/" config.h


复制上面的脚本代码到我们新建的文件中,打开终端,到 ffmpeg 文件下使用命令就可以进行编译


sh build.sh

用户头像

Android架构

关注

还未添加个人签名 2021.10.31 加入

还未添加个人简介

评论

发布
暂无评论
音视频高手课01-Clang交叉编译最新FFmpeg