Reading video frame-by-frame under iOS

纵饮孤独 提交于 2019-12-02 17:43:59

The two links above actually answer my question and the empty copyNextBufferSample is an issue with iOS SDK 5.0b3, it works on the device.

AVAssetImageGenerator has very loose default tolerances for the exact frame time that is grabbed. It has two properties that determine the tolerance: requestedTimeToleranceBefore and requestedTimeToleranceAfter. These tolerances default to kCMTimePositiveInfinity, so if you want exact times, set them to kCMTimeZero to get exact frames.

(It may take longer to grab the exact frames than approximate frames, but you state that realtime is not an issue.)

Use AVReaderWriter. Though its an OS X Apple sample code, AVFoundation is available on both platforms with little changes.

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