Ask Your Question

OpenCV JS Video Capture is very slow on external webcam

asked 2020-11-12 22:29:29 -0500

updated 2020-11-13 01:35:24 -0500

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 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.

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...

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2020-11-14 07:57:30 -0500

berak gravatar image

there is nothing you can do from the opencv / js side.

try to install a better driver for the resp. webcam

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2020-11-12 22:29:29 -0500

Seen: 475 times

Last updated: Nov 14 '20