ios – AVAssetWriterInput,无法选择视频分辨率?

看起来无论我选择AVVideoWidthKey,AVVideoHeightKey,AVVideoCleanApertureWidthKey,AVVideoCleanApertureHeightKey,我的视频分辨率都是320×240或480×360.

我正在尝试以480p保存视频,所有缓冲区都是640×480,我的会话是AVCaptureSessionPreset640x480,一切都是640×480,但我的输出视频仍然按比例缩小.

我正在使用AVAssetWriterInputPixelBufferAdaptor和我传递给它的CMSampleBufferRef,它是640×480.

我已经查看了Stack Overflow,但我还没有发现这个问题. :/

解决方法

我一直使用这个设置,它的工作原理.这是一个代码示例.
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],self.compressionProperties,AVVideoCompressionPropertiesKey,nil] autorelease];

...

wobj.writerInput = [[[AVAssetWriterInput alloc] initWithMediaType:AVMediaTypeVideo outputSettings:self.videoSettings] autorelease];

以上是来客网为你收集整理的ios – AVAssetWriterInput,无法选择视频分辨率?全部内容,希望文章能够帮你解决ios – AVAssetWriterInput,无法选择视频分辨率?所遇到的程序开发问题。

如果觉得来客网网站内容还不错,欢迎将来客网网站推荐给程序员好友。