0

I am trying to invoke Camera through UIImagePicker like below,

 if UIImagePickerController.isSourceTypeAvailable(.camera) {
            let imagePicker = UIImagePickerController()
            imagePicker.delegate = self
            imagePicker.sourceType = .camera
            imagePicker.mediaTypes = [kUTTypeMovie as String]
            imagePicker.cameraCaptureMode = .video
            imagePicker.allowsEditing = false
            imagePicker.videoQuality = .typeHigh
            imagePicker.videoExportPreset = AVAssetExportPreset3840x2160
            helperGetAppDeleate().navigation.present(imagePicker, animated: true, completion: nil)
 }

With the videoQuality as .typeHigh. Although my phone supports 4k, still the videoQuality doesn't seem to increase more than 1920x1080. In addition to that the videoExportPreset is deprecated and I am unable to use it.

Any ideas?

Ellyn_Philip
  • 185
  • 8
  • Use AVFoundation? – matt Sep 08 '21 at 10:31
  • I was able to make a custom camera with the 4k quality, but I need to check if the same can be done with native camera invocation. – Ellyn_Philip Sep 08 '21 at 18:42
  • Well, it can't. I think the problem here is the misconception that the image picker controller is somehow more "native" than an AVFoundation camera. It isn't. The image picker controller is a simple-minded (i.e. downright stupid) reduction of the camera facilities; it is intended for just the simplest cases. Your case isn't simple like that. You know how to do it with AVFoundation, so do that. – matt Sep 08 '21 at 18:47
  • Yes there is a misconception. But @matt is there any link available which says that we can't? I tried to find but no luck. Any inputs on that? Thanks! – Ellyn_Philip Sep 09 '21 at 04:29

0 Answers0