iOS AVCaptureSession - How to get/set the number of frames per second recorded?

后端 未结 4 1618
梦如初夏
梦如初夏 2021-02-04 05:29

I\'m new to AVCaptureSession and wish to better understand how to work with it. So I managed capturing the video stream as separated CIImages and convert them to UIImages. Now I

4条回答
  •  天涯浪人
    2021-02-04 06:09

    You could use AVCaptureConnection's videoMinFrameDuration accessor to set the value.

    See the AVCaptureConnection documentation

    Consider output be AVCaptureVideoDataOutput object.

    AVCaptureConnection *conn = [output connectionWithMediaType:AVMediaTypeVideo];
    
    if (conn.isVideoMinFrameDurationSupported)
        conn.videoMinFrameDuration = CMTimeMake(1, CAPTURE_FRAMES_PER_SECOND);
    if (conn.isVideoMaxFrameDurationSupported)
        conn.videoMaxFrameDuration = CMTimeMake(1, CAPTURE_FRAMES_PER_SECOND);
    

    More info, see my answer in this SO question

提交回复
热议问题