Skip to content

mrousavy/react-native-vision-camera

Β 
Β 

Repository files navigation

Vision Camera



πŸ“Έ The Camera library that sees the vision.
npm i react-native-vision-camera@vc2
npx pod-install
Buy Me a Coffee at ko-fi.com



V2

This is the V2 branch of VisionCamera (2.x.x on npm, tag: vc2). Since VisionCamera V3 (current main, 3.x.x on npm, tag: latest) features a full codebase rewrite on Android and a huge refactor on the iOS codebase, I will try to provide limited support for VisionCamera V2 for a while until V3 has been tested enough to be considered fully stable.

However, I will not provide free support for V2 anymore. I will be merging community PRs to the v2 branch if necessary as well as fixing some critical issues and releasing them, but I will not help you fix your app on v2.

It is recommended that everybody upgrades to VisionCamera V3. If you have any issues upgrading, ask in the community discord.

Note

The documentation hosted on https://react-native-vision-camera.com represents the documentation for V3. For V2, read the docs/ folder here.

VisionCamera V2 requires React Native 0.70+, iOS 11+, Android API 21+, Xcode 15+.

Documentation

Features

  • Photo, Video and Snapshot capture
  • Customizable devices and multi-cameras (smoothly zoom out to "fish-eye" camera)
  • Customizable FPS
  • Frame Processors (JS worklets to run QR-Code scanning, facial recognition, AI object detection, realtime video chats, ...)
  • Smooth zooming (Reanimated)
  • Fast pause and resume
  • HDR & Night modes

See the example app

Example

function App() {
  const devices = useCameraDevices('wide-angle-camera')
  const device = devices.back

  if (device == null) return <LoadingView />
  return (
    <Camera
      style={StyleSheet.absoluteFill}
      device={device}
      isActive={true}
    />
  )
}

Adopting at scale

This library helped you? Consider sponsoring!

VisionCamera is provided as is, I work on it in my free time.

If you're integrating VisionCamera in a production app, consider funding this project and contact me to receive premium enterprise support, help with issues, prioritize bugfixes, request features, help at integrating VisionCamera and/or Frame Processors, and more.


πŸš€ Get started by setting up permissions!