iOS Take Multiple Screen Shots

前端 未结 2 2045
盖世英雄少女心
盖世英雄少女心 2020-12-28 23:18

I have an NSURL that contains a video, and I want to record a frame of that video ten times every seconds. And I have code that will capture an image of my

2条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-28 23:43

    With CMTimeMake(A, B) you store a rational number, an exact fraction A / B seconds, and first parameter of this function takes int value. For 20 seconds video you will capture a frame with time ((int) 19.9) / 10 = 1.9 second in the last iteration of your cycle. Use CMTimeMakeWithSeconds(i, NSEC_PER_SEC) function to fix this time issue.

提交回复
热议问题