= AVAssetImageGenerator(asset: movieAsset) // generate in any timelines generator.requestedTimeToleranceBefore = kCMTimeZero generator.requestedTimeToleranceAfter = kCMTimeZero // apply video transform generator.appliesPreferredTrackTransform = true generator.maximumSize = CGSizeMake(640, 640) generator.generateCGImagesAsynchronouslyForTimes(times) { (requested, image, actual, result, err) -> Void in // }