Last active
August 29, 2015 14:09
-
-
Save weekwood/d0f25f1b1f87581f458a to your computer and use it in GitHub Desktop.
AVURLAsset Thumbnail
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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