Search code examples
iphonecamera

iPhone Camera Recording FPS


Is there a way to force iPhone to record at 30fps regardless of light conditions?

Is there a way to force iPhone camera to record at higher fps by reducing resolution?

What is the optimum way of finding out iPhone FPS other than analyzing recorded stream?

My main target is iPhone4 or 4S.


Solution

  • You can set the frame record rate by using the min/max frame duration:

    https://developer.apple.com/documentation/avfoundation/avcaptureconnection/1388931-videominframeduration https://developer.apple.com/documentation/avfoundation/avcaptureconnection/1390246-videomaxframeduration

    You have to configure the capturing manually using the AVFoundation:

    https://developer.apple.com/library/archive/documentation/AudioVideo/Conceptual/AVFoundationPG/Articles/04_MediaCapture.html#//apple_ref/doc/uid/TP40010188-CH5-SW17

    About the way of finding, I don't know but I do analyze the video stream.

    You can see how its done from this code:

    http://aptogo.co.uk/2011/09/face-tracking/

    (just check the delegate method of the video capture, you will notice it immediately since it has FPS all over that part and it does say // Update FPS calculation)

    Edit:

    The previously linked documents are for mac os, in this case they are valid for the purpose but here are the iOS versions:

    The AVFoundation class reference. https://developer.apple.com/library/archive/documentation/AudioVideo/Conceptual/AVFoundationPG/Articles/00_Introduction.html

    The Connection class reference (to set the fps). https://developer.apple.com/documentation/avfoundation/avcaptureconnection