获取视频的第一帧图片!

NSDictionary *opts = [NSDictionary dictionaryWithObject:[NSNumber numberWithBool:NO] forKey:AVURLAssetPreferPreciseD

urationAndTimingKey];
AVURLAsset *urlAsset = [AVURLAsset URLAssetWithURL:videoURL options:opts];
AVAssetImageGenerator *generator = [AVAssetImageGenerator assetImageGeneratorWithAsset:urlAsset];
generator.appliesPreferredTrackTransform = YES;
generator.maximumSize = CGSizeMake(imageView.frame.size.width, imageView.frame.size.height);
NSError *error = nil;
CGImageRef img = [generator copyCGImageAtTime:CMTimeMake(10, 10) actualTime:NULL error:&error];
if (error != nil)
{
    use "img" to ooxx........
}
原文地址:https://www.cnblogs.com/weilaikeji/p/2938997.html