iOS Swift : Error Domain=NSOSStatusErrorDomain Code=-12792?
I'm trying to get video thumbnails with the following code: let asset = AVAsset(URL: url) let imageGenerator = AVAssetImageGenerator(asset: asset) imageGenerator.appliesPreferredTrackTransform = true do { let cgImage = try imgGenerator.copyCGImageAtTime(CMTimeMake(1, 30), actualTime: nil) let uiImage = UIImage(CGImage: cgImage) imageview.image = uiImage } catch let error as NSError { print("Image generation failed with error \(error)") } Sometimes it works and sometime it doesn't showing the following error: Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed