Created
May 12, 2016 08:14
-
-
Save quangtqag/7927d41f2dc3823a6a8d77faed8e3edc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func convertVideoToMP4WithInputURL(inputURL: NSURL, outputURL: NSURL, callback: (error: NSError?) -> ()) { | |
let asset = AVURLAsset(URL: inputURL) | |
let exportSession = AVAssetExportSession(asset: asset, presetName: AVAssetExportPresetPassthrough)! | |
exportSession.outputURL = outputURL | |
exportSession.outputFileType = AVFileTypeMPEG4 | |
exportSession.exportAsynchronouslyWithCompletionHandler { | |
callback(error: exportSession.error) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment