title: Getting video snapshot for thumbnail
body: <p>I am recording a video from the iPhone camera by using the AVCam code provided from apple. </p>
  
  <p>After the video is recorded it is saved to the photos library. </p>
  
  <p>A new view is then loaded, here I need to have an image thumbnail of the video. </p>
  
  <p>I have a path to the video:</p>
  
  <pre><code>file://localhost/private/var/mobile/Applications/ED45DEFC-ABF9-4A5E-9102-21680CC1448E/tmp/output.mov
  </code></pre>
  
  <p>I can't seem to figure how to get the first frame of the video to use as a thumbnail. </p>
  
  <p>Any help would be very appreciated and thank you for your time. </p>
  
  <hr>
  
  <p><strong>EDIT</strong></p>
  
  <p>I ended up using this, I'm not sure why it returns the image sideways?</p>
  
  <pre><code>- (UIImage*)loadImage {
  
      AVURLAsset *asset = [[AVURLAsset alloc] initWithURL:vidURL options:nil];
      AVAssetImageGenerator *generate = [[AVAssetImageGenerator alloc] initWithAsset:asset];
      NSError *err = NULL;
      CMTime time = CMTimeMake(1, 60);
      CGImageRef imgRef = [generate copyCGImageAtTime:time actualTime:NULL error:&amp;err];
      NSLog(@"err==%@, imageRef==%@", err, imgRef);
  
      return [[UIImage alloc] initWithCGImage:imgRef];
  
  }
  </code></pre>