Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Camera stream freezes once the clmtrackr detects a face (MacOs Mojave, Safari) #163

Open
DavidEdi-6over6 opened this issue Nov 19, 2018 · 9 comments

Comments

@DavidEdi-6over6
Copy link

DavidEdi-6over6 commented Nov 19, 2018

The tracker causes the camera stream to freeze on the latest Mac OS version, with the latest Safari.
First I saw it on my project which uses clmtrackr and then I tested it with this demo:
https://www.auduno.com/clmtrackr/examples/clm_video.html

Mac OS version: Mojave 10.14.1
Safari version: 12.0.1
No errors in the console, the tracker works but very slow.

I tested my project and the demo on previous Mac OS versions and no problems there...
Works good as well on: Chrome for Mac Mojave and Safari on IOS 12.

I saw already an open ticket 1 month ago that may be related to the same issue but as the ticket was lack of information I decided to create a separated one (#159)

So probably this is a bug in the latest Safari version but the question is if there is something that we can do from our side?

@fthues
Copy link

fthues commented Nov 21, 2018

We're seeing the same behavior as well.

@auduno
Copy link
Owner

auduno commented Nov 21, 2018

I can confirm this issue, I'll try to investigate the cause.

@auduno
Copy link
Owner

auduno commented Nov 21, 2018

It looks like the issue might be related to clmtrackr triggering too many updates per second. I've added a parameter in the dev-branch to limit the amount of iterations per animation frame, that seems to help.

Could you verify if the latest build in the dev-branch resolves the issue?

@DavidEdi-6over6
Copy link
Author

@auduno Thanks for the quick response! Your last change made it a bit faster but it still very laggy.
I played with the maxIterationsPerAnimFrame parameter and I tried to change the value and the results are:
maxIterationsPerAnimFrame=2 , less laggy but still noticeable
maxIterationsPerAnimFrame=1, work fluently

@auduno
Copy link
Owner

auduno commented Nov 22, 2018

Hmm, it's a bit of a bummer to have to limit updates to 60 fps (which setting maxIterationsPerAnimFrame to 1 effectively does). I've been trying to figure out what changes in Mojave and/or Safari could cause the issue, but I haven't found anything obvious. Does anyone know exactly which Safari version introduced the issue?

@DavidEdi-6over6
Copy link
Author

DavidEdi-6over6 commented Nov 25, 2018

I saw it once I upgraded my Mac, 12.0.1 is the only version I got once my OS was upgraded..

@laurent-kouassi
Copy link

Hi, @DavidEdi-6over6 please could help me find at which line are you changing the maxIterationsPerAnimFrame to 1

Can you please share it with me?
Many Thanks,

@DavidEdi-6over6
Copy link
Author

Hi, @DavidEdi-6over6 please could help me find at which line are you changing the maxIterationsPerAnimFrame to 1

Can you please share it with me?
Many Thanks,

clm.js line 48
params.maxIterationsPerAnimFrame = 1

But see auduno's response, this is not recommend

@laurent-kouassi
Copy link

laurent-kouassi commented Mar 2, 2019

Thank you @DavidEdi-6over6
I still can't get the current position.
It's always false.

Do you have any hint on how to fix this issue?

Is it related to Canvas Size Video Size

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants