简体   繁体   English

如何将FFMpeg构建为iOS框架

[英]How to Build FFMpeg as iOS Framework

I'm trying to build my own Player base on FFMpeg, 我正在尝试在FFMpeg上构建我自己的Player,

I succes to build FFMpeg as static library(*.a), 我成功地将FFMpeg构建为静态库(* .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, 我的演示应用程序在FFMpeg.framework中找不到.h文件,

is there any suggestion or tutorial can help me to build it as real framework? 是否有任何建议或教程可以帮助我将其构建为真正的框架?

Thanks 谢谢

Yes because there is proper procedure to setup FFMPEG in project. 是的,因为有适当的程序在项目中设置FFMPEG。

Please follow procedure in below link. 请按照以下链接中的步骤操作。

Compile ffmpeg for iOS 6, support Simulator & armv7 & armv7s 为iOS 6编译ffmpeg,支持Simulator&armv7和armv7s

1) First Download FFmpeg From github. 1)首先从github下载FFmpeg

2) Then just copy folder in your project directory. 2)然后只需复制项目目录中的文件夹即可。

3) Then Add it into your project with Add file option in xcode. 3)然后使用xcode中的Add file选项将其添加到项目中。

在此输入图像描述

Note:- Below library must be added in your Project. 注意: - 必须在项目中添加以下库。

在此输入图像描述

and don't forget to set HEADER SEARCH PATH in Build Setting option. 并且不要忘记在Build Setting选项中设置HEADER SEARCH PATH

在此输入图像描述

Try to compile. 尝试编译。

You will find example for FFMPEG in below link, 您将在下面的链接中找到FFMPEG的示例,

1) ffmpegc-demo 1) ffmpegc-demo

2) kxmovie (Best to use ffmpeg) 2) kxmovie (最好用ffmpeg)

still you need to add ffmpeg in this demo also. 你还需要在这个演示中添加ffmpeg。 else you will get error for headerfile missing or library missing or etc. 否则你会得到错误的标题文件丢失或库丢失等。

I've included several C libraries into an iOS project. 我在iOS项目中包含了几个C库。 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. 这样做的方法,我想是将.a文件添加到Build Phases> Link Binary With Library,并将你的.a文件拖到那里。 If you compiled ffmpeg from source, there should be a header file. 如果您从源代码编译ffmpeg,则应该有一个头文件。 For your .h file, make sure you update the Library Search Path in Build Settings. 对于.h文件,请确保更新“构建设置”中的“库搜索路径”。

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. 此外,如果您正在使用ffmpeg api,可能会获得libavcodec,libavformat和libavscale库,因为这些是主要的ffmpeg程序使用的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM