How do I modify the stream from a USB camera via a kernel level filter driver (or is there a better way)

kyasui 1 Reputation point
2020-08-29T13:13:53.48+00:00

I'm looking to write a filter driver that can modify the video stream from USB camera class devices, for instance putting a watermark on it, and seeing it modified on any other application like skype or camera app.

However I've been reading the documentation available online, and I'm not finding what i need. For instance I see how theres kernel streaming in DirectShow's "How Hardware Devices Participate in the Filter Graph" but this isn't expanded on. I've learned how to write a kernel level filter driver like Chew Esmero's "ccfltr" but this simply copies the data to a shared memory available to userland.

Could someone kindly point me in the right direction to achieve this? Thank you very much.

In terms of development environment, I have a target device and kernel debugging setup via WinDbg, using Visual studio 2019, Windows 10 SDK (10.0.19041.0) and corresponding WDK.

Windows for IoT
Windows for IoT
A family of Microsoft operating systems designed for use in Internet of Things (IoT) devices.
397 questions
Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,613 questions
{count} votes

1 answer

Sort by: Most helpful
  1. MichaelXu-MSFT 1 Reputation point
    2020-08-31T08:07:02.323+00:00

    In this scenario, you need to customize the USB camera driver and replace the built-in driver. You may refer to this graphics driver samples.
    Adding watermark to video stream need you analysis the video frame and mix the watermark to the frame, generally, you need to use a third party for that. It is not easy to do that. We recommend you to add the watermark in application. There are many libraries can do that.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.