[英]How do I use AVAssetWriter?
I'd like to take some video frames and encode them into a video. 我想拍摄一些视频帧并将它们编码成视频。 It looks like that's exactly what
AVAssetWriter
was meant for, but no matter how I eyeball the docs and Google I can't find any way to actually use it. 看起来这正是
AVAssetWriter
意思,但无论我如何看待文档和谷歌我都找不到任何方法来实际使用它。 From the docs it looks like I need an input ( AVAssetWriterInput
) to feed the writer from. 从文档中看起来我需要一个输入(
AVAssetWriterInput
)来从中提供AVAssetWriterInput
。 Fine. 精细。 But the
AVAssetWriterInput
class is abstract and the only subclass that I know of in 4.1 is AVAssetWriterInputPixelBufferAdaptor
that requires a AVAssetWriterInput
in its initializer…? 但是
AVAssetWriterInput
类是抽象的,我在4.1中知道的唯一子类是AVAssetWriterInputPixelBufferAdaptor
,它需要在其初始化程序中使用AVAssetWriterInput
......? Am I missing something obvious here? 我错过了一些明显的东西吗?
是的,我必须使用+[AVAssetWriterInput assetWriterInputWithMediaType:outputSettings:]
获取一个实例,请参阅我的帖子,在一个不同的问题下获取详细的代码示例。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.