Code Monkey home page Code Monkey logo

virtualcameradriver's Introduction

VirtualCameraDriver

Windows virtual camera driver using the AVStream minidriver.

This project was a challenge for myself. I wanted to create a virtual camera driver for Windows.

The project has two parts: the Windows driver and the user mode apps which can push frames to the driver.

Driver

The driver is based on the avshws driver example from Microsoft.

The filter implemented in this driver is extended with a custom property which accepts a buffer (1280x720, RGB), this buffer is then copied to the output buffer.

  • GUID of the property set: {CB043957-7B35-456E-9B61-5513930F4D8E}
  • ID of the property: 0

Accessing this property can be done using DirectShow.

Driver installation:

After building the driver (Windows SDK and Windows Driver Kit required) the inf can be installed using hdwwiz.exe (can be launched in CMD).

Test signing might be required to be enabled for driver installation: bcdedit.exe -set TESTSIGNING ON

UserMode apps

These applications can push frames to the driver using the property exposed in the filter. The apps are based on the driver interface library which handles enumerating devices and setting the value of the property. This is written in VC++.

There are two example applications:

  • UserDriverStaticImage: This app can push static images to the driver.
  • UserDriverCanon: This application can push the live view of a Canon EOS camera to the driver, essentially turning it into a webcam. EDSDK not included in this repository!

virtualcameradriver's People

Contributors

robot9706 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

virtualcameradriver's Issues

bcdedit.exe -set TESTSIGNING ON

bcdedit.exe -set TESTSIGNING ON

When executing this command, either in the "RUN" of windows 10 or in the command console, it throws me the following error:

Failed to set item data.
The value is protected by the secure boot policy and cannot be modified or deleted.

what can i do?

Thumbnail not available or black thumbnail seen

Selecting driver as default camera on Teams or Zoom does not show the content preview. FYI: I am sending a video to the driver although the remote person can see the output coming from the driver but I cannot see it. if you have used teams it appears on right side corner @bottom. How can we fix it?

Compile error. No file digest algorithm specified.

No file digest algorithm specified. Please specify the digest algorithm with the /fd flag. Using /fd SHA256 is recommended and more secure than SHA1. Calling signtool with /fd sha1 is equivalent to the previous behavior. In order to select the hash algorithm used in the signing certificate's signature, use the /fd certHash option. avshws E:\Workspace\C++\Driver\VirtualCameraDriver-master\Driver\avshws\SIGNTASK

UserLand program Static Image doesn't work.

I've already fix this problem.And I'm here to tell my solution to those who met problem the same as me.
The original problem can be seen at the comment.

The symptom caused by the error is that the user-mode program has no display.In other words, it means that clicking the .exe program results in no visible action.

The fundamental reason for causing this phenomenon is a problem with the initialization of the program.
And in the program,the initialization can devide into 2 parts.
One is the initialization of the user interface (UI), including the creation of controls, etc. (I haven't learned C# programming, I'm just interpreting based on my previous experience with using Qt,but I guess it's the same as qt).
And another is,in this program,the loading of DLL that provide an interface to access the device.I believe it is the main reason.

In short.when you meet something wrong with loading DriverInterface.dll,you can consider my solution.

The steps I followed to successfully run the entire program are as follows.

  1. You need to change all of the platform to the same.In my case, I set DriverInterface.dll,UserLand program Platform to x64.

  2. Build the Driver project(VirtualCameraDriver-master\Driver\avshws).You need VS and WDK(or maybe windows SDK).There are lots of guidance if you google how to install VS and WDK.When compiling, you may meet some errors.I think most of common error is about warning and signing.When you meet "warnings regard as errors",just google error info,and you will find solution(just edit propertied not to regard as errors).And you need to change signing see here ( #9 ).

  3. Generate DriverInterface.dll.In UserLand project(VirtualCameraDriver-master\UserLand),you need to generate DLL first.And you need to choose platform.In my case, it's x64.

  4. copy the dll you generate to the output folder of UserLand program.In my case, it's "VirtualCameraDriver-master\UserLand\UserDriverStaticImage\bin\Release".

  5. Build UserLand program you want.Then run the exe, and you can use it.

Does it support Media Foundation?

Sorry for disturb you again.I'm going to ask another question: does it support media foundation?
I think the answer is yes,right?
Though I haven't done enough tests.I've just used chrome to capture cam.Have you done other tests?

Thanks.

Questions SetData & KeSetTimer

Hello There,
I am trying to debug the driver need few things clarified:

  1. HRESULT hr = propertySet->Set(GUID_PROP_CLASS, PROP_DATA_ID, NULL, 0, dataPointer, dataLength);
    What API does this hit in the hwsim.cpp? it is not hitting any of my breakpoints :(
    What should I do so that it hits the break points in avshws.solution

  2. Is Driver continuously scanning for the data?
    Any explaination is helpful. Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.