title: Saving Video to PhotosAlbum Is Slow
body: <p>Apple's camera app seems to save video straight to the photos album. I'm wondering if that capability can be accomplished by us mere mortal developers.</p>
  
  <p>Both methods I've come across and tested, copy a video file to the photos album. The larger the file, the longer it takes to save. A 2 minute creation can vary in the save time. Two timings I have are, 45 seconds, and 1 minute 12 seconds to copy to copy files about 150MB in size. A file of similar size from the Apple Camera app can take as little as 6 seconds.</p>
  
  <p>I've looked at the AVCam demo code and it uses one of the two methods I've already tested.</p>
  
  <blockquote>ALAssetsLibrary instance method writeVideoAtPathToSavedPhotosAlbum:completionBlock:</blockquote>
  
  <blockquote>UIKit Function UISaveVideoAtPathToSavedPhotosAlbum</blockquote>
  
  <p>I'm using AVFoundation to connect to the camera and open up a stream to a file. For context, the following is where I open that file. The movieURLPath is a file reference in my apps document directory area.</p>
  
  <pre><code>outputWriter = [AVAssetWriter assetWriterWithURL: [projectPaths movieURLPath]  fileType: AVFileTypeQuickTimeMovie error: &amp;error];
  </code></pre>
  
  <p>When the file has been closed by stopping the recording, I eventually get to this line.</p>
  
  <pre><code>UISaveVideoAtPathToSavedPhotosAlbum ([projectPaths movieFilePath], self, @selector(video:didFinishSavingWithError: contextInfo:), nil);
  </code></pre>
  
  <p>Does anyone have any other options to speed up the writing process? Clearly my preference would be to have movieURLPath pointing to a file in the PhotosAlbum. It would be optimal to open the file in that folder instead, which is what I think Apple has done.</p>