Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results


Before Posting...

Please check out the Community Guidelines in the Announcements and Administration Category.

More Info on Driver Writing and Debugging

The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.

Check out The OSR Learning Library at:

Internal Buffering within the standard usb webcam driver

uvcgquestionsuvcgquestions Member Posts: 6
I am having trouble reading an ~85 FPS USB webcam Windows, on average I am measuring 85 Hz but its being read in bursts so it looks like there's buffering within the Windows standard uvc

I have a python script like below to capture images

import cv2 as cv
import sys
from datetime import datetime

previous_time =

n = int(sys.argv[1])
cam = cv.VideoCapture(n)
while 1:
ret,frame =
now =
td = (now-previous_time).microseconds
previous_time = now
print("Frame delta, {} ms".format(td/1000))

When looking at the printed output, the time delta between frames is either 30 ms or near 0ms.

Frame delta, 30.877 ms
Frame delta, 0.0 ms
Frame delta, 0.999 ms
Frame delta, 30.525 ms
Frame delta, 0.0 ms
Frame delta, 0.997 ms
Frame delta, 29.956 ms

I have tested the same webcam on Linux with the same script and the frame delta is a lot more consistent (close to 12 ms with +- 5ms deviation) which is what I am expecting. I have tried the Microsoft Media foundation backend with OpenCV and also the direct show backend, both have the same behavior. I have even tried write a C++ version of the script using the Microsoft Media Foundation API and it has the same issue.

Writing a new Windows driver would be a last resort but I'm running out of options, any advice would be greatly appreciated.


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. Sign in or register to get started.

Upcoming OSR Seminars
OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead!
Kernel Debugging 13-17 May 2024 Live, Online
Developing Minifilters 1-5 Apr 2024 Live, Online
Internals & Software Drivers 11-15 Mar 2024 Live, Online
Writing WDF Drivers 20-24 May 2024 Live, Online