UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

SOLVED: Getting high-resolution video from UIImagePickerController?

Forums > iOS

I am using UIImagePickerController to let user select video but system compresses it and the final resolution is only 1280x720. I would like higher, at least Full HD or 4K if available.

Is this possible?

This is my picker code. Setting videoQuality did not do anything.

func showVideoPicker() {
        let picker = UIImagePickerController()

        picker.delegate = self
        picker.videoQuality = .typeHigh
        picker.sourceType = .photoLibrary
        picker.mediaTypes = UIImagePickerController.availableMediaTypes(for: .photoLibrary) ?? []
        assert(!picker.mediaTypes.isEmpty)
        picker.mediaTypes = ["public.movie"]
        picker.allowsEditing = true
        present(picker, animated: true, completion: nil)
    }

Thanks for help.

3      

Found solution on the new Apple Developer Forum - https://forums.developer.apple.com/forums/thread/648960?page=1#612458022

Picker has videoExportPreset to control the video resolution.

3      

TAKE YOUR SKILLS TO THE NEXT LEVEL If you like Hacking with Swift, you'll love Hacking with Swift+ – it's my premium service where you can learn advanced Swift and SwiftUI, functional programming, algorithms, and more. Plus it comes with stacks of benefits, including monthly live streams, downloadable projects, a 20% discount on all books, and free gifts!

Find out more

Sponsor Hacking with Swift and reach the world's largest Swift community!

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.