title: Taking thumbnail image from video always returns null
body: <p>I am trying to get the first thumbnail from a video.</p>
  
  <p>I tried the following:</p>
  
  <p><strong>ONE</strong></p>
  
  <pre><code>AVURLAsset *asset = [[AVURLAsset alloc] initWithURL:[NSURL fileURLWithPath:_moviePath] options:nil];
  AVAssetImageGenerator *gen = [[AVAssetImageGenerator alloc] initWithAsset:asset];
  gen.appliesPreferredTrackTransform = YES;
  CMTime time = CMTimeMakeWithSeconds(0.0, 600);
  NSError *error = nil;
  CMTime actualTime;
  
  CGImageRef image = [gen copyCGImageAtTime:time actualTime:&amp;actualTime error:&amp;error];
  UIImage *thumb = [[UIImage alloc] initWithCGImage:image];
  CGImageRelease(image);
  NSLog(@"the error is %@: image is %@: url is %@: ",error,_mainThumbnail,[NSURL fileURLWithPath:_moviePath] );
  </code></pre>
  
  <p>However, my log is:</p>
  
  <pre><code>the error is (null): image is (null): 
  url is file:///private/var/mobile/Applications/D1293BDC-EA7E-4AC7-AD3C-1BA3548F37D6/tmp/trim.6F0C4631-E5E8-43CD-BF32-9B8F09D4ACF1.MOV: 
  </code></pre>
  
  <p><strong>TWO</strong></p>
  
  <pre><code>AVURLAsset *asset=[[AVURLAsset alloc] initWithURL:[NSURL fileURLWithPath:_moviePath] options:nil];
      AVAssetImageGenerator *generator = [[AVAssetImageGenerator alloc] initWithAsset:asset];
      generator.appliesPreferredTrackTransform=TRUE;
  
      CMTime thumbTime = CMTimeMakeWithSeconds(0,30);
  
      AVAssetImageGeneratorCompletionHandler handler = ^(CMTime requestedTime, CGImageRef im, CMTime actualTime, AVAssetImageGeneratorResult result, NSError *error){
          if (result != AVAssetImageGeneratorSucceeded) {
              NSLog(@"couldn't generate thumbnail, error:%@", error);
          }
          _mainThumbnail.image = [UIImage imageWithCGImage:im];
          NSLog(@"thumbnails %@ ",_mainThumbnail.image);
      };
  
      CGSize maxSize = CGSizeMake(320, 180);
      generator.maximumSize = maxSize;
      [generator generateCGImagesAsynchronouslyForTimes:[NSArray arrayWithObject:[NSValue valueWithCMTime:thumbTime]] completionHandler:handler];
  </code></pre>
  
  <p>The log thumnails null.</p>
  
  <p>Why is the image null? I looked in other forums, and they suggested to use fileURLWithPath -which I am already using.</p>
  
  <p>I am using ios7</p>