How to avoid compression after selecting video from UIImagePickerController in ios

DeviPhone26 picture DeviPhone26 · Nov 25, 2013 · Viewed 13.8k times · Source

I am using UIImagePickerController to select video from Gallery and it compress that video.I want to disable Compression but I don't find the way to do this. I also tried with ELCImagePickerController it is showing video but it is looking like an image only there is no video icon or time duration like it shows in UIImagePickercontroller.How can I do it?

Thanks.

Answer

Jan picture Jan · Feb 6, 2018

With iOS 11 you can set the property videoExportPreset to AVAssetExportPresetPassthrough to get the original:

if #available(iOS 11.0, *) {
    picker.videoExportPreset = AVAssetExportPresetPassthrough
}

The "Video compression..." label just flashes for a few milliseconds and then the export is done.

@Diego Renau almost had the correct answer.