0

I have an array of images that I am passing to this class:

https://github.com/jberlana/iOSKenBurns

This basically takes all of the images and builds a slideshow from them and then adds an automatic and random ken burns effect.

Everything works awesome; however, I am now trying to add the ability to export the slide show to a movie file. There will be just a simple button to accomplish this, but I have no idea where to start for turning this into a video.

I have found this: QTMovie Class Reference which is EXACTLY what I'm looking for (compile array of images into a movie file), but I need to retain the ken burns effect the class has added, and I don't know if this applied to iOS either.

Not really sure if this is even possible, or what to do with it. Any help would be great, at least a point in the right direction! Thanks in advance!

Kyle Begeman
  • 7,169
  • 9
  • 40
  • 58
  • Hrm this might be tricky. The approach I would use is to "capture" the newly transformed images at a certain frame rate and then stich these "screenshots" into a video. The ken burns library seems to just be applying transforms on images and animating this effect, no new images are being created. Perhaps look into capturing a core graphics context into a UIImage. Not sure if this is the best approach but it's the first thing that springs to mind. Perhaps this can get you in the right direction: http://stackoverflow.com/questions/2200736/how-to-take-a-screenshot-programmatically – nebs Jan 20 '13 at 23:28

1 Answers1

0

The QTMovie class does not function under iOS. You can take a look at an example Xcode project I created to show off this sort of movie composition logic in my library, the Xcode project is at AVRender. This example creates a lossless output file that basically contains all the images as frames of video. If you want to actually convert that to h.264 when finished, there is another example on that same page named AVDecodeEncode that shows how to do that and play the results with AVPlayer. You could also roll your own code to do all this using the AVAssets API under iOS, but be warned that those APIs are not simple to use.

MoDJ
  • 4,309
  • 2
  • 30
  • 65