I'm having an issue syncing external content in a CALayer
with an AVPlayer
at high precision.
My first thought was to lay out an array of frames (equal to the number of frames in the video) within a CAKeyframeAnimation
and sync with an AVSynchronizedLayer
. However, upon stepping through the video frame-by-frame, it appears that AVPlayer
and Core Animation redraw on different cycles, as there is a slight (but noticeable) delay between them before they sync up.
Short of processing and displaying through Core Video, is there a way to accurately sync with an AVPlayer
on the frame level?
Update: February 5, 2012
So far the best way I've found to do this is to pre-render through AVAssetExportSession
coupled with AVVideoCompositionCoreAnimationTool
and a CAKeyFrameAnimation
.
I'm still very interested in learning of any real-time ways to do this, however.