zoukankan      html  css  js  c++  java
  • 成功编译ffmpeg库 (模拟器版本)

    前言:

    最近处于离职状态,很想进同学那家公司,但是那唯一的职位必须是要会ffmpeg库的使用,我连编译都没有通过 - -,现在趁有时间整一下。

    这次只编译了模拟器版本。

    1、我把ffmpeg库放在~/Documents/下,打开终端,命令行进入Documents下,执行:

    lonelysoul:Documents Michael $ git clone git://source.ffmpeg.org/ffmpeg.git ~/ffmpeg依靠你的网速确定下载速度;

    2、下载完成之后,命令行进入ffmpeg文件夹下,执行:

    lonelysoul:ffmpeg Michael $./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/iPhoneSimulator7.1.sdk" --target-os=darwin --cc="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc" --extra-cflags="-arch i386 -mfpu=neon" --extra-ldflags="-arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk" --arch=i386 --cpu=i386 --enable-pic --disable-asm

    PS:我电脑上iOS SDK的版本是7.1

    执行以上代码时我遇到了这样的错误提示:c compiler test failed。经常查各种资料,在这里发现了问题所在,xcode5默认使用的是clang,因此修改命令,如下:

    3、lonelysoul:ffmpeg Michael $./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/iPhoneSimulator7.1.sdk" --target-os=darwin --cc="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc" --extra-cflags="-arch i386 -mfpu=neon -miphoneos-version-min=7.1" --extra-ldflags="-arch i386 -miphoneos-version-min=7.1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk" --arch=i386 --cpu=i386 --enable-pic --disable-asm

    继续执行它,经过几分钟的时间,编译结束了,我收到大概的信息如下:

    .........

    Enabled indevs:

    avfoundation lavfi

    Enabled outdevs:

    License: LGPL version 2.1 or later

    Creating config.mak, config.h, and doc/config.texi...

    WARNING: pkg-config not found, library detection may fail.

    lonelysoul:ffmpeg Michael$

    我也不知道有没有成功,只是警告而已,我也就没有去理会它,继续执行以下命令:

    5、lonelysoul:ffmpeg Michael$ make clean && make && make install

    如果不出意外,这里会非常的耗时,大概花了8分钟时间在编译

    ......

    INSTALL libavdevice/libavdevice.a

    INSTALL libavfilter/libavfilter.a

    INSTALL libavformat/libavformat.a

    INSTALL libavcodec/libavcodec.a

    INSTALL libavresample/libavresample.a

    INSTALL libswresample/libswresample.a

    INSTALL libswscale/libswscale.a

    INSTALL libavutil/libavutil.a

    ....

    最后面无任何警告和错误,这应该算编译成功。

    最后在~/Documents/ffmpeg/i386/lib/ 下可以看到有好多个静态库

     

    相关链接:

    http://blog.csdn.net/whf727/article/details/18089261

    http://stackoverflow.com/questions/6854190/ffmpeg-integration-on-iphone-ipad-project/15429359#15429359

    http://cdbit.com/read/how-to-build-ffmpeg-libraries-for-ios.html

    http://www.cnblogs.com/smileEvday/p/ffmpeg.html

    http://blog.csdn.net/nogodoss/article/details/19126651

    http://blog.csdn.net/wangwei0327/article/details/8469556

  • 相关阅读:
    在JAVA应用中远程提交MapReduce程序至Hadoop集群运行
    ImpalaJDBCDriver 500051
    在Linux上安装Python3
    MySQL导入之mysqlimport
    hadoop mapreduce的本地模式及yarn模式
    MySQL之mysqldump的使用
    MapReduce的本地运行模式(debug调试)
    09 MySQL触发器
    P3168 [CQOI2015]任务查询系统
    P4124[CQOI]手机号码
  • 原文地址:https://www.cnblogs.com/tianglin/p/3793859.html
Copyright © 2011-2022 走看看