以 mov 轉 mp4 為例:
AVURLAsset *mov = ......; // mov 來源
AVAssetExportSession *export = [AVAssetExportSession exportSessionWithAsset:mov presetName:AVAssetExportPresetMediumQuality];
NSURL *exportURL = ......; // 轉檔完的位置
export.outputURL = exportURL;
export.outputFileType = AVFileTypeMPEG4; // 轉成 mp4
[export exportAsynchronouslyWithCompletionHandler:^{
if(export.status == AVAssetExportSessionStatusCompleted)
{
// 成功
}
}];