关于摄像头采集到视频流的帧数修改
作者:
iOS扫地僧 | 来源:发表于
2017-09-26 10:05 被阅读0次
关键代码
- (void)updateFps:(NSInteger) fps{
NSArray *videoDevices = [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo];
for (AVCaptureDevice *vDevice in videoDevices) {
float maxRate = [(AVFrameRateRange *)[vDevice.activeFormat.videoSupportedFrameRateRanges objectAtIndex:0] maxFrameRate];
if (maxRate >= fps) {
if ([vDevice lockForConfiguration:NULL]) {
vDevice.activeVideoMinFrameDuration = CMTimeMake(10, (int)(fps * 10));
vDevice.activeVideoMaxFrameDuration = vDevice.activeVideoMinFrameDuration;
[vDevice unlockForConfiguration];
}
}
}
}
本文标题:关于摄像头采集到视频流的帧数修改
本文链接:https://www.haomeiwen.com/subject/fptsextx.html
网友评论