Creating a movie file of a animation with avassetwriter

自作多情 提交于 2019-12-03 09:29:32
invalidname

Run a timer (or whatever) to periodically convert the animation's CALayer to a UIImage (see here), then write that image to the AVAssetWriter as seen in the other examples you cite. You'll also need to keep track of elapsed time, because ultimately what you're trying to do is set up a call to -[AVAssetWriterPixelBufferAdapter appendPixelBuffer:atPresentationTime:].

I did a talk a few months back that did regular screen grabs and made a movie of it, called VTM_ScreenRecorder.zip. Only difference for you might be that my code is getting the window's CALayer, and you seem to be interested in some other layer (the one you're animating).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!