我正在使用AVAssetWriter将一系列图像编码为电影文件,参考了Zoul的答案(如何将UIImage数组导出为电影?)。
简而言之,我的处理过程是:
谢谢, Alexander
- 从.png文件创建UIImage
- 从UIImage获取CGImage
- 使用zoul的函数pixelBufferFromCGImage将CGImage转换为CVPixelBuffer
- 使用AVAssetWriterInputPixelBufferAdaptor和AVAssetWriter将帧写入.mov
谢谢, Alexander
电影截图: http://tinypic.com/view.php?pic=8wkqys&s=7
原始图片:http://commons.wikimedia.org/wiki/File:Phalaenopsis_(aka).jpg