How to Build FFMpeg as iOS Framework

2019-02-15 07:35发布

问题:

I'm trying to build my own Player base on FFMpeg,

I succes to build FFMpeg as static library(*.a),

but its need to copy another header file to use,

I hope it can used like framework,

but even I add header file into framework (set as public)

My Demo App can not find .h file in FFMpeg.framework,

is there any suggestion or tutorial can help me to build it as real framework?

Thanks

回答1:

Yes because there is proper procedure to setup FFMPEG in project.

Please follow procedure in below link.

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

1) First Download FFmpeg From github.

2) Then just copy folder in your project directory.

3) Then Add it into your project with Add file option in xcode.

Note:- Below library must be added in your Project.

and don't forget to set HEADER SEARCH PATH in Build Setting option.

Try to compile.

You will find example for FFMPEG in below link,

1) ffmpegc-demo

2) kxmovie (Best to use ffmpeg)

still you need to add ffmpeg in this demo also. else you will get error for headerfile missing or library missing or etc.



回答2:

I've included several C libraries into an iOS project. The way to do it, I think is to add the .a file to the Build Phases > Link Binary With Library, and drag your .a file there. If you compiled ffmpeg from source, there should be a header file. For your .h file, make sure you update the Library Search Path in Build Settings.

Also, if you are using the ffmpeg api's, maybe getting the libavcodec, libavformat, and libavscale libraries, as these are what the main ffmpeg program uses.



标签: ios xcode ffmpeg