首页 技术 正文
技术 2022年11月14日
0 收藏 468 点赞 3,738 浏览 2952 个字

编译模拟器版本
1 到https://github.com/yuvi/gas-preprocessor下载gas-preprocessor.p并拷贝到/usr/sbin目录中
2 下载ffmpeg源码。
http://ffmpeg.org/download.html
https://github.com/FFmpeg/FFmpeg
3 解压源码,cd到源码目录下
4 创建文件config_i386.sh,其内容如下

ffmpeg iOS  编译

#!/bin/tcsh -f
set targetDir="../ffmpeg-libs/i386"
if (! -d $targetDir ) mkdir $targetDirrm -f $targetDir/*.amake clean#./configure --arch=i386 --extra-cflags='-arch i386' --extra-ldflags='-arch i386' --disable-encoders --disable-debug --disable-mmx./configure \
--cc=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc \
--as='gas-preprocessor.pl /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc' \
--nm="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/nm" \
--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.0.sdk \
--target-os=darwin \
--arch=i386 \
--cpu=i386 \
--extra-cflags='-arch i386 -miphoneos-version-min=4.3 -mdynamic-no-pic' \
--extra-ldflags='-arch i386 -miphoneos-version-min=4.3 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.0.sdk' \
--prefix=compiled/i386 \
--enable-cross-compile \
--enable-nonfree \
--enable-gpl \
--disable-armv5te \
--disable-swscale-alpha \
--disable-doc \
--disable-ffmpeg \
--disable-ffplay \
--disable-ffprobe \
--disable-ffserver \
--disable-asm \
--disable-debugmakemv libavcodec/libavcodec.a $targetDir
mv libavdevice/libavdevice.a $targetDir
mv libavformat/libavformat.a $targetDir
mv libavutil/libavutil.a $targetDir
mv libswscale/libswscale.a $targetDir

ffmpeg iOS  编译

5 执行config_i386.sh进行配置和编译
编译完成后,可以在$targetDir找到相应的静态库文件

编译真机版
前3步同上
第4步:创建文件config_armv7,其内容如下

ffmpeg iOS  编译

#!/bin/tcsh -f
set targetDir="../ffmpeg-libs/armv7"
if (! -d $targetDir ) mkdir $targetDirrm -f $targetDir/*.amake clean./configure \
--cc=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc \
--as='gas-preprocessor.pl /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc' \
--nm="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/nm" \
--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk \
--target-os=darwin \
--arch=arm \
--cpu=cortex-a8 \
--extra-cflags='-arch armv7 -miphoneos-version-min=4.3 -mdynamic-no-pic' \
--extra-ldflags='-arch armv7 -miphoneos-version-min=4.3 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk' \
--prefix=compiled/armv7 \
--enable-cross-compile \
--enable-nonfree \
--enable-gpl \
--disable-armv5te \
--disable-swscale-alpha \
--disable-doc \
--disable-ffmpeg \
--disable-ffplay \
--disable-ffprobe \
--disable-ffserver \
--disable-asm \
--disable-debugmakemv libavcodec/libavcodec.a $targetDir
mv libavformat/libavformat.a $targetDir
mv libavutil/libavutil.a $targetDir
mv libswscale/libswscale.a $targetDir

ffmpeg iOS  编译

第5步:
执行config_armv7进行配置和编译,编译完成后可以在$targetDir找到相应的静态库文件

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,085
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,560
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,409
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,182
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,819
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,902