I want to display the (static) first frame of a video in my app as a preview.
I have read through this thread and understand that I could use a thumbnail :
Getting a thumbnail from a video url or data in iPhone SDK
I have two questions :
1) What is the resolution of the thumbnail ? I am looking to make the preview a 4:3 format and wonder if the image will end up looking blurry if enlarged.
2) Does the resolution of the thumbnail differ for iPhone / iPad ?
3) Is there a better way to grab and display the first frame of a video ?
Thank you.
Following code may helping to you
NSString *str = [[self.vedioArray objectAtIndex:i] valueForKey:@"vName"];
NSURL *videoURL = [NSURL URLWithString:str] ;
MPMoviePlayerController *player = [[[MPMoviePlayerController alloc] initWithContentURL:videoURL]autorelease];
UIImage *thumbnail = [player thumbnailImageAtTime:1.0 timeOption:MPMovieTimeOptionNearestKeyFrame];
player = nil;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With