forked from mrousavy/react-native-vision-camera
-
Notifications
You must be signed in to change notification settings - Fork 10
Closed
Description
描述 / Description
问题:拍照保存延迟平均在6s以上。
期望:保持在2s以内。
问题复现demo:
import { Button, Text, View } from 'react-native';
import React, { useRef } from 'react';
import { Camera, useCameraDevice, useCameraFormat, useCameraPermission } from 'react-native-vision-camera';
export default function VisionCameraDemo() {
const device = useCameraDevice('back');
const format = useCameraFormat(device, [
{ videoResolution: { width: 3048, height: 2160 } },
{ fps: 60 },
]);
const { hasPermission, requestPermission } = useCameraPermission();
const camera = useRef<Camera>(null);
if (!device) {
return <Text>No Devices</Text>;
}
if (!hasPermission) {
requestPermission();
}
const onTakePhoto = async () => {
const photoFile = await camera.current?.takePhoto();
console.log("takePhoto photoFile:" + photoFile);
};
return (
<View style={{ width: "100%", height: "80%", display: "flex" }}>
<Camera
style={{ flex: 1 }}
ref={camera}
device={device}
format={format}
isActive={true}
preview={true}
photo={true}
/>
<View style={{ width: '100%', position: 'absolute', bottom: 0, left: 0, zIndex: 999 }}>
<Button title="拍照" onPress={onTakePhoto}></Button>
</View>
</View>
);
}
复现步骤 / Steps to reproduce
No response
库版本 / Library version
4.0.1-0.0.12
React Native OpenHarmony version
0.72.29
构建类型 / Build type
Debug app & dev bundle
设备 / Device
Real device
设备版本 / Device model
Mate 60 pro(NEXT.0.0.65)
已悉知 / Acknowledgements
Yes
Metadata
Metadata
Assignees
Labels
No labels