设备驱动程序充当虚拟网络摄像头 [英] Device driver to act as a virtual web camera

查看:90
本文介绍了设备驱动程序充当虚拟网络摄像头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在寻找编写虚拟相机驱动程序.有人有主意吗?
任何有帮助的书或任何链接.


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

添加更多详细信息: 我已经开发了一种将图像保存到磁盘的设备驱动程序,并且显示器使用该设备驱动程序来显示图像.性能似乎不佳. FNS.我使用的是: //捕获 GetDesktopWindow() CreateCompatibleBitmap() 救() //显示 WM_MOUSEMOVE 每次都调用以捕获和显示 但是显示不是连续的,只有在窗口失焦并再次聚焦后才会显示

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.

谢谢, -mitesh

Thanks, -mitesh

推荐答案

虚拟摄像机驱动程序是什么意思?

What do you mean by virtual camera driver?

可以使用DirectShow编写虚拟捕获设备.这样的虚拟捕获设备便可以供Skype等应用程序使用.如果满足您的需求,则可以从 http在捕获源过滤器"链接下的://tmhare.mvps.org/downloads.htm .

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.

为了在我发布的链接中使用该捕获设备,您需要下载Windows SDK. Windows SDK有一个名为"GraphEdit"的工具.如果您在线搜索,我相信您可以找到快速的GraphEdit教程.基本上,GraphEdit允许您通过连接一堆过滤器来构建多媒体管道. (例如,当您在计算机上播放电影时,这就是在后台发生的事情.)这可能类似于

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

网络摄像头->渲染器

文件源->一些解码器->渲染器

file source -> some decoder -> renderer

,将导致您看到网络摄像头捕获的视频或文件内容.示例下载显示了如何构建虚拟捕获设备,即看起来媒体是来自真实"捕获设备的,但是实际上,如果您将代码调整为适合自己的特定方式(例如抓屏并抓取),则可以生成所需的任何视频.输出.如果注册正确,Skype之类的应用程序就可以接您的虚拟捕获设备.

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.

找出这是否满足您需求的最简单方法是下载捕获源过滤器,使用regsvr32命令注册它,然后使用GraphEdit将捕获源插入图形中,将源连接到图形视频渲染器,然后点击播放按钮.上面提到的许多概念/关键字在您看来似乎很陌生,但是您可以对每个主题进行一些阅读,也许这将为您提供入门的基础.

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.

捕获源过滤器方法是否不足以满足您的要求? 1)AFAIR,您在(现在已删除)答案中指出要进行屏幕抓取,并将其用作在Skype等应用程序中使用的虚拟摄像头设备.

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.

如果这是您所需要的,那么您不必编写设备驱动程序. DirectShow可以通过捕获源过滤器完美地做到这一点.然后,您需要

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

  • 学习一些基本的DirectShow
  • 修改捕获过滤器的源代码以进行屏幕抓取等.

就书籍而言,编写设备驱动程序以实现相同目的,我不知道.我要说的是,您需要确定您是否确实需要编写设备驱动程序,或者简单地修改开放源代码捕获过滤器是否足够.

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.

这篇关于设备驱动程序充当虚拟网络摄像头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆