In the previous section, you used AVFoundation to build a simple audio player app. You will now use AVFoundation again, except instead of playing video or audio, you will now record video and store it in the user's photo library. When using AVFoundation to record a video feed, you do so with an AVCaptureSession object. A capture session is responsible for taking the input from one or more AVCaptureDeviceInput objects, and writing it to an AVCaptureOutput subclass.
The following diagram shows the objects that are involved with recording media through an AVCaptureSession:
To get started on implementing the video recorder, ...