AVAssetExportSession is nil iPhone 7 - Plus Simulator

社会主义新天地 提交于 2019-12-22 05:43:13

问题


AVAssetExportSession works fine on iPhone 6 and below but not on iPhone 7, iPhone 7 Plus simulator. Xcode 8.0

This code return nil in exportSession, when is executed on iPhone 7 - Plus Simulator, but not in iPhone SE, iPhone 6s ... Simulator. Please find the below code for more information.

    NSURL *inputURL = [[NSBundle mainBundle] URLForResource: @"example" withExtension:@"m4a"];
    AVURLAsset *assetAV = [AVURLAsset URLAssetWithURL:inputURL options:nil];
    AVAssetExportSession *exportSession = [[AVAssetExportSession alloc] initWithAsset:assetAV presetName:AVAssetExportPresetAppleM4A];
    NSAssert(exportSession != nil, @"AVAssetExportSession must not be nil");

It's a radar or there is something that I'm missing?.

Sample project at:

https://github.com/rafaelpereznajera/AVAssetExportSessionRadar


回答1:


It's a bug.

It's fixed in Xcode 8.1 beta.

Xcode 8.1 beta [AVAssetExportSession allExportPresets] iPhone 7 Simulator now returns:

AVAssetExportPreset1920x1080,
AVAssetExportPresetLowQuality,
AVAssetExportPresetAppleM4A,
AVAssetExportPreset640x480,
AVAssetExportPreset3840x2160,
AVAssetExportPresetHighestQuality,
AVAssetExportPreset1280x720,
AVAssetExportPresetMediumQuality,
AVAssetExportPreset960x540

Xcode 8.0 [AVAssetExportSession allExportPresets] iPhone 7 Simulator returns an empty array.



来源:https://stackoverflow.com/questions/39659315/avassetexportsession-is-nil-iphone-7-plus-simulator

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!