在Mac 10.8上安装ffmpeg ios库armv7、armv7s、i386和universal

在Mac 10.8上安装ffmpeg ios库armv7、armv7s、i386和universal,ios,ffmpeg,Ios,Ffmpeg,如何在Mac with 10.8上安装最新的ffmpeg ios库armv7、armv7s、i386和universal?几天后,我为此次安装做了逐步说明: FFmpeg构建说明MAC 10.8或更高版本 复制ffmpeg-2.0.tar.bz2(,)并解压缩到Documents文件夹 确保在Xcode>下有最新的命令行工具;偏好>;下载>;组成部分 安装气体预处理器 点击ZIP图标下载 将gas-preprocessor.pl复制到/usr/bin目录 通过将权限设置为读取和写入所有,更改ga

如何在Mac with 10.8上安装最新的ffmpeg ios库armv7、armv7s、i386和universal?

几天后,我为此次安装做了逐步说明:

FFmpeg构建说明MAC 10.8或更高版本

复制ffmpeg-2.0.tar.bz2(,)并解压缩到Documents文件夹


确保在Xcode>下有最新的命令行工具;偏好>;下载>;组成部分

安装气体预处理器

  • 点击ZIP图标下载
  • 将gas-preprocessor.pl复制到/usr/bin目录
  • 通过将权限设置为读取和写入所有,更改gas-preprocessor.pl的权限
  • 从10.8版开始的xcrun中的错误

    打开端子并粘贴以下命令,然后按enter键:

    export DEVELOPER_DIR="/Applications/Xcode.app/Contents/Developer/"
    
    mkdir armv7
    mkdir armv7s
    mkdir i386
    mkdir -p universal/lib
    
    ./configure --prefix=armv7s --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --enable-avresample --enable-cross-compile --sysroot="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk" --target-os=darwin --cc="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc" --extra-cflags="-arch armv7s -mfpu=neon -miphoneos-version-min=6.1" --extra-ldflags="-arch armv7s -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk -miphoneos-version-min=6.1" --arch=arm --cpu=cortex-a9 --enable-pic
    
    make clean && make && make install
    
    ./configure --prefix=i386 --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --enable-avresample --enable-cross-compile --sysroot="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk" --target-os=darwin --cc="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc" --extra-cflags="-arch i386" --extra-ldflags="-arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk" --arch=i386 --cpu=i386 --enable-pic --disable-asm
    
    make clean && make && make install
    
    cd armv7/lib
    for file in *.a
    do
    cd ../..
    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."
    cd -
    done
    cd ../..
    
    将cd粘贴到ffmpeg-2文件夹,并粘贴到以下命令中,然后按enter键:

    export DEVELOPER_DIR="/Applications/Xcode.app/Contents/Developer/"
    
    mkdir armv7
    mkdir armv7s
    mkdir i386
    mkdir -p universal/lib
    
    ./configure --prefix=armv7s --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --enable-avresample --enable-cross-compile --sysroot="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk" --target-os=darwin --cc="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc" --extra-cflags="-arch armv7s -mfpu=neon -miphoneos-version-min=6.1" --extra-ldflags="-arch armv7s -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk -miphoneos-version-min=6.1" --arch=arm --cpu=cortex-a9 --enable-pic
    
    make clean && make && make install
    
    ./configure --prefix=i386 --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --enable-avresample --enable-cross-compile --sysroot="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk" --target-os=darwin --cc="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc" --extra-cflags="-arch i386" --extra-ldflags="-arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk" --arch=i386 --cpu=i386 --enable-pic --disable-asm
    
    make clean && make && make install
    
    cd armv7/lib
    for file in *.a
    do
    cd ../..
    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."
    cd -
    done
    cd ../..
    
    要在以下命令中配置armv7s库粘贴,请按enter键:

    export DEVELOPER_DIR="/Applications/Xcode.app/Contents/Developer/"
    
    mkdir armv7
    mkdir armv7s
    mkdir i386
    mkdir -p universal/lib
    
    ./configure --prefix=armv7s --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --enable-avresample --enable-cross-compile --sysroot="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk" --target-os=darwin --cc="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc" --extra-cflags="-arch armv7s -mfpu=neon -miphoneos-version-min=6.1" --extra-ldflags="-arch armv7s -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk -miphoneos-version-min=6.1" --arch=arm --cpu=cortex-a9 --enable-pic
    
    make clean && make && make install
    
    ./configure --prefix=i386 --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --enable-avresample --enable-cross-compile --sysroot="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk" --target-os=darwin --cc="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc" --extra-cflags="-arch i386" --extra-ldflags="-arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk" --arch=i386 --cpu=i386 --enable-pic --disable-asm
    
    make clean && make && make install
    
    cd armv7/lib
    for file in *.a
    do
    cd ../..
    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."
    cd -
    done
    cd ../..
    
    (注意与上面相同的规则:如果配置失败,请转到 Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/ 如果没有更改,请确保sdk文件夹为iPhoneOS6.1.sdk config命令以反映iPhoneOSx.x.sdk并更改所有目标 至x.x)

    要构建和安装armv7s库,请粘贴以下命令并按enter键:

    export DEVELOPER_DIR="/Applications/Xcode.app/Contents/Developer/"
    
    mkdir armv7
    mkdir armv7s
    mkdir i386
    mkdir -p universal/lib
    
    ./configure --prefix=armv7s --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --enable-avresample --enable-cross-compile --sysroot="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk" --target-os=darwin --cc="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc" --extra-cflags="-arch armv7s -mfpu=neon -miphoneos-version-min=6.1" --extra-ldflags="-arch armv7s -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk -miphoneos-version-min=6.1" --arch=arm --cpu=cortex-a9 --enable-pic
    
    make clean && make && make install
    
    ./configure --prefix=i386 --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --enable-avresample --enable-cross-compile --sysroot="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk" --target-os=darwin --cc="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc" --extra-cflags="-arch i386" --extra-ldflags="-arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk" --arch=i386 --cpu=i386 --enable-pic --disable-asm
    
    make clean && make && make install
    
    cd armv7/lib
    for file in *.a
    do
    cd ../..
    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."
    cd -
    done
    cd ../..
    
    要配置i386(以便模拟器工作),请粘贴以下命令并按enter键:

    export DEVELOPER_DIR="/Applications/Xcode.app/Contents/Developer/"
    
    mkdir armv7
    mkdir armv7s
    mkdir i386
    mkdir -p universal/lib
    
    ./configure --prefix=armv7s --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --enable-avresample --enable-cross-compile --sysroot="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk" --target-os=darwin --cc="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc" --extra-cflags="-arch armv7s -mfpu=neon -miphoneos-version-min=6.1" --extra-ldflags="-arch armv7s -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk -miphoneos-version-min=6.1" --arch=arm --cpu=cortex-a9 --enable-pic
    
    make clean && make && make install
    
    ./configure --prefix=i386 --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --enable-avresample --enable-cross-compile --sysroot="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk" --target-os=darwin --cc="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc" --extra-cflags="-arch i386" --extra-ldflags="-arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk" --arch=i386 --cpu=i386 --enable-pic --disable-asm
    
    make clean && make && make install
    
    cd armv7/lib
    for file in *.a
    do
    cd ../..
    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."
    cd -
    done
    cd ../..
    
    (注意:这与前两个配置命令不同。) 命令,如果向上箭头指向这些命令,则将失败)

    要构建和安装i386库,请粘贴以下命令并按enter键:

    export DEVELOPER_DIR="/Applications/Xcode.app/Contents/Developer/"
    
    mkdir armv7
    mkdir armv7s
    mkdir i386
    mkdir -p universal/lib
    
    ./configure --prefix=armv7s --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --enable-avresample --enable-cross-compile --sysroot="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk" --target-os=darwin --cc="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc" --extra-cflags="-arch armv7s -mfpu=neon -miphoneos-version-min=6.1" --extra-ldflags="-arch armv7s -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk -miphoneos-version-min=6.1" --arch=arm --cpu=cortex-a9 --enable-pic
    
    make clean && make && make install
    
    ./configure --prefix=i386 --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --enable-avresample --enable-cross-compile --sysroot="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk" --target-os=darwin --cc="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc" --extra-cflags="-arch i386" --extra-ldflags="-arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk" --arch=i386 --cpu=i386 --enable-pic --disable-asm
    
    make clean && make && make install
    
    cd armv7/lib
    for file in *.a
    do
    cd ../..
    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."
    cd -
    done
    cd ../..
    
    要使通用库(即添加到xcode的库)粘贴到以下命令中,请按enter键:

    export DEVELOPER_DIR="/Applications/Xcode.app/Contents/Developer/"
    
    mkdir armv7
    mkdir armv7s
    mkdir i386
    mkdir -p universal/lib
    
    ./configure --prefix=armv7s --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --enable-avresample --enable-cross-compile --sysroot="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk" --target-os=darwin --cc="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc" --extra-cflags="-arch armv7s -mfpu=neon -miphoneos-version-min=6.1" --extra-ldflags="-arch armv7s -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk -miphoneos-version-min=6.1" --arch=arm --cpu=cortex-a9 --enable-pic
    
    make clean && make && make install
    
    ./configure --prefix=i386 --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --enable-avresample --enable-cross-compile --sysroot="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk" --target-os=darwin --cc="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc" --extra-cflags="-arch i386" --extra-ldflags="-arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk" --arch=i386 --cpu=i386 --enable-pic --disable-asm
    
    make clean && make && make install
    
    cd armv7/lib
    for file in *.a
    do
    cd ../..
    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."
    cd -
    done
    cd ../..
    

    支持iOS7和XCode5的通用ffmpeg库:


    确保在Xcode>下有最新的命令行工具;偏好>;下载>;组成部分

    安装气体预处理器

  • 点击ZIP图标下载
  • 将gas-preprocessor.pl复制到/usr/bin目录
  • 通过将权限设置为读取和写入所有,更改gas-preprocessor.pl的权限
  • 从以下位置下载我的shell脚本:

  • 运行
    sh build ffmpeg.sh

  • 我需要arm64支持,这个脚本对我很有用:

    使用

    适用于iOS 64位和模拟器体系结构。然后将“fat”目录中的内容复制到您的Xcode项目中

    我对脚本所做的唯一修改是取消对这一行的注释:

    CONFIGURE_FLAGS="$CONFIGURE_FLAGS --enable-avresample"
    
    编译libavresample库


    编辑:它不适用于armv7和armv7s,但使用的是iOS 7.1 SDK。如果我找到了解决方案,我将在这里发布。

    用于构建您可以使用的ffmpeg iOS库

  • 下载ffmpeg源代码
  • 下载
  • 打开终端并运行导出FFSRC=/path/to/ffmpeg
  • 转到
    构建\u ffmpeg
    文件夹并运行:
    /ios.sh
  • 成功构建后,结果将显示在
    sdk ios
    文件夹中
  • 在Xcode项目中添加include文件夹和lib文件夹

  • 这将使它更容易阅读。您可以突出显示文本并点击ctrl+k或command+k(我想),或者单击文本框上方的代码按钮(看起来像
    {}
    )。您可以添加对iOS7的支持吗?我尝试在ffmpeg2.2和gas预处理器中使用上述说明,但是,我只得到了静态libs文件(我可以从中创建可执行文件吗?),我哪里都没看到ffmpeg。。。?我应该从配置中删除禁用ffmpeg吗?你能详细说明每个参数的含义吗?如果我只想从一种音频文件格式转换成另一种格式?(或将立体声合并到单声道?)我应该使用什么设置来配置上述脚本?我希望二进制输出尽可能小……太棒了,我为此浪费了很多时间DAlso请检查运行此脚本的目录路径是否不包含空格。我收到此错误
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc无法创建可执行文件。C编译器测试失败。
    GCC在Xcode5中明显贬值。我很不确定下一步该怎么办。请确保您在Xcode>下拥有最新的命令行工具;偏好>;下载>;Component我也收到了Joseph Toronto的问题,我似乎正在使用最新的5.1.1命令行工具。我可以从4.x和5.x中进行选择。请参考这篇文章,它将对您有所帮助:您不应该将armv7和armv7s添加到命令行脚本中吗?