title: How to crop a video in iOS
body: <p>I was having a look at the RosyWriter Sample Code provided by Apple as a starting point and I'd like to find a way how to crop a video.</p>
  
  <p>So i have the full resolution video from the iPhones Camera, but I just want to use a cropped part of it (and also rotate this subpart).</p>
  
  <p>I figured that in <code>captureOutput:didOutputSampleBuffer: fromConnection:</code> i can modify each frame by modifying the CMSampleBufferRef that i get passed in.</p>
  
  <p>So my questions now are:</p>
  
  <ol>
  <li><p>Is this the right place to crop my video?</p></li>
  <li><p>Where do I specify that the final video (that get's saved to disc) has a smaller resolution than the full video captured by AVCaptureSession? Setting the <code>AVVideoWidthKey</code> and <code>AVVideoHeightKey</code> has no effect.</p></li>
  <li><p>How can I crop the video and still have good performance?</p></li>
  </ol>
  
  <p>Any help is appreciated!</p>
  
  <p>Thanks a lot!</p>
  
  <p>EDIT:</p>
  
  <p>Maybe I just need to know how I can make a video that was shot in portrait a landscape one by turning the images of the video by 90 degrees and then zoom in to fit the width again...?!?</p>