FPS
Adjusting Frame Rate (FPS) for Preview, Video and Frame outputs
A Camera's Frame Rate can be configured per CameraSessionConnection and affects Preview- (see "The Preview Output"), Video- (see "The Video Output") and Frame- (see "The Frame Output") outputs.
Get available FPS ranges
Each CameraDevice lists the FPS ranges it supports individually via supportedFPSRanges.
Additionally, you can check if a specific fixed FPS value is individually supported via supportsFPS(...):
const device = ...
const allRanges = device.supportedFPSRanges
const supports60 = device.supportsFPS(60)Tip
While a device may support a given FPS individually, it is not guaranteed to be supported with all possible feature and output combinations. The CameraSession internally negotiates constraints together, and may downgrade FPS if needed.
To check if a specific combination is supported upfront, use isSessionConfigSupported(...).
Set FPS
To set the target FPS, pass an { fps: ... } constraint in your constraints:
function App() {
const device = useCameraDevice('back')
return (
<Camera
style={StyleSheet.absoluteFill}
isActive={true}
device={device}
constraints={[
{ fps: 60 }
]}
/>
)
}function App() {
const device = useCameraDevice('back')
const camera = useCamera({
isActive: true,
device: device,
constraints: [
{ fps: 60 }
]
})
}const session = await VisionCamera.createCameraSession(false)
const device = await getDefaultCameraDevice('back')
await session.configure([
{
input: device,
constraints: [
{ fps: 60 }
]
}
], {})
await session.start()