开发者

Creating a movie file of a animation with avassetwriter

I have a animation created using normal core animation methods. If there any way to create a movie file using avassetwriter? Ive seen other que开发者_Python百科stions which show the how to use avassetwriter to create a movie using images, but i would like to create a movie using a animation created with core animation.

Thank in advance


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).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜