Ask Your Question

Revision history [back]

OpenCV JS Video Capture is very slow on external webcam

I am creating a sample web application using OpenCV js that captures video and displays only part of the frame on Canvas. When I first tested on laptop having inbuilt camera, the cropped video capture displayed well on Canvas, in vga mode (640X480). I got roughly 10 FPS. However, when I tested it on a desktop machine having external webcam (no inbuilt camera), I got around 3 FPS and naturally it did not feel like continuous streaming. I use canvas.drawImage to display cropped frame. I changed the code to capture video in qvga mode (320X240), then the performance improved and seemed reasonable.

I have seen code samples from huningxin's github and I dont think I am doing anything different in my code.

Does anyone know how to resolve this? Any help is appreciated...

OpenCV JS Video Capture is very slow on external webcam

I am creating a sample web application using OpenCV js that captures video and displays only part of the frame on Canvas. When I first tested on laptop having inbuilt camera, the cropped video capture displayed well on Canvas, in vga mode (640X480). I got roughly 10 FPS. However, when I tested it same code on a desktop machine having external webcam (no inbuilt camera), I got around 3 FPS and naturally it did not feel like continuous streaming. This is despite the fact that the desktop has better config than the laptop. I use canvas.drawImage to display cropped frame. I changed the code to capture video in qvga mode (320X240), then the performance improved and seemed reasonable.reasonable.

I have seen code samples from huningxin's github and I dont think I am doing anything different in my code.

Does anyone know how to resolve this? Any help is appreciated... appreciated...