4

Part of my app is a chat. Within this chat a user could upload images and videos to a storage (firebase).

It works so far. Whereas uncompressed video files are huge (0:43min video has 24mb), i'd implemented the code described here and it compresses the video-file from 24mb to 1mb (lowest quality):

But i was wondering that the imagePickerController shows a progress bar with text "compressing video" whether or not i've implemented the code from above?!

enter image description here

I found out (by sending file via Air Drop from iphone to macbook) that the "original" file has a size of 53mb. This is twice as much as i get out of

let videoUrl = info[UIImagePickerControllerMediaURL] as? URL
let data = NSData(contentsOf: videoUrl!)
print("File size before compression: \(Double(data.length))")

It seems that a compression takes place. Could i customize this process of compression? or do i have to go the long way with AVAssetExportSession (described within the two links)?

andre_hold
  • 562
  • 8
  • 20

0 Answers0