Could you please help take a look and let me know if there might be anything incorrect in my setup? The app crashes when setting the frame rate for an external camera, even though HaishinKit already checks isFrameRateSupported.
These crashes are observed in Firebase Crashlytics and occur quite frequently. I’ve included one representative example above, but there are many similar cases with different supported FPS ranges.
Fatal Exception: NSInvalidArgumentException
*** -[AVCaptureDevice setActiveVideoMinFrameDuration:]
Unsupported frame duration - Supported ranges: ( "<AVFrameRateRange: 30 - 30>" ),
tried to set maxFrameRate to 24.000000
0 CoreFoundation __exceptionPreprocess
1 libobjc.A.dylib objc_exception_throw
2 AVFCapture -[AVCaptureFigVideoDevice setActiveVideoMinFrameDuration:]
3 myliveapp VideoDeviceUnit.setFrameRate(_:) (VideoDeviceUnit.swift:117)
4 myliveapp CameraLiveStreamVC.setupCamera()
5 myliveapp MediaMixer.configuration(video:)
do {
// Sets to input frameRate.
try? await mixer.configuration(video: 0) { video in
do {
try video.setFrameRate(Float64(videoFrame.fps))
} catch {
logger.error(error)
}
guard let device = video.device else { return }
try device.lockForConfiguration()
device.ramp(toVideoZoomFactor: zoomFactor, withRate: 5.0)
device.unlockForConfiguration()
}
// Sets to output frameRate.
try await mixer.setFrameRate(Float64(videoFrame.fps))
} catch {
DispatchQueue.main.async {
let alertController = UIAlertController(title: "Errror", message: error.localizedDescription, preferredStyle: .alert)
alertController.addAction(UIAlertAction(title: "OK", style: .default, handler: nil))
self.present(alertController, animated: true, completion: nil)
}
logger.error(error)
}
Discussed in #1903
Originally posted by noho501 April 10, 2026
Question
Could you please help take a look and let me know if there might be anything incorrect in my setup? The app crashes when setting the frame rate for an external camera, even though HaishinKit already checks isFrameRateSupported.
These crashes are observed in Firebase Crashlytics and occur quite frequently. I’ve included one representative example above, but there are many similar cases with different supported FPS ranges.
Here is my code:
Background / Tried Steps
Environment
Device: iPad mini (A17 Pro)
OS: iPadOS 26.3.1
External Camera (Type-C)
Crash log: Firebase Crashlytics
Haishinkit 2.2.5