I measure time from tens of seconds to minutes depending on the size of the video. Shouldn't this change request be quick (local copy of flash drive / metadata / checksums) as it adds local video to the photo library / camera roll? This issue occurs when iCloud backups are enabled. I could not find much useful information through web searches or apple dev docs.
Code example:
func exportAssetToPhotoLibrary(videoURL: NSURL, _ exportedAsset: (localIdentifier: String) -> Void) { var localIdentifier = "" var startTime = NSDate.timeIntervalSinceReferenceDate() PHPhotoLibrary.sharedPhotoLibrary().performChanges({ let assetRequest = PHAssetChangeRequest.creationRequestForAssetFromVideoAtFileURL(videoURL) let assetPlaceholder = assetRequest.placeholderForCreatedAsset localIdentifier = assetPlaceholder.localIdentifier }, completionHandler: { success, error in var elapsedTime: NSTimeInterval = NSDate.timeIntervalSinceReferenceDate() - startTime NSLog("exported cameo video to photo library \(elapsedTime)") exportedAsset(localIdentifier: localIdentifier) }) }
source share