yasirkula / UnityNativeGallery

A native Unity plugin to interact with Gallery/Photos on Android & iOS (save and/or load images/videos)
MIT License
1.4k stars 199 forks source link

GetVideoThumbnail return error occasionally in iPhoneX and iPhone12 #225

Open snowyao opened 2 years ago

snowyao commented 2 years ago

In iphone, when I try to get a thumbnail with GetVideoThumbnail after video saved, occasionally it will return this error in iphonex and iphone12 2021-09-30 13:31:04.305268+0800 [401:33558] Error generating video thumbnail: Error Domain=AVFoundationErrorDomain Code=-11832 "Can not open" UserInfo={NSLocalizedFailureReason=can not use this meida。, NSLocalizedDescription=Can not open, NSUnderlyingError=0x280c18870 {Error Domain=NSOSStatusErrorDomain Code=-12431 "(null)"}}

yasirkula commented 2 years ago

Is this error consistent for those videos? Are they special in any way? For example, are they the only videos that are larger than 1 GB or on the cloud?

snowyao commented 2 years ago

It's small video(less than 10 seconds), nothing special compare to other successful call. I will record and save the video to devices then get its thumbnail. Most of the time will be successful, but will fail occasionally. By the way, even the thumbnail returns failure, but the related video can be played.

yasirkula commented 2 years ago

Hmm, is it possible that the recording you are saving to the device isn't fully saved while you try to get the thumbnail? Some operations can be asynchronous and it's possible that saving the recording is one of them. How about you wait 10 seconds after saving the video, just for testing purposes, and then fetch the thumbnail?