2023-09-01 13:42:11 -06:00
< a href = "https://margelo.io" >
< picture >
< source media = "(prefers-color-scheme: dark)" srcset = "./docs/static/img/banner-dark.png" / >
< source media = "(prefers-color-scheme: light)" srcset = "./docs/static/img/banner-light.png" / >
< img alt = "VisionCamera" src = "./docs/static/img/banner-light.png" / >
< / picture >
< / a >
2022-04-11 07:55:03 -06:00
2023-09-01 09:31:10 -06:00
< br / >
2021-02-19 08:08:26 -07:00
2021-02-20 08:45:10 -07:00
< div >
2021-03-03 04:37:43 -07:00
< img align = "right" width = "35%" src = "docs/static/img/example.png" >
2021-02-20 08:45:10 -07:00
< / div >
2021-02-19 08:08:26 -07:00
2021-02-20 08:48:32 -07:00
### Features
2023-09-29 08:15:02 -06:00
VisionCamera is a powerful, high-performance Camera library for React Native. It features:
2023-09-01 09:31:10 -06:00
2023-09-07 03:54:45 -06:00
* 📸 Photo and Video capture
2023-10-04 04:53:52 -06:00
* 👁️ QR/Barcode scanner
2023-09-07 03:54:45 -06:00
* 📱 Customizable devices and multi-cameras ("fish-eye" zoom)
* 🎞️ Customizable resolutions and aspect-ratios (4k/8k images)
* ⏱️ Customizable FPS (30..240 FPS)
2023-10-04 04:56:47 -06:00
* 🧩 [Frame Processors ](https://react-native-vision-camera.com/docs/guides/frame-processors ) (JS worklets to run facial recognition, AI object detection, realtime video chats, ...)
2023-09-07 03:54:45 -06:00
* 🔍 Smooth zooming (Reanimated)
* ⏯️ Fast pause and resume
* 🌓 HDR & Night modes
2023-09-22 09:22:31 -06:00
* ⚡ Custom C++/GPU accelerated video pipeline (OpenGL)
2021-02-20 08:48:32 -07:00
2023-09-01 09:31:10 -06:00
Install VisionCamera from npm:
```sh
yarn add react-native-vision-camera
cd ios & & pod install
```
..and get started by [setting up permissions ](https://react-native-vision-camera.com/docs/guides )!
### Documentation
* [Guides ](https://react-native-vision-camera.com/docs/guides )
* [API ](https://react-native-vision-camera.com/docs/api )
2023-09-01 10:15:28 -06:00
* [Example ](./package/example/ )
2023-09-01 09:31:10 -06:00
* [Frame Processor Plugins ](https://react-native-vision-camera.com/docs/guides/frame-processor-plugin-list )
2021-02-20 08:49:13 -07:00
2024-01-09 10:11:28 -07:00
### ShadowLens
2023-09-01 12:32:04 -06:00
2024-01-09 10:11:28 -07:00
To see VisionCamera in action, check out [ShadowLens ](https://mrousavy.com/projects/shadowlens )!
2023-09-01 12:32:04 -06:00
2021-02-20 08:45:10 -07:00
### Example
```tsx
function App() {
2023-09-25 04:57:03 -06:00
const device = useCameraDevice('back')
2021-02-20 08:45:10 -07:00
2023-09-25 04:57:03 -06:00
if (device == null) return < NoCameraErrorView / >
2021-02-20 08:45:10 -07:00
return (
< Camera
style={StyleSheet.absoluteFill}
device={device}
2021-02-23 02:56:05 -07:00
isActive={true}
2021-02-20 08:45:10 -07:00
/>
)
}
```
2021-02-24 13:56:50 -07:00
2023-09-01 10:15:28 -06:00
> See the [example](./package/example/) app
2023-09-01 09:31:10 -06:00
2021-09-08 08:02:42 -06:00
### Adopting at scale
2021-09-15 05:28:20 -06:00
< a href = "https://github.com/sponsors/mrousavy" >
2021-09-15 05:28:54 -06:00
< img align = "right" width = "160" alt = "This library helped you? Consider sponsoring!" src = ".github/funding-octocat.svg" >
2021-09-15 05:28:20 -06:00
< / a >
2021-09-08 08:02:42 -06:00
VisionCamera is provided _as is_ , I work on it in my free time.
2021-09-08 08:37:20 -06:00
If you're integrating VisionCamera in a production app, consider [funding this project ](https://github.com/sponsors/mrousavy ) and < a href = "mailto:me@mrousavy.com?subject=Adopting VisionCamera at scale" > contact me</ a > to receive premium enterprise support, help with issues, prioritize bugfixes, request features, help at integrating VisionCamera and/or Frame Processors, and more.
2021-09-08 08:02:42 -06:00
2023-09-01 09:31:10 -06:00
### Socials
2021-02-24 13:56:50 -07:00
2023-09-01 09:31:10 -06:00
* 🐦 [**Follow me on Twitter** ](https://twitter.com/mrousavy ) for updates
* 📝 [**Check out my blog** ](https://mrousavy.com/blog ) for examples and experiments
2023-09-01 16:54:09 -06:00
* 💬 [**Join the Margelo Community Discord** ](https://discord.gg/6CSHz2qAvA ) for chatting about VisionCamera
2023-09-01 09:31:10 -06:00
* 💖 [**Sponsor me on GitHub** ](https://github.com/sponsors/mrousavy ) to support my work
* 🍪 [**Buy me a Ko-Fi** ](https://ko-fi.com/mrousavy ) to support my work