0

I'm trying to scrub through videos in really small values (maybe even less than milliseconds). To get to the next frame I use [AVPlayer seekToTime:time toleranceBefore: kCMTimeZero toleranceAfter:kCMTimeZero] which gives me the correct position. The problem is, that it takes too long to scrub backward.

I know the reasons are the keyframes and the player has to start searching from the nearest keyframe to reach the position.

Is there any possibility to reencode the video to have more keyframes, or entirely exist out of keyframes?

Thanks

Jan
  • 1,827
  • 2
  • 16
  • 29

1 Answers1

0

Yes, you can encode video to contain all keyframes, but the file will become MUCH larger. It will also take time/CPU to do it. In addition at 30 frames per second there is only one frame every 33 milliseconds, so sub millisecond resolution doesn't make any sense.

szatmary
  • 29,969
  • 8
  • 44
  • 57
  • it doesn't matter if the file is much larger. Thanks for the reminder with the fps. Do you know how to reencode the video? – Jan Nov 18 '14 at 15:33
  • I don't have enough information on your specific use case to say yes I know how to reencode. But odds are ffmpeg is all you need – szatmary Nov 18 '14 at 18:25
  • currently I plan on loading videos from camera roll and scrub through them in as small steps as possible – Jan Nov 19 '14 at 08:30