VideoTexture playing 10x too fast at random (Android Chrome, Edge, Windows Chrome)

This one is tough to cause on purpose. I have no idea when it happens or why but sometimes (pretty often) my VideoTexture will just speed through the video 10x faster than it should. It happens randomly, sometimes right in the beginning, sometimes it starts after its been playing for a moment. The video file has no sound, and is just video stream.

Interestingly this behavior has not occurred for me on iOS while I was testing with iPad.
I’ll follow up with a screen recording.

A page I built for a friend’s cub-scout pack has this problem: https://cubs.gl.ax/
The page is setup pretty much like the playground, so its a good simple reproduction of the bug.

I am wondering if it could be because the rendering is too slow and if kind of tries to get back to where it should be compared to time if anything else was slowing the video to play when it starts ?

I can not repro unfortunately locally so pretty much guessing only at this point.

It’s obnoxious because it happens so intermittently. I finally got it.

It doesn’t always do it like this either… This one was especially weird, it was frozen on a frame in the middle an then blasted to the end.

Sometimes it does this right from the beginning… Sometimes it will be playing at a normal pace and then do it.

w0000t this is so strange !!! I can not think of anything to cause this :expressionless:

This was shared mainly to be used with people’s mobile devices, and it seems like a coin flip if it will work for them or speed to the end. It is such a strange bug because of the inconsistency … I’m not even sure where to breakpoint or hook in order to debug it but I’ll keep digging when I have time.

Did you try to use some other video?

From my understanding the video itself has hardware accelerated decoding by browser and is blit onto a canvas using drawImage then the canvas pixel buffer is read through getImageData call and finally I’m guessing it is stored in texture via texImage2D call.

I haven’t yet had time to actually debug this but that’s the only way I know how to get a texture of a video. I have no issues playing this video normally on a page, nor does three.js have a problem playing the same video as a texture.

But to answer your question, no I haven’t tried any others to compare yet. Could you explain your line of thinking? I can’t imagine it’s specific to the video but maybe you are right. When I’m finally out of a dev crunch it should free me up and I’ll hook babylon all over the place and see if I can figure out where this timing anomaly is starting.