Release 3.1.0
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
useCameraDeviceanduseCameraFormat(#1784) (977b859) / (#1841) (2d96381) - Make
getAvailableCameraDevices()synchronous (#1784) (977b859) - Add
addCameraDevicesChanged(...)listener (#1784) (977b859) - Add
resizeModeprop for Preview (cover/contain) (#1838) (3169444) / (#1817) (c0b80b3) with @blancham - Support 10-bit Video HDR (#1827) (9809075)
- New
useCameraPermission()anduseMicrophonePermission()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
TemplatesAPI for choosing Camera Formats (#1844) (706341f) - New array-based
useCameraFormatsAPI (#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
h264videoCodec type for RecordVideoOptions (#1808) (18c7034) by @iketiunn - Fix exposing
userPreferredCameraDeviceon 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)