Skip to content

Instantly share code, notes, and snippets.

@weekwood
Last active August 29, 2015 14:09
Show Gist options
  • Save weekwood/d0f25f1b1f87581f458a to your computer and use it in GitHub Desktop.
Save weekwood/d0f25f1b1f87581f458a to your computer and use it in GitHub Desktop.
AVURLAsset Thumbnail
AVURLAsset *asset1 = [[AVURLAsset alloc] initWithURL:[info objectForKey:@"UIImagePickerControllerMediaURL"] options:nil];
AVAssetImageGenerator *generate1 = [[AVAssetImageGenerator alloc] initWithAsset:asset1];
generate1.appliesPreferredTrackTransform = YES;
NSError *err = NULL;
CMTime time = CMTimeMake(1, 2);
CGImageRef oneRef = [generate1 copyCGImageAtTime:time actualTime:NULL error:&err];
UIImage *one = [[UIImage alloc] initWithCGImage:oneRef];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment