不管我选择AVVideoWidthKey、AVVideoHeightKey、AVVideoCleanApertureWidthKey还是AVVideoCleanApertureHeightKey,我的视频分辨率都将是320x240或480x360。
我正在尝试以480p保存视频,我所有的缓冲区都是640x480,我的会话在AVCaptureSessionPreset640x480上,所有内容都是640x480,但我的输出视频仍然被缩小了。
我使用的是AVAssetWriterInputPixelBufferAdaptor和传入的CMSampleBufferRef,它的大小是640x480。
我已经找遍了堆栈溢出,但我还没有发现这个问题被报告。:/
发布于 2011-12-15 10:47:43
我一直在使用这个设置,它是有效的。这是一个代码示例。
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];https://stackoverflow.com/questions/8394935
复制相似问题