Capturing the first frame of a video - Resolution of thumbnails - iPhone

I want to display the (static) first frame of a video in my application as a preview.

I read this thread and realized that I can use a thumbnail:

Get a thumbnail of a video or data in the iPhone SDK

I have two questions:

1) What is the resolution of the sketch? I want to make a 4: 3 preview and wonder if the image will eventually look blurry if it is enlarged.

2) Is the thumbnail resolution different for iPhone / iPad?

3) Is there a better way to capture and display the first frame of a video?

Thanks.

+6
source share
1 answer

The following code may help 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; 

EDIT

The following link is used to receive a thumbnail from the video.

http://www.codza.com/extracting-frames-from-movies-on-iphone

+9
source

All Articles