NSString *url = [Utils applicationCachesDirectory:self.videourl];
url = [Utils applicationDocumentsDirectory:self.videourl];
NSURL *videoURL = [NSURL fileURLWithPath:url];
NSDictionary *opts = [NSDictionary dictionaryWithObject:[NSNumber numberWithBool:NO]
forKey:AVURLAssetPreferPreciseDurationAndTimingKey];
AVURLAsset *urlAsset = [AVURLAsset URLAssetWithURL:videoURL options:opts];
//NSLog(@"视频的路径是:%@", videoURL);
AVAssetImageGenerator *generator = [AVAssetImageGenerator assetImageGeneratorWithAsset:urlAsset];
generator.appliesPreferredTrackTransform = YES;
generator.maximumSize = CGSizeMake(360.0f, 480.0f);
NSError *error = nil;
/*** Returns a CGImage for the asset at or near a specified time. */
/*** - (CGImageRef)copyCGImageAtTime:(CMTime)requestedTime actualTime:(CMTime *)actualTime error:(NSError **)outError */
CGImageRef cgImg = [generator copyCGImageAtTime: CMTimeMake(1, 1) actualTime:NULL error:&error];