AVAssetExportSession is nil iPhone 7 - Plus Simulator

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

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

  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"); 

Is it a radar or is there something I am missing?

Project example:

https://github.com/rafaelpereznajera/AVAssetExportSessionRadar

+5
source share
1 answer

This is mistake.

It is 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.

0
source

All Articles