Reputation: 461
I am interested in reading Video file as a series of UIImages on iOS. Is there anyway to do that using AVFoundation APIs.
Upvotes: 1
Views: 1209
Reputation: 1936
Create an AVAssetReader with the video track of the file. With an AVAssetReaderTrackOutput, you can send it the copyNextSampleBuffer message to receive a CMSampleBuffer. Each call will produce another frame from the video.
Inside the AVFoundation Programming Guide there is sample code showing how to set up an AVAssetReader as well as a method for making the conversion from CMSampleBuffer to UIImage.
Upvotes: 1