Compile ffmpeg for iOS 6, support Simulator & armv7 & armv7s

In the posts, I will show how to use ffmpeg on iOS.

 

This posts is a document for this project: 

https://github.com/lvjian700/ffmpegc-demo

 

Now, ffmpec support x264 module. If you use the script before, please check your version first. 

 

What is ffmpeg ?

FFmpeg is a complete, across-platform solution to record, convert and stream audio and video. 

Why use ffmpeg?

  • Play h.264 video
  • encoding capture video to h.264 video(It need ffmpeg h.264 module.)
  • publish a av stream
  • subscribe a rtsp av stream

Before use ffmpegc-demo, you should download and compile ffmpeg:

I made a repository to make the step easy:
git clone git@github.com:lvjian700/ffmpegc.git
cd ffmpegc
./install-ffmpeg.sh
  https://github.com/lvjian700/ffmpegc

If compile complete, you can find universal library in ffmpeg/build folder:

1. ffmpeg core library:

 
2. ffmpeg x264 module. x264 is a H.264/MPEG-4 AVC encoder 

 

Using ffmpeg

1. Clone project first:

git@github.com:lvjian700/ffmpegc-demo.git

2.Open in XCode and copy build/*.a and x264/build/*.a to libs/ folder of the project:


 

3. Add them to project link library

Project References -> Targets -> Build Phases -> Link Binary With Librarys


 

4. Add dependences library:

Project References -> Targets -> Build Phases -> Link Binary With Librarys
Add two library:
  • libbz.dylib
  • libz.dylib
  • libiconv.2.4.0.dylib

 

5. Add Header Search Paths:

Project References -> Targets -> Build Settings ->  Header Search Paths
1. add ffmpeg core header paths:

 
2. add x264 header paths:

 
 

 

6. Now, run project ...

 

Some useful document:

《How to prepare your mac for ios development with ffmpeg libraries》

《ffmpeg configure options》 -pdf

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值