docs/content/docs/fps.mdx
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
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.
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
CameraSessioninternally negotiates constraints together, and may downgrade FPS if needed. To check if a specific combination is supported upfront, useisSessionConfigSupported(...).
To set the target FPS, pass an { fps: ... } constraint in your constraints:
<Tabs items={["<Camera /> (view)", "useCamera(...) (hook)", "CameraSession (imperative)"]} groupId="api-style" persist> <Tab value="<Camera /> (view)">
function App() {
const device = useCameraDevice('back')
return (
<Camera
style={StyleSheet.absoluteFill}
isActive={true}
device={device}
constraints={[
// [!code ++]
{ fps: 60 }
]}
/>
)
}