Skip to content

Instantly share code, notes, and snippets.

@trentbrooks
Created September 21, 2015 06:59
Show Gist options
  • Save trentbrooks/f8a0bd42334c12890083 to your computer and use it in GitHub Desktop.
Save trentbrooks/f8a0bd42334c12890083 to your computer and use it in GitHub Desktop.
ofAVFoundationVideoPlayer previousFrame() replacement
#ifdef __OBJC__
ofAVFoundationVideoPlayer* p = (ofAVFoundationVideoPlayer*)videoPtr->getAVFoundationVideoPlayer();
if(p != nullptr) {
double timeSec = CMTimeGetSeconds([p getCurrentTime]) - (1.0/[p getFrameRate]);
CMTime time = CMTimeMakeWithSeconds(timeSec, NSEC_PER_SEC);
[p seekToTime:time withTolerance:kCMTimeZero];
}
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment