0

so I'm combining movie from several clips using AVMutableComposition (which is subclass of AVAsset) and play the preview instantly with GPUImage.

What I want to do now, is crop the video. I've found lots of sample codes how to do that when using AVAssetExportSession, but I can't figure out if it's possible to crop the video 'on the fly', without exporting it first.

So, is it possible to crop AVMutableComposition without exporting the video?

msmialko
  • 1,439
  • 2
  • 20
  • 35
  • Take a look at [AVMutableCompositionLayerInstruction](https://developer.apple.com/library/mac/documentation/AVFoundation/Reference/AVMutableVideoCompositionLayerInstruction_Class/Reference/Reference.html#//apple_ref/doc/uid/TP40009795) – David Berry Jul 21 '14 at 15:33
  • @David, I've seen this, but AVMutableCompositionLayerInstruction can only be added to AVMutableVideoComposition which is not AVAsset so I can't use it. And from what I've researched, I can't add AVMutableCompositionLayerInstruction to AVMutableComposition. – msmialko Jul 21 '14 at 15:45
  • You apply the `AVMutableVideoComposition` to the `AVPlayer`, see [this blog](http://abdulazeem.wordpress.com/2012/04/02/video-manipulation-in-ios-resizingmerging-and-overlapping-videos-in-ios/) – David Berry Jul 21 '14 at 16:04
  • I see :) I wanted to separate this cropping logic from my player object, but that's probably not doable. Thanks David! – msmialko Jul 23 '14 at 06:41

0 Answers0