     videoDataOutput = AVCaptureVideoDataOutput()
     videoDataOutput?.videoSettings = [String(kCVPixelBufferPixelFormatTypeKey): UInt(kCVPixelFormatType_32BGRA)]
     videoDataOutput?.setSampleBufferDelegate(self, queue: framesQueue)
-    
-    if (!captureSession.canAddOutput(videoDataOutput)) {
+    try addCaptureOutput(videoDataOutput!)
+  }
+  
+  /**
+   Create `movieFileOutput` and add it to `captureSession`.
+   - Throws: `CaptureManagerError.InvalidCaptureOutput` if the output cannot be added to `captureSession`.
+   */
+  fileprivate func addMovieFileOutput() throws {
+    movieFileOutput = AVCaptureMovieFileOutput()
+    try addCaptureOutput(movieFileOutput!)
+  }
+  
+  /**
+   Add `output` to `captureSession`.
+   - Throws: `CaptureManagerError.InvalidCaptureOutput` if the output cannot be added to `captureSession`.
+   */
+  fileprivate func addCaptureOutput(_ output: AVCaptureOutput) throws {
+    if (!captureSession.canAddOutput(output)) {
       throw CaptureManagerError.invalidCaptureOutput
     }
-    
-    captureSession.addOutput(videoDataOutput)
+    captureSession.addOutput(output)
   }
   
   /**

public enum CaptureSessionOutput {
  case stillImage
  case videoData
}

/// Error types for `CaptureManager`

   */
  fileprivate func addVideoInput() throws {
    videoInput = try AVCaptureDeviceInput(device: videoDevice)
    try addCaptureInput(videoInput!)
  }
  
  /**
