I'm developing a social video app which a user can capture a video or choose one from his photo library.
The videos are not playing on android devices, and after some research we figured out that we should encode the videos on both sided to MPEG4
format.
Iv'e tried using AVAsset
and AVMutableComposition
, and the thing is that it generates VERY BIG files.
a 20 seconds video was generated to 15 MB!
I guess I'm not the first to run into this issue, so please if you have any clue, let me know. Thanks!
EDIT
OK, the file size problem was in this line
AVAssetExportSession *finalExporter = [[AVAssetExportSession alloc] initWithAsset:mixComposition presetName:AVAssetExportPreset960x540];
changed it to:
AVAssetExportSession *finalExporter = [[AVAssetExportSession alloc] initWithAsset:mixComposition presetName:AVAssetExportPresetMediumQuality];
now the problem is it rotated left, sometimes right... and sometimes upside down.
I don't try it, but
you can check these link:
MOV to Mp4 video conversion iPhone Programmatically
or may use ffmpeg from http://ffmpeg.org/