I want to crop a video to square, but i couldn\'t do that.
I converted this code to swift but i only get black screen after exporting the video
You're missing the exporter block at the very end to perform the export operation with the AVAssetExportSession
you've created:
exporter.exportAsynchronouslyWithCompletionHandler({
//display video after export is complete, for example...
let outputURL:NSURL = exporter.outputURL;
let asset:AVURLAsset = AVURLAsset(URL: outputURL, options: nil)
let newPlayerItem:AVPlayerItem = AVPlayerItem(asset: asset)
self.mPlayer = AVPlayer.playerWithPlayerItem(newPlayerItem) as AVPlayer
})