How do I extract a screenshot from a video in the iPhone SDK?

强颜欢笑 提交于 2019-12-04 20:29:28

Yes, you can do it - if I am not wrong, since iOS 3.2... at least for the videos you have on your library. After loading the movie on your MPMoviePlayerController object, do this

UIImage *aThumbnail = [player thumbnailImageAtTime:timeCode timeOption:MPMovieTimeOptionExact];

//timeCode is a time within de video length, for example: 3.12 seconds.
//player is the MPMoviePlayerController object.

Unfortunately there is no official way to grab image frames from the camera in realtime.

I encourage you to file a bug report / feature request with Apple. Many people want this. If many people request a specific feature then they might consider to actually put this in.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!