在iOS上使用ffmpeg

我知道要在iOS应用程序中使用FFmpeg,您可以使用./configure和make来生成将添加到项目中的.a文件。

我的问题是,一旦.a文件出现在项目导航器和链接库中的二进制文件部分,你如何在你的类中实际使用它们,我发现在#import语句中没有使用“框架” ,所以我不知道如何访问类的方法和属性。

您只需将头文件(.h)导入到您的实现(.m)文件中并继续。 举个例子 ;

#import "avformat.h" // Some code goes here /* * avformat_open_input(AVFormatContext **ps, const char *filename, AVInputFormat *fmt, AVDictionary **options) */ int openInputValue = avformat_open_input(&pFormatCtx, utf8FilePath, inputFormat, nil); NSLog(@"%s - %d # openInputValue = %d", __PRETTY_FUNCTION__, __LINE__, openInputValue); 

每个.a文件都有一些实现文件,每个实现文件都有一个接口文件,objc -c实现文件是.m / .mm,接口文件是.h,如C / C ++,所以如果你想使用库,你需要导入头文件(.h)。 头文件可以告诉你类的方法和属性