I’m an iOS developer working on a project that involves livestreaming with the Theta X.
When connecting to the Theta device via USB, I set the frame rate to 29 FPS.
for format in device.formats {
for range in format.videoSupportedFrameRateRanges {
try device.lockForConfiguration()
device.activeFormat = format
let validFps = validatedFPS(fps, in: range)
let frameDuration: CMTime = CMTime(value: 1, timescale: Int32(validFps))
device.activeVideoMinFrameDuration = frameDuration
device.activeVideoMaxFrameDuration = frameDuration
device.unlockForConfiguration()
break
}
private func validatedFPS(_ fps: Int, in range: AVFrameRateRange) -> Int {
if fps >= Int(range.maxFrameRate) {
return Int(range.maxFrameRate)
} else if fps <= Int(range.minFrameRate) {
return Int(range.minFrameRate)
} else {
return fps
}
}
However, the actual FPS measured in the function
func captureOutput(_ output: AVCaptureOutput, didOutput sampleBuffer: CMSampleBuffer, from connection: AVCaptureConnection)
is only around 15 or 16.
I’m connecting the Theta X to an iPad via USB.
Is there any way to achieve 29 or 30 FPS as specified in Theta X’s technical documentation?