Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MPMoviePlayer or AVPlayer Frame advance

Is there a way to playback a video file frame by frame using either MPMoviePlayer or AVPlayer? Or even another movie player that I do not know about?

Here is what I want to do. I want to load a video into a fullscreen player and move the content one frame at a time based on user interaction. This will need to be pretty solid as I would need to accurately control what frame the movie player was displaying at any one time.

Ideally I would love to know if it were possible to load a video and control the frame displayed using code.

I know that I could do this using a UIImageView animation but tests show that this uses FAR to much memory.

like image 640
EcksMedia Avatar asked Jul 16 '11 09:07

EcksMedia


1 Answers

When using AVPlayer, you can use the - (void)stepByCount:(NSInteger)stepCount method of its current AVPlayerItem to step forward or backward.

AVPlayer *mPlayer = [AVPlayer playerWithURL:url];
[mPlayer.currentItem stepByCount:1];
like image 172
Mr. Zystem Avatar answered Sep 21 '22 21:09

Mr. Zystem