Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
let framesPerSecond = min(self.nominalFrameRate, self.framesPerSecond)
let processedFrameIdx = Int64(self.nominalFrameRate / framesPerSecond)
guard self.frameCounter.value % processedFrameIdx == 0 else {
sample = self.assetReader?.outputs.first?.copyNextSampleBuffer()
continue
}
usleep(UInt32(1000 * Int(1000.0 * 1.0 / framesPerSecond) * self.framesRate))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.