requestExportSessionForVideo для PHAsset, обратный вызов никогда не вызывается - PullRequest
0 голосов
/ 24 октября 2019

код ниже для преобразования видео из альбома

PHAsset* asset = resource;
if(asset.mediaType == PHAssetMediaTypeVideo){
                NSURL* outputURL = [self generateOutputFileWithExtension:@"mp4"];
                __block AVAssetExportSession* session;
                //AVAssetExportPresetPassthrough
                if(asset){
                    dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
                    [[PHImageManager defaultManager] requestExportSessionForVideo:asset options:self.phVideoOptions exportPreset:AVAssetExportPreset960x540 resultHandler:^(AVAssetExportSession *exportSession, NSDictionary *info) {
                        session = exportSession;
                        dispatch_semaphore_signal(semaphore);
                        //never called
                    }];

                    //this is to use for waiting the session
                    dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER);
                    other codes...
                }
}

проверка журнала с консоли

error   10:29:51.963927 +0800   assetsd warning: Multiple NSEntityDescriptions claim the NSManagedObject subclass 'PLInternalResource' so +entity is unable to disambiguate.
error   10:29:51.964193 +0800   assetsd warning:     'InternalResource' (0x100b38ad0) from NSManagedObjectModel (0x100727870) claims 'PLInternalResource'.
error   10:29:51.964310 +0800   assetsd warning:     'InternalResource' (0x100fc8f30) from NSManagedObjectModel (0x100f94620) claims 'PLInternalResource'.

это происходит только с iOS 13, любая идея?

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...