3

我正在实现自定义相机,为此我想设置曝光持续时间。

我设置滑块属性的代码是-

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 上运行良好,但什么是理想价值。

4

1 回答 1

6

你应该在这里查看讨论

首选时间刻度将为您的秒数添加一个分母,这意味着如果您设置 5 秒,preferredTimeScale 为 60,它将是 1/12 秒

于 2017-07-27T11:27:43.393 回答