I use this setting all the time and it works. Here is a code sample.
self.compressionProperties = [[[NSMutableDictionary alloc] initWithObjectsAndKeys:
[NSNumber numberWithInt:params.bps], AVVideoAverageBitRateKey,
[NSNumber numberWithInt:params.keyFrameInterval],AVVideoMaxKeyFrameIntervalKey,
//videoCleanApertureSettings, AVVideoCleanApertureKey,
params.videoProfileLevel, AVVideoProfileLevelKey,
nil ] autorelease];
self.videoSettings = [[[NSMutableDictionary alloc] initWithObjectsAndKeys:AVVideoCodecH264, AVVideoCodecKey,
[NSNumber numberWithInt:params.outWidth], AVVideoWidthKey,
[NSNumber numberWithInt:params.outHeight], AVVideoHeightKey,
self.compressionProperties, AVVideoCompressionPropertiesKey,
nil] autorelease];
...
wobj.writerInput = [[[AVAssetWriterInput alloc] initWithMediaType:AVMediaTypeVideo outputSettings:self.videoSettings] autorelease];
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…