title: AvFoundation - How to connect AVCaptureSession and AVAssetWriter?
body: <p>I'm trying to use AVCaptureSession to capture video from the camera and then I would like to use AVAssetWriter to write the results to a file (specifically, use multiple AVAssetWriters to write the capture to chunk videos, but we don't need to complicate this question with that). However, I'm having trouble figuring out where data actually needs to be passed to the AVAssetWriter. In the Apple Developer documentation I've only seen AVCaptureSession data being passed to an AVCaptureFileOutput. Maybe I'm just missing something though. Can the AVAssetWriter just be used as an output of the capture session? A relevant example or bit of code (while not necessary) would be appreciated. Thank you much!</p>