react-native-vision-camera/README.md

85 lines
3.2 KiB
Markdown
Raw Normal View History

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>
<br />
2021-02-19 08:08:26 -07:00
2021-02-20 08:45:10 -07:00
<div>
<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
VisionCamera is a powerful and fast Camera component for React Native. It features:
2023-09-07 03:54:45 -06:00
* 📸 Photo and Video capture
* 📱 Customizable devices and multi-cameras ("fish-eye" zoom)
* 🎞️ Customizable resolutions and aspect-ratios (4k/8k images)
* ⏱️ Customizable FPS (30..240 FPS)
* 🧩 [Frame Processors](https://react-native-vision-camera.com/docs/guides/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
* ⚡ Custom C++/GPU accelerated video pipeline (OpenGL)
2021-02-20 08:48:32 -07: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)
* [Example](./package/example/)
* [Frame Processor Plugins](https://react-native-vision-camera.com/docs/guides/frame-processor-plugin-list)
2021-02-20 08:49:13 -07:00
2023-09-01 12:32:04 -06:00
### V3
You're looking at the V3 version of VisionCamera, which features a full rewrite on the Android codebase and a huge refactor on the iOS codebase. If you encounter issues on V3, you can also [downgrade to V2](https://github.com/mrousavy/react-native-vision-camera/tree/v2), which is still partially supported.
2021-02-20 08:45:10 -07:00
### Example
```tsx
function App() {
const device = useCameraDevice('back')
2021-02-20 08:45:10 -07: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
> See the [example](./package/example/) app
### 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>
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.
### Socials
2021-02-24 13:56:50 -07: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
* 💖 [**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