新版本ffmpeg编译

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

    博客分类:
  • iphone & ipad
iOS ffmpeg

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:
Shell代码   收藏代码
  1. git clone [email protected]:lvjian700/ffmpegc.git  
  2. cd ffmpegc  
  3. ./install-ffmpeg.sh  
  https://github.com/lvjian700/ffmpegc

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

1. ffmpeg core library:
新版本ffmpeg编译_第1张图片
 
2. ffmpeg x264 module. x264 is a H.264/MPEG-4 AVC encoder 
新版本ffmpeg编译_第2张图片
 

Using ffmpeg

1. Clone project first:

Java代码   收藏代码
  1. 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:

新版本ffmpeg编译_第3张图片
 

3. Add them to project link library

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

新版本ffmpeg编译_第4张图片
 

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
新版本ffmpeg编译_第5张图片
 

5. Add Header Search Paths:

Project References -> Targets -> Build Settings ->  Header Search Paths
1. add ffmpeg core header paths:
新版本ffmpeg编译_第6张图片
 
2. add x264 header paths:
新版本ffmpeg编译_第7张图片
 
 

 

6. Now, run project ...

 

Some useful document:

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

《ffmpeg configure options》 -pdf


http://www.cocoachina.com/bbs/read.php?tid=142628

你可能感兴趣的:(新版本ffmpeg编译)