iAv*_*ose 5 compression video reduce ios avassetwriter
我成功地将AVFoundation Framework的AVCaptureVideoPreviewLayer捕获的一系列图像编码为使用AVAssetWriter和AVAssetWriterInput的视频.
但是视频的大小太大了,在这种情况下,你们中的任何人都可以向我推荐一个教程或者至少是直接的我,或者给我正确的视频压缩视频输出设置.
我正在使用以下VideoOutputSetting.
videoOutputSettings = @{
AVVideoCodecKey: AVVideoCodecH264,
AVVideoWidthKey: [NSNumber numberWithInt:width],
AVVideoHeightKey: [NSNumber numberWithInt:height],
AVVideoCompressionPropertiesKey: @{
AVVideoAverageBitRateKey: [NSNumber numberWithInt:bitrate],
AVVideoMaxKeyFrameIntervalKey: @(150),
AVVideoProfileLevelKey: AVVideoProfileLevelH264BaselineAutoLevel,
AVVideoAllowFrameReorderingKey: @NO,
AVVideoH264EntropyModeKey: AVVideoH264EntropyModeCAVLC,
AVVideoExpectedSourceFrameRateKey: @(30),
AVVideoAverageNonDroppableFrameRateKey: @(30)
}
};
videoWriterInput = [AVAssetWriterInput assetWriterInputWithMediaType:AVMediaTypeVideo outputSettings:videoSettings];
_videoWriterInput.expectsMediaDataInRealTime = YES;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3596 次 |
| 最近记录: |