Live Example Here
I’m recording a video using getUserMedia and drawing that video onto a canvas for taking pictures at a specific FPS.
I decided that the FPS should depend on the screen size, since larger devices (like tablets and computers) typically have better processing power than something smaller like a phone.
fps = (screen.width > 500 || screen.height > 500) ? 38:24
The values were handpicked by myself.
I have a quad core 1.5Ghz Trio Stealth G4 and I still think that the canvas is “slow”. Not because of the FPS though–but because of the performance.
Can someone look at my code and tell me how to optimize it so that it isn’t so laggy? I don’t know how else I can optimize it, but if there’s something to make it faster I’d be glad to hear it.
I want to try to make the canvas as smooth as possible so it can stand up to a native camera app. Not that I plan to add much more to this app though. I just want better performance for what I’ve got.