Skip to content

Instantly share code, notes, and snippets.

@panupan
Created September 4, 2012 00:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save panupan/3615273 to your computer and use it in GitHub Desktop.
Save panupan/3615273 to your computer and use it in GitHub Desktop.
iOS Controlling Video Capture FPS rate
- (void)captureOutput:(AVCaptureOutput *)captureOutput
didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer
fromConnection:(AVCaptureConnection *)connection
{
if (connection.isVideoMinFrameDurationSupported && connection.videoMinFrameDuration.timescale != FPS) {
connection.videoMinFrameDuration = CMTimeMake(1, FPS);
}
if (connection.isVideoMaxFrameDurationSupported && connection.videoMaxFrameDuration.timescale != FPS) {
connection.videoMaxFrameDuration = CMTimeMake(1, FPS);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment