title: Cocoa QTKit and recording movies
body: <p>I'm new with the whole QTKit and I was looking for some feedback on the following code that I am attempting to use to display the camera's image and record movies. </p>
  
  <pre><code>- (void)initializeMovie {
  
  NSLog(@"Hi!");
  
  QTCaptureSession* mainSession = [[QTCaptureSession alloc] init];
  
  QTCaptureDevice* deviceVideo = [QTCaptureDevice defaultInputDeviceWithMediaType:@"QTMediaTypeVideo"];
  
  QTCaptureDevice* deviceAudio = [QTCaptureDevice defaultInputDeviceWithMediaType:@"QTMediaTypeSound"];
  
  NSError* error;
  
  [deviceVideo open:&amp;error];
  [deviceAudio open:&amp;error];
  
  QTCaptureDeviceInput* video = [QTCaptureDeviceInput deviceInputWithDevice:deviceVideo];
  
  QTCaptureDeviceInput* audio = [QTCaptureDeviceInput deviceInputWithDevice:deviceAudio];
  
  [mainSession addInput:video error:&amp;error];
  [mainSession addInput:audio error:&amp;error];
  
  QTCaptureMovieFileOutput* output = [[QTCaptureMovieFileOutput alloc] init];
  [output recordToOutputFileURL:[NSURL URLWithString:@"Users/chasemeadors/Desktop/capture1.mov"]];
  
  [mainSession addOutput:output error:&amp;error];
  
  [movieView setCaptureSession:mainSession];
  
  [mainSession startRunning];
  
  }
  </code></pre>
  
  <p>Also, I'm not sure about the whole error parameter that the methods keep calling for, I saw the "&amp;error" symbol in an example but I don't know what it means.</p>
  
  <p>I'm also getting an error "cannot initialize a device that is not open" when I explicitly open the devices. </p>
  
  <p>If anyone could help me sort this out, it'd be a great help, thanks.</p>