If you want to get thumbnail image from the recorded video in iOS then you can cut a small frame from that video to generate an image. You just need to send video output URL to below method as a parameter. This method willl return you NSData. Later you can convert that NSData to an UIImage.
-(NSData*)assetGenerator:(NSURL*)partOneUrl{
AVURLAsset *asset1 = [[AVURLAsset alloc] initWithURL:partOneUrl 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];
NSData *thumbData = UIImageJPEGRepresentation(one,0.2);
return thumbData;
}
Happy Coding!!!
0 Comment(s)