ios 如何使用 AVAssetWriter?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3728311/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How do I use AVAssetWriter?
提问by zoul
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. From the docs it looks like I need an input (AVAssetWriterInput
) to feed the writer from. 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…? Am I missing something obvious here?
我想拍摄一些视频帧并将它们编码成视频。看起来这正是它的AVAssetWriter
意思,但无论我如何查看文档和谷歌,我都找不到任何实际使用它的方法。从文档看来,我需要一个输入 ( AVAssetWriterInput
) 来为作者提供信息。美好的。但是这个AVAssetWriterInput
类是抽象的,我在 4.1 中所知道的唯一子类是它的初始值设定项AVAssetWriterInputPixelBufferAdaptor
中需要 a AVAssetWriterInput
......?我在这里遗漏了一些明显的东西吗?