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

iphone8 plus 系统14.2 导出视频经常失败 #1465

Closed
MiTuShuSheng2019 opened this issue Jan 28, 2021 · 1 comment
Closed

iphone8 plus 系统14.2 导出视频经常失败 #1465

MiTuShuSheng2019 opened this issue Jan 28, 2021 · 1 comment

Comments

@MiTuShuSheng2019
Copy link

MiTuShuSheng2019 commented Jan 28, 2021

icon

上面是截图,下面是代码

#pragma mark -- 开始转换视频
-(void)convertVideoWithAsset:(PHAsset *)asset{

__block CGFloat duration = asset.duration;
//根据PHAsset 获取视频相关信息
PHVideoRequestOptions *options = [[PHVideoRequestOptions alloc] init];
options.version = PHVideoRequestOptionsVersionCurrent;
__weak typeof(self) weakSelf = self;
[[PHImageManager defaultManager] requestAVAssetForVideo:asset options:options resultHandler:^(AVAsset *asset, AVAudioMix *audioMix, NSDictionary *info) {
    
   //  asset  这里有时候会返回空的
    if ([asset isKindOfClass:[AVURLAsset class]]) {

      
    }
}];

}

@banchichen
Copy link
Owner

可参考最新版的requestVideoOutputPathWithAsset,这个方法支持iOS14

可参考:#1073

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