MovingPictures is a flexible library for turning images into movies.
/// Create your imageTimes
let imageTimes: [ImageTime] = [(image1, 1.5), (image2, 0.3)]
/// Create the settings for your video
let settings = RenderSettings(size: images1.size, videoFilename: "foo")
/// Make a new instance of MovingPictures
let writer = MovingPictures(settings: settings)
/// Render your images
writer.render(imageTimes) { (result: Result<NSURL, NSError>) in
do {
let url = try result.dematerialize()
/// You now have the video's url and can do whatever with it...
} catch {
/// Figure out what went wrong and react accordingly
}
}
To run the example project, clone the repo, and run pod install
from the Example directory first.
MovingPictures is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "MovingPictures"
tsabend, [email protected]
This code was inspired by the answers in http://stackoverflow.com/questions/3741323/how-do-i-export-uiimage-array-as-a-movie. Thanks to Scott Raposa and Praxiteles.
MovingPictures is available under the MIT license. See the LICENSE file for more info.