4

I have a crash with UIImagePickerController on iPhones with iOS 13 (real device) after switching to video capture mode. Crash reproduces on the second presentation of UIImagePickerController. Crash does not reproduce on versions before iOS 13 (real device). Camera and Microphone usage description keys are set in Info.plist Test app built with Xcode 11.0

Steps:

  1. Present UIImagePickerController
  2. Dismiss UIImagePickerController
  3. Present UIImagePickerController
  4. Tap VIDEO button - > Crash

Crash does not reproduce if I set videoQuality = UIImagePickerControllerQualityTypeHigh. But I need UIImagePickerControllerQualityTypeMedium.

@interface ViewController () < UINavigationControllerDelegate, UIImagePickerControllerDelegate>
@end

@implementation ViewController

#pragma mark - IBActions

- (IBAction)showPicker:(UIButton *)sender {
    UIImagePickerController *pickerController = [UIImagePickerController new];
    pickerController.sourceType = UIImagePickerControllerSourceTypeCamera;
    pickerController.mediaTypes = [UIImagePickerController availableMediaTypesForSourceType:UIImagePickerControllerSourceTypeCamera];
//    pickerController.videoQuality = UIImagePickerControllerQualityTypeHigh;
    pickerController.delegate = self;

    [self presentViewController:pickerController animated:YES completion:NULL];
}

#pragma mark - UIImagePickerControllerDelegate

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary<UIImagePickerControllerInfoKey, id> *)info {
    [self dismissViewControllerAnimated:YES completion:NULL];
}

- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker {
    [self dismissViewControllerAnimated:YES completion:NULL];
}

@end

'NSInvalidArgumentException', reason: '*** -[AVCaptureDevice setActiveColorSpace:] Not supported - use activeFormat.supportedColorSpaces'

LuLuGaGa
  • 13,089
  • 6
  • 49
  • 57

1 Answers1

1

Set your video quality in pickercontroller

[pickerController setVideoQuality:UIImagePickerControllerQualityTypeIFrame1280x720];
Sk Borhan Uddin
  • 813
  • 1
  • 9
  • 19