Search code examples
iphoneiosipadvideo-streamingvideo-capture

Video Stream of NSView


I want to create a video stream of a View in iOS. For example place a View in iPhone and draw something on it and I want to create a video stream (H.264 or MP4 or any famous standard) so that I can save a video file which contain recording of my NSView and all drawing and other operations that I perform.

Any idea where to start? Is there some API available in iOS to record video iPhone screen or a specific view??

Thanks in advance.


Solution

  • This blog post contains a link to sample project that shows how to capture screen content on iOS and add it to an AVFoundation asset.
    Download the sample project called VTMScreenRecorderTest.zip Also take a look on the slides (the screen capture part starts at slide 44). The capture code is based on Apple's Technical Q&A 1703.