Reputation: 2738
Does anyone have pointers to some working code or techniques for capturing the full-screen real-time OpenGL graphics on the iPhone and iPad, combine it with the audio coming out of the device, and compile it into a video to post online?
For example, apps such as "Talking Tomcat" do this. I'm using Cocos2D, but a solution from any framework is welcome, ideally using up-to-date APIs. It seems like this should be a solved problem given how useful and pervasive such a function is. However, all the postings I have found on this topic are out of date or incomplete.
One of the better sources of information I've found so far is here: http://www.subfurther.com/blog/2011/04/12/voices-that-matter-iphone-spring-2011/
Upvotes: 8
Views: 13448
Reputation: 54836
There's an updated version of the above-mentioned ScreenCaptureView class available that has video-recording support built-in (see link). It hasn't been tested with an OpenGL subview, but assuming that it works you might be able to modify it slightly to include audio and then you'd be set.
Edit - Working link here: https://github.com/adam-roth/screen-cap-view
Upvotes: 7
Reputation: 2316
I know this is an old question, but if someone comes across the same problem.
There are ready-made solutions / services for doing this so if you're not looking to re-invent the wheel, you can try for example Everyplay (https://everyplay.com/about) which does exactly that.
Check out the Cocos2d integration docs here: https://developers.everyplay.com/doc/Everyplay-integration-to-Cocos2d-game
Disclaimer: I work for the company that makes Everyplay. We try to solve the exact problem that the original question poses.
Upvotes: 4
Reputation: 41
It is worth mentioning that saving the contents of the UIView does not capture any other views or components that are not subviews of that component. For instance you would not capture keyboards, popovers or dialogs.
Upvotes: 0
Reputation: 7193
I found this simple ScreenCaptureView class that might help. It saves the contents of a UIView to a UIImage. The author suggests you can save a video of the app in use by passing the frames through AVCaptureSession.
Upvotes: 5