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 3.4.0

Published by mrousavy about 1 year ago

3.4.0 (2023-10-16)

Woohoo, another VisionCamera release! โœจ Highlights:

[!IMPORTANT]
3.4.0 now requires ๐Ÿ”ง Xcode 15 or higher.

โœจ Features

๐Ÿ› Bug Fixes

  • Fix CodeScanner stalling on Android ๐Ÿฅณ (#2009) (e8ae11e)
  • Also close outputs in destroy() (10a44d5)
  • Always call CaptureSession fully synchronously under Mutex (#1972) (18b30cd)
  • Catch errors in CaptureSession configuration (18e6926)
  • Close CameraSession in onDetachedFromWindow() (#1962) (02726d4)
  • Close previous Outputs to free memory (727fb39)
  • Fix focus() on iOS (#1943) (a4448c3)
  • Fix basic Orientation on iOS (#2000) (ea98112)
  • Fix FpsGraph not updating (315fcb6)
  • Fix PreviewView overflowing on Android (#2001) (fab5bdc)
  • Fix torch not turning off after it has been enabled (#1997) (62ca957)
  • Remove Frame Processor when Camera unmounts (#1960) (d51ac15)
  • Run CodeScanner on default queue, fix stalling (#2002) (e8df714)

๐Ÿ“š Documentation

react-native-vision-camera - Release 2.16.3

Published by mrousavy about 1 year ago

2.16.3 (2023-10-16)

๐Ÿ› Bug Fixes

  • Default minSdk is 23 (e91d335)
  • Unbind Camera in onDetachedFromWindow and fix minSdkVersion (#1955) (aa3fe77)
react-native-vision-camera - Release 3.3.1

Published by mrousavy about 1 year ago

3.3.1 (2023-10-05)

โœจ Features

  • Add "Camera Devices" screen to Example (#1927) (1843f7a)
  • Add enableCodeScanner to Expo Config Plugin (ffd64fe)
  • Add Expo Config Plugin for CodeScanner MLKit Barcode Model downloader (#1916) (6e249d1)

๐Ÿ› Bug Fixes

๐Ÿ“š Documentation

react-native-vision-camera - Release 2.16.2

Published by mrousavy about 1 year ago

2.16.2 (2023-10-05)

๐Ÿ› Bug Fixes

  • Fix "Fatal error: AVCaptureDevice.Position has unknown state" (503114b), closes #1840
  • Fix Xcode 15 crash when using +(void)load (2ae4439)
  • Updated orientation calculations (#1544) (f35644d)
  • Use initialize instead of +load (45742ad)
  • Use VISION_CONCAT(initialize_) (8554aa2)
react-native-vision-camera - Release 3.3.0

Published by mrousavy about 1 year ago

3.3.0 (2023-10-04)

The most requested feature is here: VisionCamera 3.3.0 now finally contains a QR-code/Barcode scanner! ๐ŸŽ‰

https://github.com/mrousavy/react-native-vision-camera/assets/15199031/ab9c6f5b-250a-4101-a122-4118e80fb698

Check out the Code Scanner documentation.

โœจ Features

๐Ÿ› Bug Fixes

  • Also clean VisionCamera build cache (2c08e5a)
  • Clean C++ CMake cache (.cxx/) on clean (4fc8cd2)
  • Fix +load not available in Xcode 15 error (#1908) (1cdc3d1)
  • Fix CamcorderProfile get crash on Samsung devices (#1907) (83c0cdb)
  • Make HardwareBuffers compile optionally (opt-out in minSdkVersion <26) (#1910) (8d90dcc)
  • Only use supported PixelFormats (9a777ba)
  • Remove dng PixelFormat (d465c37)
  • Set minSdkVersion to 23 (#1911) (324e269)
  • Use dynamic video format (224bffd)
  • Use simple wide-angle device if no options are passed (#1909) (24f77fb)

๐Ÿ“š Documentation

react-native-vision-camera - Release 3.2.2

Published by mrousavy about 1 year ago

3.2.2 (2023-09-30)

๐Ÿ› Bug Fixes

  • Fix useCameraDevices ignoring position (edd7361)
react-native-vision-camera - Release 3.2.1

Published by mrousavy about 1 year ago

3.2.1 (2023-09-30)

๐Ÿ› Bug Fixes

  • Fix redeclaration build error on Android (2430058)
react-native-vision-camera - Release 3.2.0

Published by mrousavy about 1 year ago

3.2.0 (2023-09-29)

VisionCamera 3.2.0 is another big release, I spent another 150 hours getting this out!
Huge shoutout to all my sponsors, thank you for supporting me! โค๏ธ

Three major changes:

  • You can now control videoBitRate for recording videos! ๐Ÿš€ Check out the video bit rate documentation.
  • Frame Processors now work in YUV again by routing images through ImageReader into the OpenGL pipeline. This is a temporary solution until Android has an API that allows auto-resizing of Frames written with ImageWriter. Right now, ImageWriter can only write Images that exactly match the target surface's resolution, which crashes when we switch Cameras while recording.
  • Fixes zoom and some undefined errors ๐Ÿ’ช

โœจ Features

  • Add customizable Video Bit Rate (videoBitRate) (#1882) (902dc63)
  • Route images through ImageWriter into OpenGL pipeline (#1874) (954b448)
  • Use AHardwareBuffer* for frame.toArrayBuffer() (#1888) (cf1952d)

๐Ÿ’จ Performance

  • Route images through ImageWriter into OpenGL pipeline (#1874) (954b448)
  • Use AHardwareBuffer* for frame.toArrayBuffer() (#1888) (cf1952d)

๐Ÿ› Bug Fixes

  • Allow getCameraDevice to return undefined when no Devices are available (e.g. iOS Simulator) (#1848) (f7428f2)
  • Allow nil preferredDevice (fb6ebd9), closes #1870
  • Fix incorrect zoom on Android < 11 (#1878) (fb812a6), closes #1865 by @touchmarine
  • Remove unused Error codes (#1887) (85564d6)
  • Use compressed buffer format as default format as well (#1884) (9d02f51)

๐Ÿ“š Documentation

react-native-vision-camera - Release 3.1.0

Published by mrousavy about 1 year ago

3.1.0 (2023-09-25)

VisionCamera 3.1.0 features a ton of changes including an all new devices API (useCameraDevice(..)), a new formats API (useCameraFormat(..)), USB Cameras support, resizeMode for the Preview, performance improvements, buffer compression, and an all new rewritten documentation!

I spent around 100 hours on this release, so if you appreciate my work please consider ๐Ÿ’– sponsoring me on GitHub or ๐Ÿช buy me a Ko-Fi :)

The new documentation is live at react-native-vision-camera.com.

Warning: There are breaking changes to the device selection APIs. The new Device APIs look like this:

const device = useCameraDevice('back')
const format = useCameraFormat(device, [
  { fps: 60 },
  { videoResolution: 'max' }
])
return <Camera {...props} device={device} />

โœจ Features

  • โœจ New JS API for useCameraDevice and useCameraFormat (#1784) (977b859) / (#1841) (2d96381)
  • Make getAvailableCameraDevices() synchronous (#1784) (977b859)
  • Add addCameraDevicesChanged(...) listener (#1784) (977b859)
  • Add resizeMode prop for Preview (cover/contain) (#1838) (3169444) / (#1817) (c0b80b3) with @blancham
  • Support 10-bit Video HDR (#1827) (9809075)
  • New useCameraPermission() and useMicrophonePermission() hooks (#1823) (327aade)
  • Add support for LiDAR, TrueDepth, External (USB) and Continuity Camera Devices (iOS 17) (#1824) (cf4882b)
  • Add support for Buffer Compression for a more efficient Video Pipeline (enableBufferCompression) (#1828) (fffefa9)
  • Add Templates API for choosing Camera Formats (#1844) (706341f)
  • New array-based useCameraFormats API (#1841) (2d96381)
  • Use C++ OpenGL GPU VideoPipeline again (#1836) (9add0eb), closes #1789

๐Ÿ› Bug Fixes

  • Fix Preview on Android being stretched/not centered (#1817) (c0b80b3) by @blancham
  • Also properly convert any[] -> List<Object> in FP Android (#1760) (b4b0e49)
  • Consider everything between 24mm and 43mm a wide-angle lense (#1782) (a4ace35)
  • Fix h264 videoCodec type for RecordVideoOptions (#1808) (18c7034) by @iketiunn
  • Fix exposing userPreferredCameraDevice on Android (aafffa6)
  • Fix incorrect RGB pixelFormat check (8864866)
  • Fix passing options to frame processors on iOS (#1750) (6dd1d41)
  • Fix potential bug in Photo Orientation (#1765) (eddb01f)
  • Log plugin name in assertion (#1786) (648c363)

๐Ÿ’จ Performance Improvements

  • Optimize OpenGL Video Pipeline (#1789) (4e96eb7)
  • Automatically use compressed buffers for efficiency in Video Pipeline (#1828) (fffefa9)
  • Much faster Camera initialization time by making getAvailableCameraDevices() synchronous/instant (no more await!) (#1784) (977b859)

๐Ÿ“š Documentation

react-native-vision-camera - Release 2.16.1

Published by mrousavy about 1 year ago

2.16.1 (2023-09-19)

๐Ÿ› Bug Fixes

  • Consider everything between 24mm and 43mm a wide-angle camera lens (4ceb531)
  • Fix Example app (2493844)
  • Fix TS (c7d061b)
  • Remove kotlin-android-extensions (10b22d8)
  • restore support for v2 without frame processors (#1812) (e905069)
react-native-vision-camera - Release 2.16.0

Published by mrousavy about 1 year ago

2.16.0 (2023-09-18)

โœจ Features

  • Reanimated v3 support in RNVisionCamera v2 (#1759) (fe947bb)
react-native-vision-camera - Release 3.0.0 โœจ

Published by mrousavy about 1 year ago

3.0.0 (2023-09-01)

โœจ VisionCamera V3!!!! โœจ

This is the third major version for VisionCamera, VisionCamera V3, which features a full codebase rewrite on Android, and a huge refactor on iOS to make it more stable, more flexible, and more performant than ever!

[!NOTE]
If you want to keep using V2, I plan to provide limited support to V2 on the V2 branch here.

Journey

VisionCamera V3 has been an intense journey for me, I spent over 700 hours in total to build VisionCamera V3 and make it as fast and powerful as possible. Lots of research went into this, and writing a custom OpenGL GPU pipeline in C++ is far from easy - there ain't no documentation about this online at all!

Here's the original V3 issue/discussion board: https://github.com/mrousavy/react-native-vision-camera/issues/1376

If you appreciate what I'm doing in VisionCamera, please ๐Ÿ’– consider sponsoring me on GitHub ๐Ÿ’– or ๐Ÿช buy me a Ko-Fi ๐Ÿช to show your support. Thank you!

These are some of the major features:

๐Ÿค– 1. Full Android Camera2 rewrite

On Android, there's three APIs for using the Camera: Camera1 (deprecated), Camera2 and CameraX. Camera2 is known for being insanely hard to use, so Google built CameraX, a library which uses Camera2 under the hood but significantly simplifies it to make it easier to use.
This sounds great at first, so I used CameraX for VisionCamera V1 and V2. Unfortunately due to their simplifications (and it being immature), a lot of features that worked on iOS were simply broken or not working on Android.

In V3 I now rewrote the entire Android codebase from CameraX to the lower-level Camera2 library, which allows for many new great features:

  • Multi-cams ("fish-eye" zoom) now work on Android! ๐ŸŸ
    Fish-eye zoom demo
  • Startup time has been significantly improved and the overall performance is much better! ๐Ÿ”ฅ
  • Device Formats now finally show the correct videoWidth/videoHeight and photoWidth/photoHeight sizes! โœ…
  • 60 FPS Cameras now work! ๐Ÿ’จ
  • Greatly increased stability overall throughout the Camera ๐Ÿ’ช
  • Build setup got much simpler which fixed hundreds of issues! Not even kidding, this fixed ~130 issues here since we no longer depend on androidx.camera:+ ๐Ÿฅ‡
  • Photo capture got much faster and mirroring images is much more performant ๐Ÿ”ฅ

โš ๏ธ Warning

Because this is a full rewrite to a much lower-level library on Android, there might be some things that broke. Please make sure to report an issue if you spot such things.
Currently, these are the things that are not yet working on Android:

  • โŒ Flash (this requires a custom precapture/auto-exposure sequence, I'll work on that soon)
  • โŒ Orientation (this requires a lot of testing and figuring out how orientation has to be handled, some devices like Samsung work differently here)
  • โŒ Focus (focus works, but the coordinate system is wrong. This requires Orientation to work first)

๐Ÿ“น 2. Custom GPU OpenGL Video Pipeline

On Android I built a custom GPU OpenGL video pipeline in C++ that will handle the rendering of the input Frames to multiple output Surfaces (currently only Video Recordings and Frame Processing). This is roughly how it works:

Camera-->GL_TEXTURE_EXTERNAL_OES;
  GL_TEXTURE_EXTERNAL_OES -- PassThroughShader -->FP[Frame Processor Output EGLSurface];
  GL_TEXTURE_EXTERNAL_OES -- PassThroughShader -->VR[Video Recorder Output EGLSurface];

The FP and VR output surfaces can be swapped at any point, meaning adding or removing a Frame Processor is much more performant. Also, this implicitly handles resizing the buffers to match the output dimensions fully automatically on the GPU, making it insanely fast.

The main benefit of this pipeline is that we no longer need to attach two outputs to the Camera but only one - the OpenGL VideoPipeline itself. This introduces two new features on Android:

  • The supportsParallelProcessing prop is gone since this is now always supported! ๐Ÿ”€๐Ÿคฉ
  • Flipping the Camera now works on Android! ๐Ÿ”„๐Ÿคฉ

๐Ÿ“ท 3. New Camera Features

  • The pixelFormat prop has been added which allows you whether to stream rgb, yuv or native frames in a Frame Processor.
  • enableShutterSound has been added to takePhoto() to play or mute the sound on photo capture
  • New Frame Processor features:
    • Frames can be converted to a cached byte array using frame.toByteArray(). This is pretty efficient and can be used to process the raw pixels using libraries like react-native-fast-tflite.
    • Frames now expose their pixelFormat (either yuv, rgb or native)
    • Frames now expose their orientation
    • Frames now expose isMirrored
    • Frames now expose a timestamp
  • Camera Devices now expose their sensorOrientation (the orientation that you have to rotate by to get to the device neutral portrait orientation)
  • Camera Devices expose their hardwareLevel
  • Videos can now be recorded either in h264 or h265 (HEVC) ๐Ÿ”ฅ
  • Use minFps/maxFps in favour of frameRateRanges

๐Ÿงต 4. New Frame Processor Engine (react-native-worklets-core)

Frame Processors now use react-native-worklets-core in favor of react-native-reanimated. With this refactor, there's a few changes:

  • You can now use JSI HostObjects and HostFunctions from outside in the Frame Processor. For example, using a JSI library like react-native-tflite is now seamlessly possible:
    // `model` is a C++ JSI HostObject
    const model = useTensorflowModel(require('assets/face-detector.tflite'))
    
    const frameProcessor = useFrameProcessor((frame) => {
      'worklet'
    
      const pixels = frame.toArrayBuffer()
      // `model` can be used in this 'worklet' without copying anything!
      const faces = model.run(pixels)
    }, [model])
    
    This makes it much easier for general purpose processing libraries to be used inside Frame Processors. For this example, TFLite can run any .tflite model with your Camera, all from JS while still being powered by C++/GPU.
  • The build setup got a lot simpler since we no longer need to extract reanimated's .aar. This should fix a ton of build errors.
  • Frame Processors are now fully synchronous
  • New API to run something asynchronous: runAsync(..):
    const frameProcessor = useFrameProcessor((frame) => {
      'worklet'
      console.log('New Frame')
    
      runAsync(frame, () => {
        'worklet'
        const faces = detectFaces(frame)
        const face = [faces0]
        console.log(`Detected a new face: ${face}`)
      })
    })
    
    New Frames can stream in ('New Frame' being logged) while the async context is still executing detectFaces fully in parallel.
  • New API to run something at a throttled FPS rate: runAtTargetFps(.., fps):
    const frameProcessor = useFrameProcessor((frame) => {
      'worklet'
      console.log('New Frame')
    
      runAtTargetFps(5, () => {
        'worklet'
        const faces = detectFaces(frame)
        console.log(`Detected a new face: ${faces[0]}`)
      })
    })
    
    In this case, the face detector will only be called 5 times per second.

๐Ÿ”ง 5. New Frame Processor Plugin API

Frame Processor Plugins are now object oriented and can be initialized from JS with custom options. This will allow you to pass options like which model to use, fast or accurate, to a native FP plugin like a face-detection or pose-detection algorithm.

Old syntax:

export function examplePlugin(frame: Frame) {
  'worklet'
  return VisionCameraPlugins.__examplePlugin(frame)
}

New syntax:

const plugin = VisionCameraProxy.getFrameProcessorPlugin('example_plugin')

export function examplePlugin(frame: Frame) {
  'worklet'
  return plugin.call(frame)
}

And the getFrameProcessorPlugin can also accept options, which is a NSDictionary on iOS in the init: call and a Dictionary<> on Android in the constructor.

See the ExampleFrameProcessorPlugin.m/ExampleFrameProcessorPlugin.java for the native changes.

๐ŸŽจ Skia

If you followed the V3 journey you might know that originally I planned to add Skia support for VisionCamera, allowing you to draw onto a Frame in realtime.

This was possible until VisionCamera V3 RC.9 with an amazingly simple API:

const paint = Skia.Paint()
paint.setColor('red')

const frameProcessor = useSkiaFrameProcessor((frame) => {
  'worklet'
  const faces = detectFaces(frame)
  faces.forEach((face) => {
    const rect = Skia.Rect(face.x, face.y, face.width, face.height)
    frame.drawRect(face.rectangle, paint)
  })
}, [paint])

Or, to implement color filters (VHS filter, sepia, beauty, invert colors, ...) you could simply use Skia Shaders:

const INVERTED_COLORS_SHADER = `
uniform shader image;

half4 main(vec2 pos) {
  vec4 color = image.eval(pos);
  return vec4(1.0 - color.rgb, 1.0);
}
`

const imageFilter = Skia.ImageFilter.MakeRuntimeShader(INVERTED_COLORS_SHADER)
const paint = Skia.Paint()
paint.setImageFilter(imageFilter)

const frameProcessor = useSkiaFrameProcessor((frame) => {
  'worklet'
  frame.render(paint)
}, [])

...and the resulting texture that was rendered would also be written to a video or photo file if you started capturing.

Buuuuuuut I decided to remove Skia support from VisionCamera, as the codebase just got way to complex for me to maintain the two pipelines (one skia and one without skia). See this PR for more information on that: https://github.com/mrousavy/react-native-vision-camera/pull/1740 (this even includes the entire code for that lol)

If you/your business wants this, reach out to me/us through our website margelo.io and we can build a customized Camera solution for you - it works, it's just not suitable for the VisionCamera repo, I want to keep that lean. On our website we even have a demo with a custom solution for one of our clients, Stori, which implements realtime face filters just like on Snapchat.

Full Changelog

โœจ Features

  • Full Android rewrite from CameraX to Camera2 ๐Ÿคฏ
  • Add pixelFormat property to Camera (df5718d)
  • Create C++/OpenGL-based Video Pipeline for more efficient Recording and Frame Processing (#1721) (ea3686c), closes #1727
  • Replace *NativeMap and *NativeArray with Map<K,V> and List<T> for faster JSI -> JNI calls (#1720) (dfb86e1)
  • Skia for Android (#1731) (a7c137d), closes #1735 #1736
  • Use ImageReader and use YUV Image Buffers in Skia Context (#1689) (d38ba59)
  • Video Recording with Camera2 (#1691) (a81bbbc)
  • Replace Reanimated with RN Worklets (#1468) (a0590dc)
  • Sync Frame Processors (plus runAsync and runAtTargetFps) (#1472) (30b5615)
  • Add enableShutterSound prop to takePhoto() ๐Ÿ”Š (#1702) (a46839a)
  • Allow build without Skia or Frame Processors (#1710) (862e05b)
  • Full Android rewrite (CameraX -> Camera2) (#1674) (37a3548), closes #1689 #1691
  • Implement enableZoomGesture on Android (efe6556)
  • Support focus() on Android (#1713) (23af74a)
  • Use ByteBuffer for much faster toArrayBuffer() โšก (521d7c8)
  • Draw onto Frame as if it was a Skia Canvas (#1479) (12f850c), closes #1487
  • Add fpsGraph prop to show a debug view of the current FPS the Camera is drawing at (#1479
  • Add previewType prop to switch between native OS preview and the Skia Canvas preview view (#1479
  • Add toByteArray(), orientation, isMirrored and timestamp to Frame (#1487)
  • Better Native Module Error Detection (#1515) (f791c6b)
  • Make Frame Processor Plugins object-oriented on iOS as well (#1496) (622d383)
  • New CameraDevice + CameraFormat detection using CameraX (#1495) (0d83a13)
  • Add RN 0.72 support (namespace in build.gradle) (7ae15af)
  • Better Native Module Error Detection (#1515) (f791c6b)
  • Complete iOS Codebase rewrite (#1647) (375e894)
  • Expose unified VisionCameraProxy object, make FrameProcessorPlugins object-oriented (#1660) (44ed42d)
  • Make Frame Processor Plugins object-oriented on iOS as well (#1496) (622d383)
  • New CameraDevice + CameraFormat detection using CameraX (#1495) (0d83a13)
  • Rewrite Android C++ part (VisionCameraProxy + JFrame) (#1661) (86dd703)
  • Use clang-format to keep the C++ codebase clean (#1741) (03b57a7)

๐Ÿ’จ Performance Improvements

  • Improve pixelFormat and add CameraDevice.sensorOrientation (#1729) (0e9f1ca)

๐Ÿ› Bug Fixes

  • Fix CI for V3 (#1475) (f0ea181)
  • Prevent possible crash in log error handler (222ded4)
  • Print correct error in build.gradle (6825c1f)
  • Add missing <regex> header (0635d4a)
  • Fix global.FrameProcessorPlugins TS error (1f7a2e0)
  • Make runAsync run truly async by dropping new Frames while executing (https://github.com/mrousavy/react-native-vision-camera/pull/1479/commits/3ea5dfabb9f9ff17dfdfc5b7b94ee4da5731229e)
  • Catch device == null error (f227a3e)
  • Fix runAtTargetFps for multiple invocations per FP (af4e366)
  • Fix Android namespace (cf19ff2)
  • Fix missing Camera error (38749fb)
  • Fix Skia build (#1582) (f03dde7)
  • ignore duplicate .so libraries in package (ad5d64b)
  • Improve C++ safety by attaching Cache Invalidator to jsi::Runtime's lifecycle (#1488) (0c3cd66)
  • Remove RN Skia dependency on Android for now (61f19df)
  • Remove temp-patch for REA plugin (6deb686)
  • Set min iOS version to 12.4 (bb7ab30)
  • Simplify Podfile (0111f2e)
  • Use global.expo.modules for JSI expo modules (a1af891)
  • Catch device == null error (f227a3e)
  • Downgrade Gradle to 7.5.1 (66c6481)
  • Fix runAtTargetFps for multiple invocations per FP (af4e366)
  • Fix Android namespace (cf19ff2)
  • Fix FP Plugin init call (c2096a4)
  • Fix missing Camera error (38749fb)
  • Fix namespace (deeb8db)
  • Fix Skia build (#1582) (f03dde7)
  • Fix Worklets imports (5fb594c)
  • ignore duplicate .so libraries in package (ad5d64b)
  • Improve C++ safety by attaching Cache Invalidator to jsi::Runtime's lifecycle (#1488) (0c3cd66)
  • Move implementation for FrameProcessorPlugin to .m (bc9c157)
  • pragma once (127656b)
  • Remove iOS 13 guard (7c721cc)
  • Remove RN Skia dependency on Android for now (61f19df)
  • Remove temp-patch for REA plugin (6deb686)
  • Set min iOS version to 12.4 (bb7ab30)
  • Simplify Podfile (0111f2e)
  • Use global.expo.modules for JSI expo modules (a1af891)
  • Use correct Gradle version (0139324)
  • Don't enable Stream Use Case if it's not 100% supported (224b44f)
  • Fix make_shared not working on FrameHostObject (1197df7)
  • Fix Metro Config (46c6f28)
  • Fix recreate when outputs change (71bc242)
  • Fix various Android crashes by using Stable CameraX version (#1665) (3b3515c)
  • Keep Outputs (9829dc4)
  • Return not-determined on Android (debe751)
  • Run View Finder on UI Thread (1485910)
  • Use Orientation (c7e4756)
  • Use AUDIO_BIT_RATE of 16 * 44,1Khz (18de121)
  • Use Snapshot Template for speed capture prio (17e1bc7)
  • Add GrMTLHandle import (390f48d)
  • Clean up codebase (e1b0408)
  • Don't error if session closes (1f12192)
  • Fix JByteBuffer (3a0d7b3)
  • Fix make_shared not working on FrameHostObject (1197df7)
  • Fix circular dependency in FrameProcessorPlugins.ts (c88605e)
  • Fix various Android crashes by using Stable CameraX version (#1665) (3b3515c)
  • Improve build.gradle (07ba0e1)
  • Improve performance of zoom, fps, hdr and format selection (4b009a0)
  • Remove unused constructor (94d9b69)
  • Remove unused imports (617c560)
  • Use default HDR if not applicable (0a51980)
  • Use direct ByteBuffer (86468e3)
  • Error on disabled Frame Processors (d275812)
  • Export pixelFormat property on iOS (dfee3b1)
  • Fix node_modules/ directory detection (66c012f)
  • Lock PixelBuffer for read in toArrayBuffer() (e036b31)
  • Fix scene mode crash on some emulators (6bbb44d)
  • Make Skia and Worklets optional in package.json (#1728) (3b04757)

๐Ÿ“š Documentation

๐Ÿ”ง Codebase

  • Use clang-format to keep the C++ codebase clean (#1741) (03b57a7)

2.15.6 (2023-08-14)

react-native-vision-camera - Release 3.0.0-rc.10

Published by mrousavy about 1 year ago

3.0.0-rc.10 (2023-09-01)

โœจ Features

  • Use clang-format to keep the C++ codebase clean (#1741) (03b57a7)

๐Ÿ’จ Performance Improvements

  • Improve pixelFormat and add CameraDevice.sensorOrientation (#1729) (0e9f1ca)

๐Ÿ“š Documentation

react-native-vision-camera - Release 3.0.0-rc.9

Published by mrousavy about 1 year ago

3.0.0-rc.9 (2023-09-01)

โœจ Features

  • Create C++/OpenGL-based Video Pipeline for more efficient Recording and Frame Processing (#1721) (ea3686c), closes #1727
  • Replace *NativeMap and *NativeArray with Map<K,V> and List<T> for faster JSI -> JNI calls (#1720) (dfb86e1)
  • Skia for Android (#1731) (a7c137d), closes #1735 #1736

๐Ÿ› Bug Fixes

  • Fix scene mode crash on some emulators (6bbb44d)
  • Make Skia and Worklets optional in package.json (#1728) (3b04757)
react-native-vision-camera - Release 3.0.0-rc.8

Published by mrousavy about 1 year ago

3.0.0-rc.8 (2023-08-25)

๐Ÿ› Bug Fixes

  • Error on disabled Frame Processors (d275812)
  • Export pixelFormat property on iOS (dfee3b1)
  • Fix node_modules/ directory detection (66c012f)
  • Lock PixelBuffer for read in toArrayBuffer() (e036b31)
react-native-vision-camera - Release 3.0.0-rc.6

Published by mrousavy about 1 year ago

3.0.0-rc.6 (2023-08-24)

โœจ Features

  • Add enableShutterSound prop to takePhoto() ๐Ÿ”Š (#1702) (a46839a)
  • Allow build without Skia or Frame Processors (#1710) (862e05b)
  • Full Android rewrite (CameraX -> Camera2) (#1674) (37a3548), closes #1689 #1691
  • Implement enableZoomGesture on Android (efe6556)
  • Support focus() on Android (#1713) (23af74a)
  • Use ByteBuffer for much faster toArrayBuffer() โšก (521d7c8)

๐Ÿ› Bug Fixes

  • Add GrMTLHandle import (390f48d)
  • Clean up codebase (e1b0408)
  • Don't error if session closes (1f12192)
  • Fix JByteBuffer (3a0d7b3)
  • Fix make_shared not working on FrameHostObject (1197df7)
  • Fix circular dependency in FrameProcessorPlugins.ts (c88605e)
  • Fix various Android crashes by using Stable CameraX version (#1665) (3b3515c)
  • Improve build.gradle (07ba0e1)
  • Improve performance of zoom, fps, hdr and format selection (4b009a0)
  • Remove unused constructor (94d9b69)
  • Remove unused imports (617c560)
  • Use default HDR if not applicable (0a51980)
  • Use direct ByteBuffer (86468e3)

2.15.5 (2023-07-31)

๐Ÿ› Bug Fixes

  • Fix Failed to parse camera Id error by ignoring non-integer cameras (#1428) (8833ac1)
  • Pin fbjni to version 0.4.0 (8b9b702)
  • Use HostTimeClock as fallback if masterClock is nil (#1302) (b8527d7)

๐Ÿ“š Documentation

react-native-vision-camera - Release 3.0.0-rc.5

Published by mrousavy about 1 year ago

3.0.0-rc.5 (2023-08-17)

This is the first RC for the fully rewritten Android codebase which now uses Camera2 instead of CameraX.

There might be a few bugs here and there to iron out, but overall the rewrite allows for much more flexibility, performance and new features for VisionCamera.

โœจ Features

  • Full Android rewrite from CameraX to Camera2 ๐Ÿคฏ
  • Add pixelFormat property to Camera (df5718d)
  • Use ImageReader and use YUV Image Buffers in Skia Context (#1689) (d38ba59)
  • Video Recording with Camera2 (#1691) (a81bbbc)

๐Ÿ› Bug Fixes

  • Don't enable Stream Use Case if it's not 100% supported (224b44f)
  • Fix make_shared not working on FrameHostObject (1197df7)
  • Fix Metro Config (46c6f28)
  • Fix recreate when outputs change (71bc242)
  • Fix various Android crashes by using Stable CameraX version (#1665) (3b3515c)
  • Keep Outputs (9829dc4)
  • Return not-determined on Android (debe751)
  • Run View Finder on UI Thread (1485910)
  • Use Orientation (c7e4756)
  • Use AUDIO_BIT_RATE of 16 * 44,1Khz (18de121)
  • Use Snapshot Template for speed capture prio (17e1bc7)
react-native-vision-camera - Release 2.15.6

Published by mrousavy about 1 year ago

2.15.6 (2023-08-14)

๐Ÿ› Bug Fixes

  • Fix various Android crashes by using Stable CameraX version (#1665) (3b3515c)
react-native-vision-camera - Release 3.0.0-rc.4

Published by mrousavy about 1 year ago

3.0.0-rc.4 (2023-07-31)

  • Lots under the hood changes
  • Full C++ codebase rewrite on iOS
  • Full C++ codebase rewrite on Android
  • Android now works! ๐ŸŒฎ
  • New hook: useSkiaFrameProcessor
  • Frame Processor Plugins are now object oriented and can be initialized from JS with custom options. This will allow you to pass options like which model to use, fast or accurate, to a native FP plugin like a face-detection or pose-detection algorithm.

Old syntax:

export function examplePlugin(frame: Frame) {
  'worklet'
  return VisionCameraPlugins.__examplePlugin(frame)
}

New syntax:

const plugin = VisionCameraProxy.getFrameProcessorPlugin('example_plugin')

export function examplePlugin(frame: Frame) {
  'worklet'
  return plugin.call(frame)
}

And the getFrameProcessorPlugin can also accept options, which is a NSDictionary on iOS in the init: call.

๐Ÿ“š Documentation

โœจ Features

  • Add RN 0.72 support (namespace in build.gradle) (7ae15af)
  • Better Native Module Error Detection (#1515) (f791c6b)
  • Complete iOS Codebase rewrite (#1647) (375e894)
  • Expose unified VisionCameraProxy object, make FrameProcessorPlugins object-oriented (#1660) (44ed42d)
  • Make Frame Processor Plugins object-oriented on iOS as well (#1496) (622d383)
  • New CameraDevice + CameraFormat detection using CameraX (#1495) (0d83a13)
  • Rewrite Android C++ part (VisionCameraProxy + JFrame) (#1661) (86dd703)

๐Ÿ› Bug Fixes

  • Catch device == null error (f227a3e)
  • Downgrade Gradle to 7.5.1 (66c6481)
  • Fix runAtTargetFps for multiple invocations per FP (af4e366)
  • Fix Android namespace (cf19ff2)
  • Fix FP Plugin init call (c2096a4)
  • Fix missing Camera error (38749fb)
  • Fix namespace (deeb8db)
  • Fix Skia build (#1582) (f03dde7)
  • Fix Worklets imports (5fb594c)
  • ignore duplicate .so libraries in package (ad5d64b)
  • Improve C++ safety by attaching Cache Invalidator to jsi::Runtime's lifecycle (#1488) (0c3cd66)
  • Move implementation for FrameProcessorPlugin to .m (bc9c157)
  • pragma once (127656b)
  • Remove iOS 13 guard (7c721cc)
  • Remove RN Skia dependency on Android for now (61f19df)
  • Remove temp-patch for REA plugin (6deb686)
  • Set min iOS version to 12.4 (bb7ab30)
  • Simplify Podfile (0111f2e)
  • Use global.expo.modules for JSI expo modules (a1af891)
  • Use correct Gradle version (0139324)
react-native-vision-camera - Release 2.15.5

Published by mrousavy about 1 year ago

2.15.5 (2023-07-31)

๐Ÿ“š Documentation

๐Ÿ› Bug Fixes

  • Fix Failed to parse camera Id error by ignoring non-integer cameras (#1428) (8833ac1)
  • Pin fbjni to version 0.4.0 (8b9b702)
  • Use HostTimeClock as fallback if masterClock is nil (#1302) (b8527d7)