Recording game play in real time.

Dear all,
I want to record the game play of the user. Please let me know how to achieve it. Thanks in advance.
Here is the problem statement in clear-

  1. I’ve video streaming which from the camera and it is behind our cocos2d layer. Video is embedded an UIView
  2. The actor in the cocos2d layer which responds according to the background video (processing of each frame is implemented).
  3. User has got an option to record his game play while he is playing.
  4. Then if he wishes he can post that video in YouTube. So i want that output in some video format.
  5. No simulation or recreation of the game play as output video is must needed.