Posts

Showing posts from January, 2014

iOS Split Video into frames

Dear all, You may have encountered scenarios where you would like to split a video into several frames at different time intervals. This post is for you if you intend to do the splitting at device level. I presume that you have some reasonable experience with Objective C and XCode such as adding a framework and adding a file. There are several steps to do to get this going. 1. Build an XCode project and add a video file to project. I've worked with .mp4 files. Should work with other standard formats. 2. Add AssetsLibrary framework and AVFoundation frameworks to your project 3. Create a AVAsset object with your video. You need to pass the location of the video as a NSURL object. I added the video(myvid.mp4) as an asset to my project. Therefore, I will use the following method to create the asset object. AVAsset *asset=[AVAsset assetWithURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"myvid" ofType:@"mp4"]]]; NOTE: If you ne