UIVideoEditorController always compresses video on save

703 Views Asked by At

I'm using UIVideoEditorController to trim a video that's been selected from the camera roll using UIImagePickerController.

For the image picker, I use the passthrough-mode so the video won't be compressed.

When I use the un-trimmed video, it looks like it should.

But for the editor controller, there's no such setting. When trimming a video, I use UIImagePickerControllerQualityTypeHigh for the video quality setting. But this still compresses the video which causes loss of quality (it seems it's compressed to 720p. The actual video is 1080p, though).

Any idea how to tell the editor controller to not compress the video? The docs say when set to quality type high, it uses the setting for the current camera. Could it be that I need to set the back-camera to active, so it uses these settings?

1

There are 1 best solutions below

0
On BEST ANSWER

UIImagePickerController by default compress the video even though you set high quality. To stop default compression add below line before present UIImagePickerController.

imagePicker.videoExportPreset = AVAssetExportPresetPassthrough

Unfortunately, UIVideoEditorController doesn't have this kind of option as per my knowledge. Hope this is helpful.