Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

对这个导出视频的逻辑有点疑问? #1536

Closed
Will-ZJ opened this issue Sep 27, 2021 · 6 comments
Closed

对这个导出视频的逻辑有点疑问? #1536

Will-ZJ opened this issue Sep 27, 2021 · 6 comments

Comments

@Will-ZJ
Copy link

Will-ZJ commented Sep 27, 2021

- (void)getVideoOutputPathWithAsset:(PHAsset *)asset presetName:(NSString *)presetName timeRange:(CMTimeRange)timeRange success:(void (^)(NSString *outputPath))success failure:(void (^)(NSString *errorMessage, NSError *error))failure {
    if (@available(iOS 14.0, *)) {
        [self requestVideoOutputPathWithAsset:asset presetName:presetName timeRange:timeRange success:success failure:failure];
        return;
    }
    [[PHImageManager defaultManager] requestAVAssetForVideo:asset options:[self getVideoRequestOptions] resultHandler:^(AVAsset* avasset, AVAudioMix* audioMix, NSDictionary* info){
        // NSLog(@"Info:\n%@",info);
        AVURLAsset *videoAsset = (AVURLAsset*)avasset;
        // NSLog(@"AVAsset URL: %@",myAsset.URL);
        [self startExportVideoWithVideoAsset:videoAsset timeRange:timeRange presetName:presetName success:success failure:failure];
    }];
}

请问这个源码中iOS14.0的处理方式的依据是什么?我看这两个逻辑调用的系统api的有效版本是一致的

@banchichen
Copy link
Owner

不是一样的呀...
iOS以上的requestVideoOutputPathWithAsset调了requestExportSessionForVideo
以下的是requestAVAssetForVideo

背景见:#1397

@Will-ZJ
Copy link
Author

Will-ZJ commented Sep 28, 2021

不是一样的呀...
iOS以上的requestVideoOutputPathWithAsset调了requestExportSessionForVideo
以下的是requestAVAssetForVideo

背景见:#1397

我的意思就是requestExportSessionForVideo和requestAVAssetForVideo这两个api在系统里面并没有iOS14.0的有效版本之分,不太理解为啥iOS14用requestExportSessionForVideo的依据,虽然事实上requestExportSessionForVideo能结局导出失败的问题

@banchichen
Copy link
Owner

纯粹是因为iOS14以下一直用的requestAVAssetForVideo,只在iOS14下iCloud视频有问题

而requestExportSessionForVideo没被大量验证过

@banchichen
Copy link
Owner

banchichen commented Sep 28, 2021

不太理解为啥iOS14用requestExportSessionForVideo的依据,虽然事实上requestExportSessionForVideo能结局导出失败的问题

还需要其它理由吗......一个有问题,一个没问题,自然要切到没问题的。。。

@banchichen
Copy link
Owner

如果你等得起,你可以给Apple提issue,让他们解决requestAVAssetForVideo的iOS14 iCloud视频导出问题

@Will-ZJ
Copy link
Author

Will-ZJ commented Sep 29, 2021

如果你等得起,你可以给Apple提issue,让他们解决requestAVAssetForVideo的iOS14 iCloud视频导出问题

多谢解惑

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants