My project uses VideoTexture to stream from WebRTC and the local webcam into a babylon scene. I’ve had some reports of it crashing in Firefox after using huge amounts of memory.
Open the Activity Monitor on your OS and look at memory usage for firefox
In my experience, the memory usage starts around 600mb and then climbs continuously until the process crashes (on my M1 Pro Mac I got up to 60GB memory usage for firefox with some heavy swapping)
In my tests, it only seems to be an issue when using WebRTC streams or direct getUserMedia sources, not when streaming from a video element with src.
I suspect this is an issue with Firefox and WebRTC rather than Babylon JS specifically, however it would be awesome if we could find a workaround or a simple reproduce case for a Firefox bug report.
Awesome thanks @sebavan for the pointer! I just tested this out with the local source, and sure enough changing to this._gl.RGB instead of this._gl.RGBA on that line stops the leak!
Is this something we can potentially get into the main version? Is there a situation when you want the alpha channel on a video texture?