Search code examples
iphoneiosscreenshotunity-game-engine

how fast in fps can an iphone take screenshots?


How fast in frames per second can an iphone 4s take screenshots? What would they be stored as?

I'm using unity3d which has a function on iphone called Application.captureScreenshot. It's pretty slow at about 2fps and writes a png to the documents folder each time.

I'm wondering if a native ios capture would be faster.

Thanks, Dan


Solution

  • You're really asking two questions here: how fast can the iPhone capture from OpenGL ES, and how fast can it write images to disk.

    For the former, if you use iOS 5.0's texture caches, you can capture 1080p video (far beyond the resolution of the iPhone's screen) at greater than 30 FPS on an iPhone 4S. You should be able to capture 960x640 Retina frames from Unity as fast as it renders them.

    For the latter, that will depend on the size of the image being saved, but it is fairly slow to save individual PNG images to disk. However, if it's speed you're after, you probably want to record to video, not save a bunch of stills. Using AVFoundation recording and a BGRA input source, you can easily record 1080p video at over 30 FPS on an iPhone 4S. The iOS devices have very good hardware acceleration for recording H.264 video. Again, you should be able to record as fast as Unity can render, assuming its rendering isn't using all available CPU and GPU resources.

    The numbers I quote above are all from benchmarks and tests that I've performed on actual iPhone 4S hardware.