ios8.1下编译ffmpeg-创新互联
先说步骤吧。郝萌主倾心贡献,尊重作者的劳动成果,请勿转载。
我们提供的服务有:成都网站建设、成都网站设计、微信公众号开发、网站优化、网站认证、茄子河ssl等。为上1000+企事业单位解决了网站和推广的问题。提供周到的售前咨询和贴心的售后服务,是有科学管理、有技术的茄子河网站制作公司如果文章对您有所帮助,欢迎给作者捐赠,支持郝萌主,捐赠数额随意,重在心意^_^
我要捐赠: 点击捐赠
Cocos2d-X×××:点我传送
一:下载gas-preprocessor.pl.并把它粘贴到usr/bin或者usr/sbin都可以。
有同学是不是发现没有usr这个文件夹?
mac os x隐藏文件夹 自己去搜索怎么找出来。
然后有个权限 cd到usr/bin下 chmod +x gas-preprocessor.pl.
二:shell 命令符进行编译
ios8及其更高系统shell脚本如下
#!/bin/bash
###########################################################################
# Choose your ffmpeg version and your currently-installed iOS SDK version:
#
VERSION="2.0.2"
SDKVERSION="8.1"
ARCHS="armv7 armv7s i386"
#
#
###########################################################################
#
# Don't change anything under this line!
#
###########################################################################
DEVELOPER=`xcode-select -print-path`
cd "`dirname \"$0\"`"
REPOROOT=$(pwd)
# Where we'll end up storing things in the end
OUTPUTDIR="${REPOROOT}/dependencies"
mkdir -p ${OUTPUTDIR}/include
mkdir -p ${OUTPUTDIR}/lib
mkdir -p ${OUTPUTDIR}/bin
BUILDDIR="${REPOROOT}/build"
mkdir -p $BUILDDIR
# where we will keep our sources and build from.
SRCDIR="${BUILDDIR}/src"
mkdir -p $SRCDIR
# where we will store intermediary builds
INTERDIR="${BUILDDIR}/built"
mkdir -p $INTERDIR
########################################
cd $SRCDIR
# Exit the script if an error happens
set -e
if [ ! -e "${SRCDIR}/ffmpeg-${VERSION}.tar.bz2" ]; then
echo "Downloading ffmpeg-${VERSION}.tar.bz2"
curl -LO http://ffmpeg.org/releases/ffmpeg-${VERSION}.tar.bz2
else
echo "Using ffmpeg-${VERSION}.tar.bz2"
fi
tar jxf ffmpeg-${VERSION}.tar.bz2 -C $SRCDIR
cd "${SRCDIR}/ffmpeg-${VERSION}"
set +e # don't bail out of bash script if ccache doesn't exist
CCACHE=`which ccache`
if [ $? == "0" ]; then
echo "Building with ccache: $CCACHE"
CCACHE="${CCACHE} "
else
echo "Building without ccache"
CCACHE=""
fi
set -e # back to regular "bail out on error" mode
for ARCH in ${ARCHS}
do
if [ "${ARCH}" == "i386" ];
then
PLATFORM="iPhoneSimulator"
EXTRA_CONFIG="--arch=i386 --disable-asm --enable-cross-compile --target-os=darwin --cpu=i386"
EXTRA_CFLAGS="-arch i386"
EXTRA_LDFLAGS="-I${DEVELOPER}/Platforms/${PLATFORM}.platform/Developer/SDKs/${PLATFORM}${SDKVERSION}.sdk/usr/lib -mfpu=neon"
else
PLATFORM="iPhoneOS"
EXTRA_CONFIG="--arch=arm --target-os=darwin --enable-cross-compile --cpu=cortex-a9 --disable-armv5te"
EXTRA_CFLAGS="-w -arch ${ARCH} -mfpu=neon"
EXTRA_LDFLAGS="-mfpu=neon"
fi
mkdir -p "${INTERDIR}/${ARCH}"
./configure --prefix="${INTERDIR}/${ARCH}" --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --disable-iconv --disable-bzlib --enable-avresample --disable-asm --sysroot="${DEVELOPER}/Platforms/${PLATFORM}.platform/Developer/SDKs/${PLATFORM}${SDKVERSION}.sdk" --cc="${DEVELOPER}/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" --as='/usr/local/bin/gas-preprocessor.pl' --extra-cflags="${EXTRA_CFLAGS} -miphoneos-version-min=${SDKVERSION} -I${OUTPUTDIR}/include" --extra-ldflags="-arch ${ARCH} ${EXTRA_LDFLAGS} -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/${PLATFORM}.platform/Developer/SDKs/${PLATFORM}${SDKVERSION}.sdk -miphoneos-version-min=${SDKVERSION} -L${OUTPUTDIR}/lib" ${EXTRA_CONFIG} --enable-pic --extra-cxxflags="$CPPFLAGS -I${OUTPUTDIR}/include -isysroot ${DEVELOPER}/Platforms/${PLATFORM}.platform/Developer/SDKs/${PLATFORM}${SDKVERSION}.sdk"
make && make install && make clean
done
mkdir -p "${INTERDIR}/universal/lib"
cd "${INTERDIR}/armv7/lib"
for file in *.a
do
cd ${INTERDIR}
xcrun -sdk iphoneos lipo -output universal/lib/$file -create -arch armv7 armv7/lib/$file -arch armv7s armv7s/lib/$file -arch i386 i386/lib/$file
echo "Universal $file created."
done
cp -r ${INTERDIR}/armv7/include ${INTERDIR}/universal/
echo "Done."ios7,ios6系统脚本如下:
#!/bin/bash
另外有需要云服务器可以了解下创新互联scvps.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。
分享标题:ios8.1下编译ffmpeg-创新互联
文章路径:http://myzitong.com/article/discji.html