zoukankan      html  css  js  c++  java
  • iOS下编译ffmpeg

    网络上搜索“ios ffmpeg 编译”,文章一大把,但我编译还是费了很大的功夫才编译成功。很多文章只是把步骤列了出来,但是每个人的系统环境,或者程序版本都不一样,结果出现各种的错误。我把自己编译过程中碰到错误以及解决办法写出来,希望有需要的朋友少走弯路。

    1、下载ffmpegc-master包

    ffmpegc-master github链接:https://github.com/lvjian700/ffmpegc 

    包里面已经包含了install-gas.sh和install-ffmpeg.sh两个脚本

    2、根据自己系统环境修改install-ffmpeg.sh脚本文件

     打开install-ffmpeg.sh,脚本前面有两个变量:

    VERSION="2.0.2"

    SDKVERSION="7.1"

    第一个是要编译的ffmpeg版本号,编译时,脚本会自动下载相应的版本,例如2.2,2.3都可以。

    第二个是本地编译环境ios系统版本号。

    如果不知道自己ios版本号,可以finder打开目录/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/

    里面应该会有类似iPhoneOS7.1.sdk或者iPhoneOS8.1.sdk的包,修改SDKVERSION成对应的sdk版本即可。

    3、运行install-gas.sh

    4、运行install-ffmpeg.sh

    一般情况下会顺利编译,大概10分钟编译完成,最后显示Done。

    5、编译demo 

    kxmovie: https://github.com/kolyvan/kxmovie

    dmeo下载https://github.com/lvjian700/ffmpegc-demo

    图解使用说明:
     
    项目中设置:
    Build Settings-
    Architectures:armv7(根据自己的系统环境修改,这一项很重要)
    Build Active Architecture Only:Yes
    Library search paths:ffmpeg/i386/lib
    User Header Search Paths:ffmpeg/armv7/include
    Build Phases-
    Link Binary with libraries:加入ffmpeg/i386/lib下所有文件。
    把ffmpeg/armv7/include整个文件夹附加到项目
     
    模拟器上用i386,真机上是armv的,真机还分armv6 和armv7
     
    6、编译过程遇到的问题
     
  • 相关阅读:
    hdu2328 Corporate Identity
    hdu1238 Substrings
    hdu4300 Clairewd’s message
    hdu3336 Count the string
    hdu2597 Simpsons’ Hidden Talents
    poj3080 Blue Jeans
    poj2752 Seek the Name, Seek the Fame
    poj2406 Power Strings
    hust1010 The Minimum Length
    hdu1358 Period
  • 原文地址:https://www.cnblogs.com/JayK/p/4111898.html
Copyright © 2011-2022 走看看