I’ve got a fairly visually complex app that has a base UIViewController and several UIViews (subclassed and extended by me) on it. Periodically, I throw up UIAlertViews and UIPopOverControllers.
I’m working toward a video-recording solution so that as users work through the app, it records what’s going on for a later debrief.
I’ve got a partially working solution, but it’s very slow (can’t really take more than about 1 frame per second), has some kinks (images are currently rotated and skewed, but I think I can fix that) and is not my idea of an ideal solution.
I hopped off that line of thinking and went toward implementing a solution that uses UIGetImageFromCurrentImageContext(), but that keeps giving me nil images, even when called from within drawRect:.
It occurs to me, though, that I don’t want to continuously be calling drawRect: just to get a screen shot! I don’t want to actually initiate any extra drawing, just capture what’s on screen.
I’m happy to post code that I’m using, but it’s not really working yet. Does anyone know of a good solution to do what I’m seeking?
The one solution I did find doesn’t fully work for me since it doesn’t ever seem to capture UIAlertViews and other overlaid views.
Any help?
Thanks!
bump
I was unable to do full-size real-time video encoding. However, as an alternative, consider this.
Instead of recording frames, record actions (with their timestamps) as they occur. Then, when you want to play back, just replay the actions. You already have the code, because you execute it in “real life.”
All you do is replay those same actions, relative to one another in time.
EDIT
If you want to try the recording, here’s what I did (note, I abandoned it… it was an experiment in progress, so just take it as an example of how I approached it… nothing is production-ready). I was able to record live audio/video at 640×360, but that resolution was too low for me. It looked fine on the iPad, but terrible when I moved the video to my mac and watched it there.
I had problems with higher resolutions. I adapted the bulk of this code from the RosyWriter example project. Here are the main routines for setting up the asset writer, starting the recording, and adding a UIImage to the video stream.
Good luck.