Compressing/Resizing ALAsset video on the iPhone before uploading

1.7k views Asked by At

I've built an app that uploads videos from the iPhone (uses the ALAsset libs, not the built in photo/video pickers, for selection) to my web server which then compresses/encodes them. This works great, but files get big very quickly with longer videos. Is there a standardized way to compress/downsize these videos right on the device before I handle the uploading? Is it worth the CPU hit? Does the AV Framework support this? Or do I have to use something along the lines of ffmpeg? I'm looking to go from 1280 x 720 to about 516 x 290. I could save a lot of bandwidth by handling this on the device first, just not sure of my options despite a lot of searching.

1

There are 1 answers

1
holtmann On BEST ANSWER

Take a look at AVAssetExportSession and it's methods. Then use the preset AVAssetExportPreset640x480 or one of the other presets to resize from 1280x720 to something smaller. A custom size (like 516x290) is at the moment not possible with AVAssetExportSession.

Cheers,

Hendrik