title: Can I have AVCaptureVideoDataOutput and AVCaptureMovieFileOutput in the same session?
body: <p>I'm developing an app in iOS. I need to capture video from the camera and I need to record that video to a file and also get the uncompressed frames, that's why I need to use both AVCaptureOutput...</p>
  
  <p>I read this in the apple's documentation "You can configure multiple inputs and outputs, coordinated by a single session:" So I think it must be doable, but I'm having problems with it...</p>
  
  <p>I'm setting both to the session doing:</p>
  
  <pre><code>self.fileOutput.maxRecordedDuration =  CMTimeMake(5000,1 );;
  self.fileOutput.minFreeDiskSpaceLimit = 3000;
  
  
  if([self.captureSession canAddOutput:self.fileOutput]){
      [self.captureSession addOutput:self.fileOutput];
      NSLog(@"Added File Video Output");
  }else{
      NSLog(@"Couldn't add video output");
  }
  
  if ([self.captureSession canAddOutput:videoOutput]){
      [self.captureSession addOutput:videoOutput];
      NSLog(@"Added Data Video Output");
  }else{
      NSLog(@"Couldn't add video output");
  }
  </code></pre>
  
  <p>I'm getting both 'positive' confirmation messages. After that I'm calling to:</p>
  
  <pre><code>NSString *assetPath         = [self createAssetFilePath:@"mov"];
  NSURL *outputURL            = [[NSURL alloc] initFileURLWithPath:assetPath];
  [self.fileOutput startRecordingToOutputFileURL:outputURL recordingDelegate:self];
  [self.captureSession startRunning];
  </code></pre>
  
  <p>And then I have my delegate function:</p>
  
  <pre><code>- (void)captureOutput:(AVCaptureFileOutput *)captureOutput didFinishRecordingToOutputFileAtURL:(NSURL *)outputFileURL fromConnections:(NSArray *)connections error:(NSError *)error {
  
  NSLog(@"Output File URL: %@ ", outputFileURL);
  
  BOOL recordedSuccessfully = YES;
  
      if ([error code] != noErr) {
  
          NSLog(@"Error: %@", error);
          id value = [[error userInfo] objectForKey:AVErrorRecordingSuccessfullyFinishedKey];
          NSLog(@"Error: %@", value);
          if (value) {
              recordedSuccessfully = [value boolValue];
          }
  
      }
  }
  </code></pre>
  
  <p>And I'm getting no error, but the "AVCaptureVideoDataOutput" was working before adding the "AVCaptureMovieFileOutput" and now it's not... </p>
  
  <p>So... Is that possible to do both?! Any idea?!</p>
  
  <p>Thanks!</p>