我会制作缩小尺寸的视频,可能宽50像素,长度75像素。这些是物理尺寸。
如何设置呢?在视频设置中吗?我认为AVVideoWidthKey和AVVideoHeightKey更多用于分辨率而不是我需要的物理尺寸。
NSDictionary *videoSettings = [NSDictionary dictionaryWithObjectsAndKeys:
AVVideoCodecH264, AVVideoCodecKey,
[NSNumber numberWithInt: 320], AVVideoWidthKey,
[NSNumber numberWithInt:480], AVVideoHeightKey,
nil];
AVAssetWriterInput* writerInput = [[AVAssetWriterInput
assetWriterInputWithMediaType:AVMediaTypeVideo
outputSettings:videoSettings] retain
AVVideoMaxKeyFrameIntervalKey
指定了访问关键帧之间最大间隔的关键。相应的值是NSNumber
的一个实例。1
表示仅关键帧。 - Regexident