ffmpeg一键编译
来源:互联网 发布:淘宝预售不能合并付款 编辑:程序博客网 时间:2024/06/01 10:32
iOS一键编译:
#!/bin/bash############################################################################ Choose your ffmpeg version and your currently-installed iOS SDK version:#VERSION="2.5.2"SDKVERSION="8.3"echo "install gas-* perl script"./install-gas.sh############################################################################### Don't change anything under this line!############################################################################# No need to change this since xcode build will only compile in the# necessary bits from the libraries we createARCHS="armv7 armv7s arm64 i386"DEVELOPER=`xcode-select -print-path`echo "DEVELOPER: $DEVELOPER"if [ "$DEVELOPER" == "" ]; thenecho "ERROR: not found xcode"exit 1;fi#cd "`dirname \"$0\"`"REPOROOT=$(pwd)# Where we'll end up storing things in the endOUTPUTDIR="$REPOROOT/dependencies"mkdir -p $OUTPUTDIR/includemkdir -p $OUTPUTDIR/libmkdir -p $OUTPUTDIR/binBUILDDIR="$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 buildsINTERDIR="$BUILDDIR/built"mkdir -p $INTERDIR#########################################cd $SRCDIR# Exit the script if an error happensset -eif [ ! -e "./ffmpeg-$VERSION.tar.bz2" ]; thenecho "Downloading ffmpeg-$VERSION.tar.bz2" curl -LO http://ffmpeg.org/releases/ffmpeg-$VERSION.tar.bz2elseecho "Using ffmpeg-$VERSION.tar.bz2"fiif [ ! -e "./ffmpeg" ]; thentar zxf ffmpeg-$VERSION.tar.bz2 -C ./mv ffmpeg-$VERSION ffmpegelseecho "Using existing ffmpeg dir"fi#tar zxf ffmpeg-$VERSION.tar.bz2 -C $SRCDIR#cd "$SRCDIR/ffmpeg-$VERSION"cd "./ffmpeg"set +e # don't bail out of bash script if ccache doesn't existCCACHE=`which ccache`if [ $? == "0" ]; then echo "Building with ccache: $CCACHE" CCACHE="$CCACHE "else echo "Building without ccache" CCACHE=""fiset -e # back to regular "bail out on error" modefor ARCH in $ARCHSdomake clean >/dev/null && make distclean >/dev/nullif [ "${iARCH}" = "i386" ] || [ "${iARCH}" = "x86_64" ];thenPLATFORM="iPhoneSimulator" EXTRA_CONFIG="--arch=$ARCH --disable-asm --enable-cross-compile --target-os=darwin --cpu=$ARCH" EXTRA_CFLAGS="-arch $ARCH" EXTRA_LDFLAGS="-I$DEVELOPER/Platforms/$PLATFORM.platform/Developer/SDKs/$PLATFORM$SDKVERSION.sdk/usr/lib -mfpu=neon"elsePLATFORM="iPhoneOS" EXTRA_CONFIG="--arch=arm --target-os=darwin --enable-cross-compile --disable-armv5te" EXTRA_CFLAGS="-w -arch $ARCH -mfpu=neon" EXTRA_LDFLAGS="-mfpu=neon"fi mkdir -p "$INTERDIR/$ARCH"if [ "$ARCH" = "arm64" ] thenEXPORT="GASPP_FIX_XCODE5=1"fi ./configure --prefix="$INTERDIR/$ARCH" \ --disable-encoders \ --disable-muxers \ --disable-devices \ --disable-protocols \ --disable-network \ --disable-iconv \ --disable-bzlib \ --disable-asm \ --disable-armv6 \ --disable-armv6t2 \ --disable-ffmpeg \ --disable-ffplay \ --disable-ffprobe \ --disable-ffserver \ --disable-avdevice \ --disable-postproc \ --disable-avresample \ --disable-avfilter \ --disable-swscale \ --disable-swresample \ --disable-doc \ --disable-everything \ --enable-decoder=h264 \ --enable-decoder=jpeg2000 \ --enable-decoder=mpeg4 \ --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 >/dev/null done###################install iphoneos#####################mkdir -p "$INTERDIR/ios-iphoneos/lib"cd "$INTERDIR/armv7/lib"for file in *.adocd $INTERDIRxcrun -sdk iphoneos lipo -output ios-iphoneos/lib/$file -create -arch armv7 armv7/lib/$file -arch armv7s armv7s/lib/$file -arch arm64 arm64/lib/$fileecho "ios-iphoneos $file created."donecp -r $INTERDIR/armv7/include $INTERDIR/ios-iphoneos/echo "iphoneos Done." ###################build iphonesimulator#####################mkdir -p "$INTERDIR/ios-iphonesimulator/lib"cd "$INTERDIR/i386/lib"for file in *.adocd $INTERDIRxcrun -sdk iphoneos lipo -output ios-iphonesimulator/lib/$file -create -arch i386 i386/lib/$file -arch x86_64 x86_64/lib/$fileecho "ios-iphonesimulator $file created."done#cp -r $INTERDIR/i386/lib $INTERDIR/ios-iphonesimulator/cp -r $INTERDIR/i386/include $INTERDIR/ios-iphonesimulator/echo "iphonesimulator Done."
Android一键编译:
#!/bin/bash############################################################################ Choose your ffmpeg version and your currently-installed iOS SDK version:#VERSION="2.5.2"SDKVERSION="19"echo "install gas-* perl script"./install-gas.sh############################################################################### Don't change anything under this line!############################################################################# No need to change this since ndk-build will only compile in the# necessary bits from the libraries we createDEVELOPER=`which is ndk-build`DEVELOPER=`dirname $DEVELOPER`echo "NDK-PATH: $DEVELOPER"if [ "$DEVELOPER" == "" ]; thenecho "ERROR: not found ndk-build"exit 1;fiREPOROOT=$(pwd)# Where we'll end up storing things in the endOUTPUTDIR="$REPOROOT/dependencies"mkdir -p $OUTPUTDIR/includemkdir -p $OUTPUTDIR/libmkdir -p $OUTPUTDIR/binBUILDDIR="$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 buildsINTERDIR="$BUILDDIR/built"mkdir -p $INTERDIR#########################################cd $SRCDIR# Exit the script if an error happensset -eif [ ! -e "./ffmpeg-$VERSION.tar.bz2" ]; thenecho "Downloading ffmpeg-$VERSION.tar.bz2" curl -LO http://ffmpeg.org/releases/ffmpeg-$VERSION.tar.bz2elseecho "Using ffmpeg-$VERSION.tar.bz2"fiif [ ! -e "./ffmpeg" ]; thentar zxf ffmpeg-$VERSION.tar.bz2 -C ./mv ffmpeg-$VERSION ffmpegelseecho "Using existing ffmpeg dir"fi###################build android#####################cd "./ffmpeg"make clean >/dev/null && make distclean >/dev/nullSYSROOT=$DEVELOPER/platforms/android-$SDKVERSION/arch-arm/##这里要注意,如果是linux换成linux-x86_64,看你的系统情况定TOOLCHAIN=$DEVELOPER/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86_64if [ ! -e $TOOLCHAIN ]; thenecho "ERROR: not found toolchain"exit 1;fiADDI_CFLAGS="-marm"EXTRA_CONFIG="--arch=arm --target-os=linux --enable-cross-compile --disable-armv5te"EXTRA_CFLAGS="-Os -fpic $ADDI_CFLAGS"EXTRA_LDFLAGS="$ADDI_LDFLAGS"./configure --prefix="$INTERDIR/android" \ --disable-encoders \ --disable-muxers \ --disable-devices \ --disable-protocols \ --disable-network \ --disable-iconv \ --disable-bzlib \ --disable-asm \ --disable-armv6 \ --disable-armv6t2 \ --disable-ffmpeg \ --disable-ffplay \ --disable-ffprobe \ --disable-ffserver \ --disable-avdevice \ --disable-postproc \ --disable-avresample \ --disable-avfilter \ --disable-swscale \ --disable-swresample \ --disable-doc \ --disable-everything \ --enable-decoder=h264 \ --enable-decoder=jpeg2000 \ --enable-decoder=mpeg4 \ --cross-prefix=$TOOLCHAIN/bin/arm-linux-androideabi- \ $EXTRA_CONFIG \ --sysroot=$SYSROOT \ --extra-cflags="$EXTRA_CFLAGS" \ --extra-ldflags="$EXTRA_LDFLAGS" \ $ADDITIONAL_CONFIGURE_FLAG make && make install && make clean >/dev/nullecho "Android Done."
0 0
- ffmpeg一键编译
- 最新FFMPEG一键编译指南
- ffmpeg编译(一)
- ffmpeg 编译笔记(一)
- linux编译ffmpeg(一)
- 一、FFMPEG源码编译
- ffmpeg(一) android ndk编译ffmpeg
- ffmpeg浅谈 (一)编译(上)
- Ubuntu安装编译OpenCV一键脚本(带ffmpeg)
- Ubuntu安装编译OpenCV一键脚本(带FFMpeg)
- Android FFMpeg(一)——编译FFmpeg
- FFMPEG移植到android项目(一)ffmpeg的编译
- FFMPEG学习笔记一 编译安装
- ffmepg学习记录:一编译ffmpeg
- ffmpeg一键安装
- 【FFMPEG】VS2015编译FFMPEG
- 【FFMPEG】VS2013编译ffmpeg
- ffmpeg编译
- NYOJ 三个水杯
- 【BLE】CC2541之主机端读取特征值
- 208. Implement Trie (Prefix Tree)
- 2016/4/13
- uva 11129 An antiarithmetic permutation
- ffmpeg一键编译
- 计算重复字符个数
- 如何在浏览器中debug-谷歌浏览器(Google Chrome )
- 小译UnityAPI-Update,FixedUpdate ,LateUpdate
- sizeof()测试程序
- 第一章 第一个ios应用 笔记
- 【OpenCV】绘图
- android实战项目五做一个倒计时的button
- JS学习3(变量、作用域和内存)