title: AVCaptureSession image dimensions (with GPUImage)
body: <p>I am trying to implement video recording in iOS on top of the GPUImage.</p>
  
  <p>I have a GPUImageVideoCamera and I am trying to set up recording like this:</p>
  
  <pre><code>-(void)toggleVideoRecording {
  if (!self.recording) {
      self.recording = true;
      GPUImageMovieWriter * mw = [self createMovieWriter: self.filter1];
  
      [self.filter1 addTarget:mw];
      mw.shouldPassthroughAudio = YES;
      [mw startRecording];
  }
  else {
      self.recording = false;
      [self finishWritingMovie];
  }
  </code></pre>
  
  <p>}</p>
  
  <pre><code>-(GPUImageMovieWriter *) createMovieWriter:(GPUImageFilter *) forFilter {
      NSString *pathToMovie = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/CurrentMovie.m4v"];
      unlink([pathToMovie UTF8String]);
      NSURL *movieURL = [NSURL fileURLWithPath:pathToMovie];
  
      GPUImageMovieWriter * mw = [[GPUImageMovieWriter alloc] initWithMovieURL:movieURL size:forFilter-&gt;currentFilterSize];
      self.movieWriter = mw;
      self.movieURL = movieURL;
  
      return mw;
  }
  </code></pre>
  
  <p>This actually mostly works. However, MoviewWriter needs the CGSize of the input media, and I don't know how to pull it out of the VideoCamera. First of all, the size varies, because the camera is using sessionPreset: AVCaptureSessionPresetHigh, meaning it varies depending on the device's capabilities. And secondly, the orientation changes the relevant CGSize. If the user starts recording in landscape mode, I want to transpose the dimensions.</p>
  
  <p>For anyone who knows how to do this with vanilla CoreVideo, I can pull the AVCaptureSession out of my GPUImageVideoCamera. (But I've read the API for AVCaptureSession and nothing looked promising).</p>
  
  <p>Even referring me to a sample project that is handling this would be very helpful.</p>