I was getting a constant 60 FPS on my project until I added a
VideoTexture. Now I noticed that the framerate dropped down to 30FPS until I disable the visibility of that mesh with
mesh.visible=false and then the framerate jumps back to 60.
I started investigating with the examples section, and noticed that several
VideoTexture examples have low framerate:
For some reason, the Kinect demo does get 60 FPS! The only difference I noticed in that demo is that it uses
texture.minFilter = THREE.NearestFilter; but that didn’t have an effect when I changed it. I thought video dimensions would have an effect, but sintel.mp4 is 480x204 while kinect.mp4 is 474x490, so the larger video is getting better framerate.
Does anybody know what could be going on here? Why is the framerate affected so drastically, and is there anything that could be done about this?
I’ve solved issues with video textures before by re-encoding them with ffmpeg. In particular, try setting
-g 1 which sets the keyframe interval to 1. I found this was required when manually seeking frames (for an app with a custom framerate) otherwise there was serious jank and skipped frames.
I haven’t noticed low framerate though. How are you measuring the framerate on those examples? And what browser are you using?
I typically just look at the
Stats.js in the corner of the demos, but for some reason the video examples don’t have it, so I’m using spector.js plugin to track the framerate.
Funny you mention the browser, I just noticed I’m getting the low framerate issue in Firefox on Windows 10, but not on Chrome.
Just tested and I’m also getting the low frame rate on all except the Kinect examples, same as you. Might be worth opening an issue on GitHub to track this.
If this is a Firefox only issue, it’s better to directly report the problem at: https://bugzilla.mozilla.org/
Spector.js shows 60 FPS with all video texture examples on my iMac.
Yeah, I can confirm that the low framerate is only happening on Firefox, both MacOS and Windows. Chrome runs at 60 on both operating systems. I’ll file a bug later today.
Phew. I was wondering what I’d done to mess up my project. I similarly only get a low framerate when using Firefox.
Hi @marquizzo were you able to figure out what’s up with Firefox?
I’m having the same issue of FPS drop by adding only 1 VideoTexture without even playing the video.
Sadly no. I was never able to get to the bottom of this issue on Firefox. I got lucky and the video needed to be full-screen, so the low frame rate wasn’t noticeable and I moved on.
Now that you remind me, I should still report that bug in Bugzilla.
I’ll report to mozilla soon as well, so we are more reporting this bug.