clmtrackr icon indicating copy to clipboard operation
clmtrackr copied to clipboard

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

Open DavidEdi-6over6 opened this issue 6 years ago • 9 comments

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 (https://github.com/auduno/clmtrackr/issues/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?

DavidEdi-6over6 avatar Nov 19 '18 17:11 DavidEdi-6over6

We're seeing the same behavior as well.

fthues avatar Nov 21 '18 15:11 fthues

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

auduno avatar Nov 21 '18 17:11 auduno

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?

auduno avatar Nov 21 '18 22:11 auduno

@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

DavidEdi-6over6 avatar Nov 22 '18 07:11 DavidEdi-6over6

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?

auduno avatar Nov 22 '18 21:11 auduno

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

DavidEdi-6over6 avatar Nov 25 '18 09:11 DavidEdi-6over6

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,

laurent-kouassi avatar Feb 26 '19 19:02 laurent-kouassi

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

DavidEdi-6over6 avatar Feb 28 '19 07:02 DavidEdi-6over6

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

laurent-kouassi avatar Mar 02 '19 07:03 laurent-kouassi