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

Dad*_*ado 1 video avfoundation ios

看起来无论是什么AVVideoWidthKey,AVVideoHeightKey,AVVideoCleanApertureWidthKey,AVVideoCleanApertureHeightKey我选择,我的视频分辨率为320×240两种或480x360.

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

我正在使用AVAssetWriterInputPixelBufferAdaptor,CMSampleBufferRef而我已经使用了它,它是640x480.

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

Ste*_*lin 5

我一直使用这个设置,它的工作原理.这是一个代码示例.

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];
Run Code Online (Sandbox Code Playgroud)