What's your goal, exactly? Because you're asking for (the use an AVAssetWriter as an output for an AVCaptureSession) isn't possible.
Basically, an AVCaptureSession
object has inputs (eg: a camera, represented by some AVCaptureInput
subclass) and outputs (in the form of AVCaptureOutput
's). And an AVAssetWriter
is not an AVCaptureOutput
subclass, so there is no way to use it directly from an AVCaptureSession.
If you want to use an AVAssetWriter, you'll have to write the data out using an AVCaptureFileOutput
instance, and then read it back with an AVAssetReader
, modify your data somehow, and then output it via an AVAssetWriter
.
Final thing to keep in mind: AVAssetReader
is documented to not guarantee real-time operations.