12

I want to know if there is any public API in AVFoundation or any other framework which can be used to record screen like Talking Tom Cat does. I looked into AVFoundation and CoreVideo frameworks but could not find anything from the header files.

If anyone knows how to record screen video prgramatically using iPhone SDK, let me know.

Chintan Patel
  • 3,175
  • 3
  • 30
  • 36
  • 1
    indeed! i would also like to know, glReadPixels is too slow for recording – james Jan 17 '11 at 19:34
  • @binnyb hmmm right glReadPixels is too slow...Any alternative for that ? – Tornado Aug 08 '11 at 06:45
  • How slow is too slow? Can you guys elaborate or post some sample code? – kevlar Feb 20 '12 at 05:44
  • 1
    @binnyb - As of iOS 5.0, there is a [much faster alternative to glReadPixels](http://stackoverflow.com/a/9704392/19679). However, the biggest problem people have with video recording on iOS is that they try to pass RGBA frames into AVAssetWriter instead of BGRA ones. The latter are more than 4X faster to encode. An iPhone 4 can encode 640x480 video at 30 FPS using BGRA frames, and 720p video at close to that using the above-linked texture caches. – Brad Larson Mar 29 '12 at 15:45

1 Answers1

7

you can do it in the following steps:

  1. capture screen
  2. take that frame in a queue
  3. write it with avassertwriter
  4. and export the video

there is a sample application for understanding these things in the wwdc2010 sample code.

hope this helps.(sample app name : aveditdemo)

Kenny Winker
  • 11,919
  • 7
  • 56
  • 78
harshalb
  • 6,012
  • 13
  • 56
  • 92
  • hi hib i have gone through the video of wwdc2010 at least now i got ray of hope that it can be done . But i still dint get your 4th point i.e "export the video" . Is this the same option as export given in the demo ? – Sneha Feb 21 '11 at 10:27
  • you can find the code in AVEditDemo sample app in wwdc2010 sample code link : http://developer.apple.com/videos/wwdc/2010/ it is class to export the videocomposition you have created just go through it and you will understand the things pretty well. – harshalb Feb 21 '11 at 12:13
  • @hib : I have tried this demo. But it is not giving any outputs. Do i have to include it in my project? Or How does it works? – ios Dec 21 '11 at 13:14
  • @ios the app does not works . you can take the app as a reference to initially understand the idea – harshalb Jan 05 '12 at 05:42