capacitor-community / camera-preview

Capacitor plugin that allows camera interaction from HTML code
MIT License
188 stars 158 forks source link

open camera is slow #267

Open scr2em opened 1 year ago

scr2em commented 1 year ago

Describe the bug in my angular ionic app calling start takes 1.6s in iPhone 11 and 2.2s in iPhone 13 and 4s in iPhone 14

 await CameraPreview.start();

Expected behavior I expect it to load faster in newer versions of iphone not the other way.

Smartphone (please complete the following information):

jkennedy1980 commented 1 year ago

This 4 seconds is hurting me. I'm having to work around it with crafty UX. Does anyone know why it's so slow?

scr2em commented 1 year ago

@jkennedy1980 I haven't figure it out yet. @riderx can you help with this ?

farestayari commented 4 months ago

i have the same problem, does anyone has a solution for this ?

jkennedy1980 commented 4 months ago

To be honest, I don't know. I ended up creating a private fork because I needed to do some frame-by-frame ML processing. My private fork is faster. I do see this public fork from around that time with a few small changes: https://github.com/general-galactic/camera-preview-ml

Maybe pull this fork and see if the problem is fixed. I think I intended on pushing back to the main repo and forgot. I'm just not sure if this fork has the right fix.

akships commented 3 months ago

This issue is still there, it takes 3-7s to display camera on iOS 16+ :/ Any news ?

Update : slow down appear specially when strict mode is enabled on react (on dev). I guess because the component is rendered twice, authorizations and concurrent processes mess up some stuff which take a long time.

scr2em commented 3 months ago

@akships I'm using it with angular, and it's still slow