最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - React-native-vision-camera can't access to normal camera in back - Stack Overflow

programmeradmin1浏览0评论

i am trying to use 'normal' camera on my iphone 11 pro. I use react-native-vision-camera. When i run this code:

  const devices = useCameraDevices();
  const deviceBack = devices.back;
  console.log(deviceBack?.devices)

I get only 2 cameras : ["ultra-wide-angle-camera", "wide-angle-camera"], I don't want a wide camera, I want to access to my normal camera, how to do it ?
Thanks.

i am trying to use 'normal' camera on my iphone 11 pro. I use react-native-vision-camera. When i run this code:

  const devices = useCameraDevices();
  const deviceBack = devices.back;
  console.log(deviceBack?.devices)

I get only 2 cameras : ["ultra-wide-angle-camera", "wide-angle-camera"], I don't want a wide camera, I want to access to my normal camera, how to do it ?
Thanks.

Share Improve this question asked Feb 27, 2022 at 18:58 KAYZORKKAYZORK 4032 gold badges6 silver badges18 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 7 +50

tl;dr - Single-lens smartphone cameras monly have a wide-angle lens of roughly 22mm and 30mm equivalent. So basically, you would want to choose wide-angle, as this is the "normal" type.


based on the react-native documentation, there are three Identifiers for a physical camera (one that exists on the back/front of the device):

"ultra-wide-angle-camera" | "wide-angle-camera" | "telephoto-camera"


"ultra-wide-angle-camera": A built-in camera with a shorter focal length than that of a wide-angle camera. (focal length between below 24mm)

"wide-angle-camera": A built-in wide-angle camera. (focal length between 24mm and 35mm)

"telephoto-camera": A built-in camera device with a longer focal length than a wide-angle camera. (focal length between above 85mm)


now that we have that settled, let's take a look at cameras' focal lengths that are equivalent to phone cameras' focal length (resource)

Camera type Focal length Angle-of-view
Wide-angle 22mm to 30mm ~84° to ~62°
Telephoto 50mm to 80mm ~40° to ~25°
Ultrawide-angle 12mm to 18mm ~112° to ~90°
Periscope 103mm to 125mm ~20° to ~16°

what is considered a "normal" focal length is 35mm, so you should choose wide-angle since it is the closest (and eventually with the angle of view the user might be even closer to 35mm), further more the wide-angle is the most mon focal-length for phone camera lens

发布评论

评论列表(0)

  1. 暂无评论