ffmpeg:如何从NSData设置AVFormatContext

SUK*_*AKI 5 cocoa ffmpeg objective-c

我在Objective-C中使用FFmpeg库.

我想从NSData设置包含imagedata的AVFormatContext.我知道我可以用av_open_input_file()设置AVFormatContext.所以将NSData的内容写入临时文件,我可以这样做.


[data writeToFile:@"./temp.mov" atomically:YES];
av_open_input_file(&pFormatCtx, "./temp.mov", NULL, 0, NULL);

.
.
.

NSFileManager *fm = [NSFileManager defaultManager];
[fm removeFileAtPath:@"./temp.mov" handler:nil];
Run Code Online (Sandbox Code Playgroud)

但是,我不想使用临时文件.

有谁知道聪明的方式?

抱歉,我的英语不好.

谢谢