yuccai Posted June 15, 2017 Share Posted June 15, 2017 Hi, I want to display my webcam content on my scene. In order to do this, I tried to create a layer set in background on which I apply a video texture. I passed a video DOM element to this texture. This video has a stream for source that is obtained from the getUserMedia promise. It works but rapidly the FPS drop and I don't know why. Maybe the size of the video is too large, maybe I provided the wrong parameters to the texture. I don't have any idea but it causes an issue. Here is a PG for testing : https://www.babylonjs-playground.com/#FF3BPV Thanks, Quote Link to comment Share on other sites More sharing options...
Gijs Posted June 15, 2017 Share Posted June 15, 2017 Have you tried different settings on your webcam? I see no problems with the camera that's built into my laptop. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 15, 2017 Share Posted June 15, 2017 Yes perhaps your camera generate a texture which is too big Quote Link to comment Share on other sites More sharing options...
yuccai Posted June 15, 2017 Author Share Posted June 15, 2017 What do you mean by trying different settings on my webcam ? I only have one webcam on my computer and I can't change its property. Maybe I can change the dimensions of the video before passing it to the videoTexture. I tried this and it increased a little bit my fps. My computer is 10yo. I tried this PG on other laptop and I didn't detect any FPS drop. I guess I can't do anything but I understood why, thanks Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 15, 2017 Share Posted June 15, 2017 You can configure the stream directly from bjs call. And guess what? I've got you covered https://www.babylonjs-playground.com/#FF3BPV#1 Quote Link to comment Share on other sites More sharing options...
yuccai Posted June 15, 2017 Author Share Posted June 15, 2017 Nice job ! The fact is that I wrote my piece of code a long time ago and I've never seen that you wrote this one in bjs. I will have a look on it ;). BTW I still undergo FPS drop after a random time. Sometime I don't and sometime it increases back. This must be due to my computer and it doesn't matter since I know it is specific to me. Thanks for your help, this topic can be closed. Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted June 15, 2017 Share Posted June 15, 2017 You close it yourself, by editing the first post, putting a '[SOVLED]' at front of topic. GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.