【问题标题】:How to set the frame rate of iOS camera如何设置iOS相机的帧率
【发布时间】:2016-08-18 16:51:43
【问题描述】:

我是 iOS 编码的新手,现在我想设置 iOS 前置摄像头的帧,比如 18 fps 或 25 fps。这是我的代码,我很困惑,无论我如何更改activeVideoMinFrameDuration和activeVideoMaxFrameDuration的值,最终的视频总是30fps。

 do {
            try videoDevice!.lockForConfiguration()
            videoDevice!.activeVideoMinFrameDuration = CMTimeMake(1, 20)
            videoDevice!.activeVideoMaxFrameDuration = CMTimeMake(1, 20)
            videoDevice!.unlockForConfiguration()
        } catch let error as NSError {
                NSLog("Could not lock device for configuration: %@", error)
      }

【问题讨论】:

    标签: ios camera


    【解决方案1】:

    您可能还需要设置

    videoFileOutput.movieFragmentInterval = CMTime(seconds: 1, preferredTimescale: 25)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-07-04
      相关资源
      最近更新 更多