收藏 分销(赏)

模拟器与真机下ffmpeg的编译方法.doc

上传人:s4****5z 文档编号:8055114 上传时间:2025-02-02 格式:DOC 页数:5 大小:30KB 下载积分:10 金币
下载 相关 举报
模拟器与真机下ffmpeg的编译方法.doc_第1页
第1页 / 共5页
模拟器与真机下ffmpeg的编译方法.doc_第2页
第2页 / 共5页


点击查看更多>>
资源描述
模拟器与真机下ffmpeg的编译方法(总结版)    编译ffmepg模拟器版本: 1. 到 2.先将gas-preprocessor.pl拷贝到/usr/sbin/目录中。 3.到ffmpeg官网上下载ffmpeg源码 4.在终端下定位到ffmpeg的目录运行 ./configure --disable-doc --disable-ffmpeg --disable-ffplay --disable-ffserver --disable-avfilter --disable-debug --disable-encoders --enable-cross-compile --disable-decoders --disable-armv5te --enable-decoder=h264 --enable-pic --cc=/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc --as='gas-preprocessor/gas-preprocessor.pl /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc' --extra-ldflags=-L/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/usr/lib/system --sysroot=/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk --target-os=darwin --arch=i386 --cpu=i386 --extra-cflags='-arch i386' --extra-ldflags='-arch i386' 5.输入make命令 6.将libavcodec.a,libavdevice.a,libavformat.a,libavutil.a,libswscale.a到对应的目录下拷贝出来。 7.在项目中就可以使用了。可以参考开源示例iFrameExtractor (git clone git:// 8.注意如果使用的是ffmpeg0.8.5的库的话iFrameExtractor中的codec_type需要修改为AVMEDIA_TYPE_VIDEO。(下同) 编译arm7版本,网上搜到的版本,完全按照以下步骤做就行了。可以编译出arm7的库。 1. 下载: git clone git:// 2. 编辑: build_armv6和build_armv7,修改./configure后面的参数,主要是SDK版本.我的是4.3,修改为: ./configure --disable-doc --disable-ffmpeg --disable-ffplay --disable-ffserver --enable-cross-compile --arch=arm --target-os=darwin --cc=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc --as='gas-preprocessor/gas-preprocessor.pl /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc' --sysroot=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk --cpu=arm1176jzf-s --extra-cflags='-arch armv6' --extra-ldflags='-arch armv6' 3. 编译: 出错,提示: /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc is unable to create an executable file. C compiler test failed. 查看config.err文件,最后提示: ld: file not found: /usr/lib/system/libcache.dylib for architecture armv7 collect2: ld returned 1 exit status 4. 重新修改configure参数为: ./configure --disable-doc --disable-ffmpeg --disable-ffplay --disable-ffserver --enable-cross-compile --arch=arm --target-os=darwin --cc=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc --as='gas-preprocessor/gas-preprocessor.pl /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc' --sysroot=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk --cpu=cortex-a8 --extra-cflags='-arch armv7' --extra-ldflags='-arch armv7 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk' --enable-pic 5. 编译: build_armv7 最后生成静态库,在lib目录和armv7目录. 6.用xcode打开iFrameExtractor.xcodeproj,现在编译会出错,需要修改几个地方: 左边选中工程,中间选中target,右面选中Build settings,在Architectures选项卡里面选择Architetures为Optimized(armv7),Base SDK为Latest iOS(iOS 4.3) Valid Architectures填写armv7. 编译目标选择iOS Device,当然,如果有连接电脑的设备,可以选择设备. 编译,提示: Undefined symbols for architecture armv7:   "_BZ2_bzDecompressInit", referenced from:       _matroska_decode_buffer in libavformat.a(matroskadec.o)   "_BZ2_bzDecompressEnd", referenced from:       _matroska_decode_buffer in libavformat.a(matroskadec.o)   "_BZ2_bzDecompress", referenced from:       _matroska_decode_buffer in libavformat.a(matroskadec.o) 添加库libbz2.1.0.dylib,再次编译,OK通过 在ios5.0中编译ffmpeg。 到官网下载ffmpeg,然后在终端进入ffmpeg ./configure --disable-doc --disable-ffmpeg --disable-ffplay --disable-ffserver --enable-cross-compile --arch=arm --target-os=darwin --cc=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc --as='gas-preprocessor/gas-preprocessor.pl /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc' --sysroot=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk --cpu=cortex-a8 --extra-cflags='-arch armv7' --extra-ldflags='-arch armv7 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk' --enable-pic --enable-decoder=rawvideo --disable-asm make进行编译。 然后将各个.a文件拷贝出来。
展开阅读全文

开通  VIP会员、SVIP会员  优惠大
下载10份以上建议开通VIP会员
下载20份以上建议开通SVIP会员


开通VIP      成为共赢上传

当前位置:首页 > 百科休闲 > 其他

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        抽奖活动

©2010-2026 宁波自信网络信息技术有限公司  版权所有

客服电话:0574-28810668  投诉电话:18658249818

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :微信公众号    抖音    微博    LOFTER 

客服