iOS平台编译FFmpeg最新版

本文介绍如何在iOS平台上编译FFmpeg及其依赖库x264编码器。通过提供的Shell脚本,读者可以了解到具体的编译配置选项,包括支持的架构、链接库路径等。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

记录以下编译iOS平台ffmepg的脚本
首先需要编译x264编码器,脚本如下:

#!/bin/sh
CC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang ./configure --host=arm-apple-darwin --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.4.sdk --extra-cflags='-arch arm64' --extra-ldflags='-arch arm64 -L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.4.sdk/usr/lib/system' --disable-asm --enable-pic --enable-shared --enable-static --prefix=/Users/lee/Desktop/x264/arm64out

然后编译ffmpeg ,我编译的时候ffmpeg版本为2.7.2
脚本如下:

#!/bin/sh
./configure --enable-libx264 --enable-gpl --extra-cflags=-I/Users/lee/Desktop/x264/arm64out/include --extra-ldflags=-L/Users/lee/Desktop/x264/arm64out/lib --disable-doc --disable-ffmpeg --disable-ffplay --disable-ffserver --disable-avfilter --disable-debug --disable-decoders --enable-cross-compile --disable-encoders --disable-armv5te  --enable-libx264 --enable-encoder=libx264 --enable-pic --cc=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang --as='gas-preprocessor/gas-preprocessor.pl /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang' --extra-ldflags='-arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.4.sdk' --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.4.sdk --target-os=darwin --arch=arm64 --extra-cflags='-arch arm64' --disable-asm --prefix=/Users/lee/Desktop/ffmpeg-2.7.2/arm64out

然后就是make make install etc..

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值