ios - why is PHPhotoLibrary performChanges creationRequestForAssetFromVideoAtFileURL so slow? -


i'm measuring times tens of seconds minutes depending on size of video. shouldn't change request fast (local flash disk copy/meta data/checksums) adds local video photolibrary/camera roll? this issue appears occur when icloud backups turned on. haven't been able find helpful information through web search or apple dev docs.

sample code:

    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 photo library \(elapsedtime)")                 exportedasset(localidentifier: localidentifier)         })     } 


Comments

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

wso2esb - How to concatenate JSON array values in WSO2 ESB? -