react-native-vision-camera

📸 A powerful, high-performance React Native Camera library.

MIT License

Downloads
545.4K
Stars
7.1K
Committers
102

Bot releases are hidden (Show)

react-native-vision-camera - Release 4.5.3 Latest Release

Published by mrousavy about 1 month ago

4.5.3 (2024-09-08)

✨ Features

📚 Documentation

  • Add react-native-fast-opencv to community plugins (#3153) (dd7db38)
react-native-vision-camera - Release 4.5.2

Published by mrousavy about 2 months ago

4.5.2 (2024-08-20)

✨ Features

🐛 Bug Fixes

  • Stop orientation listener updates on camera close (#3139) (54dbf5f)

📚 Documentation

  • fix options typo in iOS frame processor instructions (#3110) (77e9817)
react-native-vision-camera - Release 4.5.1

Published by mrousavy 3 months ago

4.5.1 (2024-07-29)

✨ Features

  • Add custom path for takePhoto/takeSnapshot/startRecording (#3103) (2ab7458)
  • Throw an Error if Frame is already destroyed (#3099) (b3f5ab6)

🐛 Bug Fixes

  • Fix RecordingSession edge-cases (#3102) (a8d13fa)
  • Fix Skia Rotation when landscape-left (0654898)
  • react-native-worklets-core module resolution for pnpm (#3088) (2357b5a)
  • Remove sensorOrientation hack on iOS, it's always portrait (#3096) (d670ca9)

📚 Documentation

react-native-vision-camera - Release 4.5.0

Published by mrousavy 3 months ago

4.5.0 (2024-07-12)

🐛 Bug Fixes

react-native-vision-camera - Release 4.4.3

Published by mrousavy 3 months ago

4.4.3 (2024-07-12)

✨ Features

  • Add minFps and maxFps props (#3074) (23bfe15)
  • Capture better quality photos by using minFps from format (#3073) (4754065)

🐛 Bug Fixes

  • Don't ask for camera permission in getAvailableCameraDevices (#3072) (683d099)
  • Fix not-found plugins crashing the app (#3076) (38199e2)
react-native-vision-camera - Release 4.4.2

Published by mrousavy 3 months ago

4.4.2 (2024-07-10)

✨ Features

  • Expose .external and .continuityCamera devices (#3065) (ba12cbe)

🐛 Bug Fixes

  • Fix zoom/torch/exposure not being applied when switching device (#3066) (37525a2)
  • Fix invalid userPreferredCameraDevice (#3068) (36fdf7c)
  • Make AVCaptureDevice.sensorOrientation safer (#3064) (9a09260)
  • Set minFPS to 20 to allow maximum resolution photo (#3063) (a8ba80d)
  • Show "Your phone does not have a Camera" if no camera is found in example app (4d70469)

📚 Documentation

react-native-vision-camera - Release 4.4.1

Published by mrousavy 4 months ago

4.4.1 (2024-07-03)

✨ Features

  • Dynamically determine sensorOrientation based on default output-connection-orientation (#3046) (fadd2f1)

💨 Performance Improvements

react-native-vision-camera - Release 4.4.0

Published by mrousavy 4 months ago

4.4.0 (2024-07-02)

✨ Features

🐛 Bug Fixes

  • Fix ResolutionSelector.forSize not respecting aspect ratio (#3026) (9ca6643)
  • Fix Orientation edge-cases on iOS (#3039) (497d161)
  • Fix wrong hardcode LANDSCPAPE_LEFT value (#3022) (0c0de9e)
  • Improve CodeScanner performance by choosing resolution automatically (#2997) (2c8f766)
  • Properly reset focus on iOS (#3021) (e01d4cf)
  • Remove Gemfile/Bundler (#3023) (f5b55dc)
  • Remove portrait, portrait-upside-down, landscape-left and landscape-right options for outputOrientation (#3025) (a773bdc)

📚 Documentation

react-native-vision-camera - Release 4.3.2

Published by mrousavy 4 months ago

4.3.2 (2024-06-13)

[!WARNING]
Since the upgrade to react-native 0.74, VisionCamera is required to opt into the @FrameworkAPI by React Native.
This class is only available since react-native 0.73, so react-native-vision-camera 4.3.2 now requires react-native 0.73 or above.

If you are not yet on react-native 0.73 or above, either upgrade to react-native 0.73 or above, or downgrade to react-native-vision-camera 4.3.2 or below.

In a future version, react-native-vision-camera will require react-native 0.74 or higher, and will only work on the new architecture, so it is recommended to upgrade to react-native 0.74 and the new architecture as soon as possible.

✨ Features

🐛 Bug Fixes

react-native-vision-camera - Release 4.3.1

Published by mrousavy 4 months ago

4.3.1 (2024-06-12)

✨ Features

  • Keep one last Video Frame in memory for Snapshot (#2980) (29abc3d)
react-native-vision-camera - Release 4.3.0

Published by mrousavy 4 months ago

4.3.0 (2024-06-12)

✨ Features

  • Add onPreviewStarted and onPreviewStopped events (#2973) (2b8f72b)

🐛 Bug Fixes

  • Always initialize continuous AF/AE on iOS (#2970) (89a8806)
  • Always keep uiRotation a "short" rotation (#2971) (27b1feb)
  • fix EUNSPECIFIED quality error in takeSnapshot() (#2963) (dedb1b8)
  • Fix MetadataProvider location onStatusChanged crash (#2974) (50745dd)
  • Fix onUIRotationChanged rotation being 180deg inverted (#2962) (0247d83)
  • Fix react-native-reanimated is not installed! error when inlineRequires are enabled (#2953) (573ab81)
  • Use proper aspect ratio in Preview View on Android (#2964) (555474d)

📚 Documentation

react-native-vision-camera - Release 4.2.1

Published by mrousavy 4 months ago

4.2.1 (2024-06-10)

✨ Features

react-native-vision-camera - Release 4.2.0

Published by mrousavy 4 months ago

4.2.0 (2024-06-10)

✨ Features

  • Add onOutputOrientationChanged event (#2945) (6daea19)
  • Add onPreviewOrientationChanged event (#2956) (3a8a60e)
  • Create TrackTimeline to properly synchronize pause/resume/start/stop video/audio buffers (#2948) (d477246)

🐛 Bug Fixes

  • Fix Orientation being wrong when flipping devices (#2958) (ae5f315)
  • Initialize orientations on session re-creation (#2947) (bd955b5)
  • Split CameraSession across multiple files (#2957) (5f88b21)
react-native-vision-camera - Release 4.1.0

Published by mrousavy 5 months ago

4.1.0 (2024-06-06)

After months of planning, VisionCamera 4.1.0 now finally supports orientation! 🥳🎉
(Check out #2932 for all orientation-related changes)

✨ Features

🐛 Bug Fixes

  • Apply orientation to video output (#2912) (6c7645d)
  • Fix LocationManager abstract method error (cd18368)
  • Fix Skia Frame Processor transformation matrix (#2931) (17369de)
  • Fix view surface orientation mapping (#2907) (e0d37f0)
  • Fixed canvas.translate on withRotatedFrame for landscape-right (#2939) (5efc98b)
  • Use rotate function for landscape-right sensors (38c6983)

📚 Documentation

react-native-vision-camera - Release 4.0.5

Published by mrousavy 5 months ago

4.0.5 (2024-05-21)

🐛 Bug Fixes

  • Fix photos being black/erroring out because of photoQualityBalance="balanced" (#2897) (700a769)
  • Fix WorkletContext initialization (#2896) (8b65361)
react-native-vision-camera - Release 4.0.4

Published by mrousavy 5 months ago

4.0.4 (2024-05-15)

🐛 Bug Fixes

  • Fix componentDidUpdate() Frame Processor comparison (#2880) (e03b7f1)
  • Fix runOnUiThread executing twice if called from UI (#2883) (5335d81)
  • Fix default exposure being a bit too bright (#2869) (910e99d)
  • Fix location-not-enabled throwing even if location is disabled (#2882) (62ec8e6)
  • Make withBaseClass private, and getNativeBuffer public (#2852) (2415e1f)

📚 Documentation

  • Style Note: sections (5a26928)
  • Update TakePhotoOptions default value comment (#2861) (87f2abc)
react-native-vision-camera - Release 4.0.3

Published by mrousavy 6 months ago

4.0.3 (2024-05-06)

✨ Features

  • Create Frame.withBaseClass to ensure it's always a FrameHostObject (#2849) (688d9f4)

📚 Documentation

  • Add react-native-vision-camera-image-labeler and react-native-vision-camera-barcodes-scanner plugins (#2841) (31d13ea)
react-native-vision-camera - Release 4.0.2

Published by mrousavy 6 months ago

4.0.2 (2024-05-06)

✨ Features

  • Completely refactor the FrameProcessorPlugins.ts file into multiple files (#2830) (2e2d9b4)

🐛 Bug Fixes

  • Correct android filenames for takeSnapshot [v4] (#2812) (bfc5e35)
  • Fix app.plugin.js ESLint CI (cdbe6a9)
  • Fix RCTBlockGuard not found error (#2781) (0e5a888)
  • Fix runAsync not properly retaining/releasing Frame (#2829) (e75bb9f)
  • Fix VisionCameraProxy.workletContext being null (96c2ecf)
  • Fix CodeScanner crash (#2819) (a53166b)
  • Fix FPS Graph positioning in Skia (945c6a4)
  • Fix missing , in jsi::PropNameID (e0630eb)
  • Rename enableLocationPermission to enableLocation (f8b40fd)
  • Revert initFrameProcessorPlugin change to use VisionCameraProxy again (#2839) (d45c1c6)

📚 Documentation

  • Fix new FP Android import namespace (9812775)
  • Fix Skia invert colors shader example code (3ff02cc)
  • Lower minSdk version to 21 (d11d166)
  • Update photoHdr and lowLightBoost docs (0e9a31b)
  • Update runAsync and runAtTargetFps docs (af2707e)
  • Update react-native-vision-camera-face-detector plugin description. (#2784) (edcac50)
react-native-vision-camera - Release 4.0.0

Published by mrousavy 6 months ago

4.0.0 (2024-04-22)

VisionCamera V4 is finally here! 🥳🥳🥳🥳🚀💪

The most anticipated features are:

  • Skia Frame Processors: Finally it's reality - draw directly onto a Frame using react-native-skia! It has never been simpler to draw something onto a Frame, with a native iOS/Android app you'd spend days if not weeks on this.
    const frameProcessor = useSkiaFrameProcessor((frame) => {
      'worklet'
    
      // draw frame itself
      frame.render()
    
      // draw red rectangle into center of frame
      const centerX = frame.width / 2
      const centerY = frame.height / 2
      const rect = Skia.XYWHRect(centerX, centerY, 150, 150)
      const paint = Skia.Paint()
      paint.setColor(Skia.Color('red'))
      frame.drawRect(rect, paint)
    }, [])
    
  • CameraX rewrite: muuuuch more stability!!
  • GPS Location Tags: Adds location tags to photos and videos.

If you followed along the VisionCamera V2 -> V3 journey, you might remember that I switched from the (at-that-time-) immature CameraX library, to the low-level almost C-like Camera2 API.
The motivation behind that was that CameraX was too limiting at that time, and I wanted to gain full control over the hardware sensor and output streams.
While this worked great on my test devices, it seems like Camera2 wasn't implemented the same on all devices, and countless of weird issues arised, such as Samsung phones completely crashing, photos being rotated, frame processors running really slow on Huawei, some non-null Camera properties actually being null, etc. - the list goes on.
While I was fighting my way through Android's low-level Camera2 API, CameraX started gaining more and more interesting features, and just recently they built a new API: stream sharing.
With stream sharing, CameraX now supports all the features that VisionCamera has, and so I decided to fully rewrite the Android codebase to CameraX.
I was pretty impressed with what I built in just a few months using Camera2 APIs, but in reality this is becoming unmaintainable as countless of phone manufacturers just don't really care about Camera2 APIs, and I can't be the person monkeypatching that all the time.
Compared to VisionCamera V3, VisionCamera V4 is now much more stable, and brings a ton of new features.

✨ Features

  • Fully rewrite the Android codebase to CameraX. This brings huge stability improvements overall, and should fix countless of bugs 🥳
  • Add Skia integration to provide drawable Frame Processors! 🥳🎨
    • Add useSkiaFrameProcessor hook to create a drawable Frame Processor
    • Inside a useSkiaFrameProcessor the caller can directly draw to the frame as it extends a SkCanvas
    • Use all Skia.* APIs
    • Render the Frame with optional shaders using frame.render(shader)
  • Add GPS/EXIF Location Tags to captured photos or videos 📍
    • Add useLocationPermission hook to get location permission
    • Add enableLocation prop to <Camera>
    • Add $VCEnableLocation config option to Podfile to disable location APIs (e.g. if Apple Review is not happy with unused location APIs in your code)
  • Add photoQualityBalance prop to <Camera> to optimize the Camera pipeline for the given prioritization (speed, balanced (default) or quality)
  • Add preview prop to <Camera> to enable or disable the preview view/stream.
  • Add androidPreviewViewType prop to <Camera> to specify which preview implementation to use (surface-view is faster and supports HDR, texture-view supports transparency, masks, rotations and clipping)
  • New takeSnapshot(..) API to take instant snapshots of the video/preview streams. This can be used for intermediate results before takePhoto(..) completes. 📸
  • Use stream sharing to drop limitation of concurrent outputs - now photo, video, frameProcessor, preview and codeScanner can all be enabled at the same time!
  • Add photo HDR support to Android (using vendor-specific extensions) 🥳
  • Add video HDR support to Android (using 10-bit video HDR) 🥳
  • Always support yuv and rgb pixel-formats
    • yuv is more efficient (uses ~60% less memory than rgb, and does not need conversion)
    • rgb requires explicit conversion from yuv and will increase latency
  • Rewrite FPS Graph in JS to make it look more sexy and simplify native build (less native UI code)
  • Add support for legacy Camera1 devices
  • Lower minSdk level from 23 to 21.
  • Separate VisionCamera into three submodules/subspecs:
    • VisionCamera/Core: The core library which could be used in a native iOS/Android app
    • VisionCamera/React: React Native bindings for VisionCamera/Core
    • VisionCamera/FrameProcessors: React Native bindings for synchronous onFrame callbacks using react-native-worklets-core

❌ Deprecations

  • Remove qualityPrioritizaion parameter in takePhoto(..) in favor of new photoQualityBalance prop on <Camera>
  • Remove enablePrecapture parameter in takePhoto(..) because CameraX now properly runs precapture sequences with device-quirks ironed out
  • Remove native pixel-format since yuv is native
  • Remove enableGpuBuffers since CameraX now managed such optimizations

💨 Performance Improvements

  • Optimize for concurrent configure { ... } abort calls and give higher priority to newer update
  • Improve performance for some JNI calls (SharedArray and FrameProcessor::call)

🐛 Bug Fixes

  • Fully rewrite the Android codebase to CameraX. This brings huge stability improvements overall, and should fix countless of bugs.
  • Fix onStarted/onStopped sometimes being called a bit too early
  • Fix shutter sound playing when phone is in silent mode
  • Fix Camera not starting and appearing black on some devices
  • Fix Camera crashing because no resolution could be found
  • Fix Camera crashing the entire Android OS because GPU buffers were enabled
  • Automatically fall-back to a supported videoCodec if the given video-codec is not supported (e.g. h265 -> h264)
  • Fix Camera flipping not working sometimes
  • Use correct UIManager in findCameraView depending on the architecture (#2702) (5223f5b)

📚 Documentation

  • Update docs for Skia Frame Processors
  • Update docs for takeSnapshot
  • Update docs for V4
  • Add a ton of new Frame Processor plugins by @gev2002 (#2698) (f396ea7)
  • Update FRAME_PROCESSOR_PLUGINS.mdx (#2705) (04f89c4)

Check out the VisionCamera V4 PR (https://github.com/mrousavy/react-native-vision-camera/issues/2623) for a full list of changes.

Huge shoutout to @wcandillon for helping me get the required changes into react-native-skia! We spent a lot of time debugging weird GPU issues and optimizing the code.
These are the Skia PRs needed for the VisionCamera V4 Skia Frame Processors feature:

react-native-vision-camera - Release 4.0.0-beta.19

Published by mrousavy 6 months ago

4.0.0-beta.19 (2024-04-22)

✨ Features

🐛 Bug Fixes

  • Fix delegate guard (884b89d)
  • Fix ImageAnalysis is not supported when Extension is enabled error (#2770) (aec14b2)
  • Fix Timer is already canceled (c0f3ee0)
  • Fix Android import path due to new subfolder (406b741)
  • Make FpsSampleCollectorDelegate weak (e93c522)
  • Separate FpsSampleCollectorDelegate (83cac76)

📚 Documentation