Device driver to act as a virtual web camera
Asked Answered
K

1

7


I'm looking for writing virtual camera drivers. Does anybody has idea?
Any book that would be helpful or any link.

Adding more details: I have developed a device driver which saves the image to disk and the display uses the device driver to display the image. The performance does not seem good. The fns. that I have used are: //to capture GetDesktopWindow() CreateCompatibleBitmap() Save() //to display WM_MOUSEMOVE giving a call to capture and display every time but the display is not continuous and appears only after window goes out of focus and comes in focus again

Should I use some other technique to record or display images, what will give fruitful results, please help.

Thanks, -mitesh

Kief answered 22/2, 2011 at 14:7 Comment(0)
M
15

What do you mean by virtual camera driver?

It is possible to write a virtual capture device using DirectShow. Such a virtual capture device can then be used by applications such as skype, etc. If that suffices for your needs, you can download vcam from http://tmhare.mvps.org/downloads.htm under the "Capture Source Filter" link.

Edit: In order to use that capture device in the link I posted you need to download the Windows SDK. The Windows SDK has a tool called "GraphEdit" If you search online, I'm sure you can find a quick GraphEdit tutorial. Basically GraphEdit allows you to construct a multimedia pipeline by connecting a bunch of filters. (This is what happens in the background for instance when you play a movie on your computer. ) This could be something like

web cam -> renderer

or

file source -> some decoder -> renderer

and would result in you seeing the video captured by the web cam or the content of the file. The example download shows how you can construct a virtual capture device i.e. it looks like media is coming from a 'real' capture device, but actually you can generate any video you want if you adapt the code to your specific means i.e. take a screengrab and output that. Applications like skype can pick up you virtual capture device if it is registered correctly.

The easiest way to find out if this is sufficient for your needs is to download the capture source filter, register it with the regsvr32 command, and then to use GraphEdit to insert the capture source into a graph, connect the source to a video renderer and hit the play button. A lot of the above mentioned concepts/keywords might seem new to you, but you can do some reading on each topic, and perhaps this will give you a point to get started.

Edit 2: Is the capture source filter approach not sufficient for your requirements? 1) AFAIR you stated in your (now deleted) answer that you would like to take a screen grab, and use that as a virtual camera device for use in applications such as skype.

If that is all you require, you do NOT have to write a device driver. DirectShow can do that perfectly well by means of the capture source filter. You would then need to

  • learn some basic DirectShow
  • modify the source code of the capture filter to take screen grabs etc.

As far as books are concerned to write device driver to accomplish the same, I have no idea. The point I'm trying to make, is that you need to determine whether you actually need to write a device driver or whether simply modifying the open source capture filter is sufficient.

Myronmyrrh answered 22/2, 2011 at 14:17 Comment(5)
What I am willing to understand is what will be the function of the capture device and will it store the images or how would it feed them to any place.Kief
I have to write the code for a visual camera, which works as device driver and wanted some book or link to refer for the sameKief
As per the requirements of the project, I would need to write a device driver, which feeds images to the displaying software constantly. Please provide me with a best link or book to work on it, thanks in advance.Kief
I have modified the questions with more details, please help me with the details.Kief
@Ralf: Can i show the output of direct show filter to the browser or webrtc video conferencing room using any web programming languageHelping

© 2022 - 2024 — McMap. All rights reserved.