Wednesday, October 24, 2012

iOS - get the thumbnail of a video

We can get the thumbnail of any time. The following example is at time 0

MPMoviePlayerController *moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:filePath]];
moviePlayer.shouldAutoplay = NO;
UIImage *thumbnail = [moviePlayer thumbnailImageAtTime:0 timeOption:MPMovieTimeOptionNearestKeyFrame];
[moviePlayer stop];
[moviePlayer release];


Another way to get the frame - http://stackoverflow.com/a/4330647

1 comment:

  1. Thanks for sharing this Informative content. Well explained. Got to learn new things from your Blog on. ios app development online course

    ReplyDelete