- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在 Swift 中使用 AVCaptureDevice 进行捕获时,我尝试将帧速率设置为每秒 10 帧。
我相信这是通过设置 AVCaptureDevice 的 activeVideoMaxFrameDuration 来实现的,但也许我做错了,还有一种不同的方法。
这是我当前的代码,运行时没有错误,但对预览或捕获的视频中的帧速率没有任何影响,视频仍然看起来是全动态的。
var devices = AVCaptureDevice.devicesWithMediaType(mediaType);
var captureDevice: AVCaptureDevice = devices[0] as AVCaptureDevice;
captureDevice.lockForConfiguration(&error)
captureDevice.activeVideoMinFrameDuration = CMTimeMake(1,10)
captureDevice.activeVideoMaxFrameDuration = CMTimeMake(1,10)
captureDevice.unlockForConfiguration()
我已经检查了 AVCaptureDeviceFormat videoSupportedFrameRateRanges minFrameRate 并应支持每秒 10 帧。
将 CMTime 更改为 videoSupportedFrameRateRanges 之外的内容确实会引发错误,因此我知道代码正在被使用,但它没有任何效果。
预先感谢您的帮助
最佳答案
我认为您应该在捕获 session 开始运行后更改设备配置才能生效。我希望这对你有用,就像对我一样。 干杯 =)
关于ios - 在 Swift 中设置 AVCaptureSession 中 AVCaptureDevice 的低帧率,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27830371/
我有摄像头,即 AVCaptureDevice,我确定闪光灯已关闭,但现在我需要关闭相机噪音,有办法做到这一点吗? NSArray* cams = [AVCaptureDevice devicesWi
我编写了以下代码,但无法获取相机设备。它总是崩溃 guard let captureDevice = AVCaptureDevice.default(.builtInDualCamera, for:
我目前正在使用 AVCaptureSession 用相机拍照。 我正在使用: device.automaticallyEnablesLowLightBoostWhenAvailable = YES;
我正在尝试通过 AVCaptureDevice 使用 iPhone 的后置摄像头。我尝试了 AVCaptureDevicePositionBack 和 AVCaptureDevicePositionF
我一直在使用 AVCaptureDevice 实现自定义相机,这需要自动对焦和曝光才能很好地工作。我正在使用以下代码来进行相机初始化 - (void) initializeCamera { A
我正在使用 AVCaptureDevice setFocusModeLocked 来实现从 A 点到 B 点的聚焦斜坡。我这样做的方法是将 delta 定义为类似于 0.03 的值,然后重复调用 AP
我正在尝试用这个 tutorial 创建一个二维码扫描器 我没有得到任何设备。 let deviceDiscoverySession = AVCaptureDevice.DiscoverySessio
我正在使用 AVFoundation/AVFoundation.h 用我的相机做一个项目。现在,我想实现缩放屏幕。 我查看了关于AVCaptureDevice的文档,发现了一个名为“videoZoom
我有一个视频 AVCaptureDevice (AVMediaTypeVideo),我正在使用 setExposureTargetBias:completionHandler 暂时减少曝光,然后再次恢
我有一个简单的 AVCaptureSession 正在运行,以在我的应用程序中获取相机源并拍照。如何使用相机的 UIGestureRecognizer 实现“双指缩放”功能? 最佳答案 接受的答案实际
查看 AVCaptureDevice ,手电筒和闪光灯设置都有属性。他们俩似乎都有相同的方法。我知道“ torch ”是英国纵火狂们对手电筒的称呼,但它们真的用两个不同的名字做同样的事情吗? 最佳答案
所以问题很简单:如何使用 AVCaptureDevice、AVCaptureSession、AVCaptureDeviceInput 和 AVCaptureAudioFileOutput 以特定的采样
我在尝试获取 OS X 上的任何捕获设备输入端口时遇到问题。特别是音频(例如内置麦克风)。这是我正在运行的代码。 NSArray * devices = [AVCaptureDevice device
macOS 10.14 NSMicrophoneUsageDescription Record audio! 这适用于一个快速的项目: AVCaptureDevice.requestAcces
我想出了如何使用 deviceWhiteBalanceGainsForTemperatureAndTintValues 调整现有 session 的温度和色调,它采用 AVCaptureWhiteBa
我正在制作一个使用 AVCaptureVideoPreviewLayer 的非常简单/标准的相机应用程序。当用户按下按钮时,我调用 AVCaptureStillImageOutput 上的 captu
我在我的项目中使用了 Apple 的 GLCameraRipple 示例代码,我想知道是否有办法拍摄照片/视频?项目可以在 https://developer.apple.com/library/io
我有一个基于 AVCam 的 View Controller ,我添加了一个 UIButton 来切换手电筒。这是执行该操作的代码: - (IBAction)toggleTorchLight:(id)
我的 View 扫描条形码,然后转到另一个 View ,在该 View 中从网站加载有关条形码的信息。我的问题是,扫描后屏幕卡住,而不是立即转到新 View ,在新 View 中它将显示加载指示器,直
这是我的代码: if AVCaptureDevice.authorizationStatus(for: AVMediaType.video) == .authorized { let devi
我是一名优秀的程序员,十分优秀!