Skip to content

Instantly share code, notes, and snippets.

@panupan
panupan / videocapturefps.m
Created September 4, 2012 00:28
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);