I\'m playing Video using AVPlayerLayer in a View. I need to convert View to Image, I tried
[myview.layer renderInContext:context];
but thi
The MPMoviePlayerController makes it easy to get a image from a movie at a certain point in the movie.
- (UIImage*)imageFromVideoAtPath:(NSString *)path atTime:(NSTimeInterval)time {
NSURL *videoURL = [NSURL fileURLWithPath:path];
MPMoviePlayerController *moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:videoURL];
[moviePlayer prepareToPlay];
UIImage *thumbnail = [moviePlayer thumbnailImageAtTime:time timeOption:MPMovieTimeOptionNearestKeyFrame];
[moviePlayer stop];
return thumbnail;
}
Just call this with the path of the video, and at the time you want to get the image.