【发布时间】:2011-07-20 06:46:00
【问题描述】:
如何在 iphone 上获取流媒体视频的屏幕截图。我尝试了几种方法。
UIGetScreenImage() -> 这是私有的。如果我使用该应用程序将被拒绝。
-
UIGraphicsBeginImageContext(CGSizeMake(1024, 768)); [self.view.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext();
The code above cannot take the screenshot of video layer. -
MPMoviePlayerController *movie = [[MPMoviePlayerController alloc] initWithContentURL [NSURL URLWithString:@"myMovie.mp4"]]; UIImage *singleFrameImage = [电影缩略图ImageAtTime:10 timeOption:MPMovieTimeOptionExact];
The code above does not work on a streaming video.
除了 AVFoundation,我还能尝试什么。谢谢。
【问题讨论】:
-
我自己没有尝试过,但也许可以查看 CALayer 并将其保存为图像或读取它的每个像素并将其保存到图像中?
标签: iphone objective-c ipad