1.C compiler test failed.
原因:compile-ffmpeg.sh all 命令找不到 Xcode
解决办法:
compile-ffmpeg.sh clean #重置清理编译环境
sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/Contents/Developer
compile-ffmpeg.sh all
2./libavutil/arm/asm.S:50:9: error: unknown directive
原因:编译armv7库失败
解决办法:
1.删除compile-ffmpeg.sh FF_ALL_ARCHS_IOS8_SDK="armv7 arm64 i386 x86_64" 中的armv7改为FF_ALL_ARCHS_IOS8_SDK="arm64 i386 x86_64"
编译成功后的到的库不支持armv7框架,项目支持armv7会报错。
2.修改tools文件夹中的do-compile-ffmpeg.sh文件
将下面代码:
elif [ "$FF_ARCH" = "armv7" ]; then
FF_BUILD_NAME="ffmpeg-armv7"
FF_BUILD_NAME_OPENSSL=openssl-armv7
FF_XCRUN_OSVERSION="-miphoneos-version-min=6.0"
FF_XCODE_BITCODE="-fembed-bitcode"
FFMPEG_CFG_FLAGS="$FFMPEG_CFG_FLAGS $FFMPEG_CFG_FLAGS_ARM"
# FFMPEG_CFG_CPU="--cpu=cortex-a8"
elif [ "$FF_ARCH" = "armv7s" ]; then
修改为:
elif [ "$FF_ARCH" = "armv7" ]; then
FF_BUILD_NAME="ffmpeg-armv7"
FF_BUILD_NAME_OPENSSL=openssl-armv7
FF_XCRUN_OSVERSION="-miphoneos-version-min=6.0"
FF_XCODE_BITCODE="-fembed-bitcode"
# FFMPEG_CFG_FLAGS="$FFMPEG_CFG_FLAGS $FFMPEG_CFG_FLAGS_ARM"
FFMPEG_CFG_FLAGS="$FFMPEG_CFG_FLAGS --enable-pic --disable-asm"
# FFMPEG_CFG_CPU="--cpu=cortex-a8"
elif [ "$FF_ARCH" = "armv7s" ]; then
然后compile-ffmpeg.sh clean 重置,从新执行compile-ffmpeg.sh all命令