title: AVAssetWriter giving bluish video file
body: <p>I am recoding a video from my app's screen using the AVAssetWriter class.
  Video records. but the recoded video is bluish one.
  my code to set up the AVAssetWriter is below</p>
  
  <pre><code>-(BOOL) setUpWriter {
      NSError* error = nil;
      videoWriter = [[AVAssetWriter alloc] initWithURL:[self tempFileURL] fileType:AVFileTypeAppleM4V error:&amp;error];
      NSParameterAssert(videoWriter);
  
      //Configure video
      NSDictionary* videoCompressionProps = [NSDictionary dictionaryWithObjectsAndKeys:
                                             [NSNumber numberWithDouble:1024.0*1024.0], AVVideoAverageBitRateKey,
                                             nil ];
  
      CGSize size=[CCDirector sharedDirector].winSize;
      NSDictionary* videoSettings = [NSDictionary dictionaryWithObjectsAndKeys:
                                     AVVideoCodecH264, AVVideoCodecKey,
                                     [NSNumber numberWithInt:size.width], AVVideoWidthKey,
                                     [NSNumber numberWithInt:size.height], AVVideoHeightKey,
                                     videoCompressionProps, AVVideoCompressionPropertiesKey,
                                     nil];
  
      videoWriterInput = [[AVAssetWriterInput assetWriterInputWithMediaType:AVMediaTypeVideo outputSettings:videoSettings] retain];
  
      NSParameterAssert(videoWriterInput);
      videoWriterInput.expectsMediaDataInRealTime = YES;
      NSDictionary* bufferAttributes = [NSDictionary dictionaryWithObjectsAndKeys:
                                        [NSNumber numberWithInt:kCVPixelFormatType_32ARGB], kCVPixelBufferPixelFormatTypeKey, nil];
  
      avAdaptor = [[AVAssetWriterInputPixelBufferAdaptor assetWriterInputPixelBufferAdaptorWithAssetWriterInput:videoWriterInput sourcePixelBufferAttributes:bufferAttributes] retain];
  
      //add input
      [videoWriter addInput:videoWriterInput];
      [videoWriter startWriting];
      [videoWriter startSessionAtSourceTime:CMTimeMake(0, 1000)];
  
      return YES;
  }
  </code></pre>
  
  <p>Is there any bugs in my code.
  How can I solve this problem</p>