我正在实现自定义相机,为此我想设置曝光持续时间。
我设置滑块属性的代码是-
slider.maximumValue = Float(CMTimeGetSeconds(camera.activeFormat.maxExposureDuration))
slider.minimumValue = Float(CMTimeGetSeconds(camera.activeFormat.minExposureDuration))
现在,每当更改滑块时,设置曝光时间时就会出现问题。
我的代码看起来像这样 -
change(duration: CMTimeMakeWithSeconds(Double(slider.value), 600), iso: AVCaptureISOCurrent)
但在
func CMTimeMakeWithSeconds(_ seconds: Float64, _ preferredTimescale: Int32) -> CMTime
我对它感到困惑preferredTimescale
,它的价值应该是多少,它在 600 上运行良好,但什么是理想价值。