• ffmpeg 编译IOS静态库


    我使用的配置:xcode4.5,IOS6.0,ipad 1(4.3)

    一、准备资源

    1. 到https://github.com/gabriel/ffmpeg-iphone-build下载ffmpeg-iphone-build
    2.先将gas-preprocessor.pl拷贝到/usr/sbin/目录中。
    3.到这里下载最新的ffmpeg:http://ffmpeg.org/download.html    或者命令行安装:git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg

    二、编译

    4.然后到命令行下到ffmpeg的目录下,执行:

    下面的命令中,在mac10.8系统下把/Developer/Platforms/iPhoneOS.platform/这样的路径替换成/Applications/Xcode4_5.app/Contents/Developer/Platforms/iPhoneOS.platform/,也就是xcode安装路径。

    ./configure \

    --cc=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc \

    --as='gas-preprocessor.pl /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc' \

    --sysroot=/Applications/Xcode4_4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk \

    --extra-ldflags=-L/Applications/Xcode4_4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/usr/lib/system \

    --target-os=darwin \

    --arch=arm \

    --cpu=cortex-a8 \

    --extra-cflags='-arch armv7' \

    --extra-ldflags='-arch armv7' \

    --enable-pic \

    --enable-cross-compile \

    --enable-ffmpeg \

    --disable-ffplay \

    --disable-ffserver \

    --disable-asm \

    --disable-doc \

    --disable-encoders \

    --disable-debug

     //

    ./configure --cc=/Applications/Xcode4_5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc --as='gas-preprocessor.pl /Applications/Xcode4_5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc' --sysroot=/Applications/Xcode4_5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk --extra-ldflags=-L/Applications/Xcode4_5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk/usr/lib/system --target-os=darwin --arch=arm --cpu=cortex-a8 --extra-cflags='-arch armv7' --extra-ldflags='-arch armv7' --enable-pic --enable-cross-compile --enable-ffmpeg --disable-ffplay --disable-ffserver --disable-asm --disable-doc --disable-encoders

    //精简

    ./configure --cc=/Applications/Xcode4_5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc --as='gas-preprocessor.pl /Applications/Xcode4_5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc' --sysroot=/Applications/Xcode4_5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk --extra-ldflags=-L/Applications/Xcode4_5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk/usr/lib/system --target-os=darwin --arch=arm --cpu=cortex-a8 --extra-cflags='-arch armv7' --extra-ldflags='-arch armv7'   --enable-cross-compile --disable-pic --disable-encoders --disable-decoders --disable-muxers --disable-demuxers --disable-debug --disable-doc --disable-asm --disable-ffserver --disable-ffplay --disable-avfilter --disable-avdevice --enable-decoder=mpeg4 --enable-decoder=aac --enable-decoder=h264 --enable-demuxer=mpegvideo  --enable-demuxer=mov

     

    5.执行sudo make,如果给代码做了修改,就先sudo make clean

    6.执行sudo make install

    三、使用

    7.在你的工程根目录下创建一个叫ffmpeg的文件夹,把/usr/local/lib和/usr/local/include放进去

    8.工程中设置header search path :"$(SRCROOT)/ffmpeg/include",library search path:"$(SRCROOT)/ffmpeg/lib"

    9.添加libbz2.1.0和libz.1.2.5引用

    网上实例:https://github.com/lajos/iFrameExtractor

  • 相关阅读:
    Chrome应用商店打不开解决方法
    vue中的列表项删除操作
    markdown(语法)入门学习:
    利用插件(jQuery-ui.js)实现表格行的拖拽排序
    div拖拽互换位置(vue)
    MarkDown学习
    经典算法精讲精练之回溯法求解0-1背包问题
    读书笔记——《谁说菜鸟不会数据分析—Python篇》
    读书笔记之《统计之美:人工智能时代的科学思维》
    读书笔记之《漫画算法:小灰的算法之旅》
  • 原文地址:https://www.cnblogs.com/bandy/p/2914635.html
Copyright © 2020-2023  润新知