如何在Windows 10中创建虚拟网络摄像头? [英] How to create virtual webcam in Windows 10?

查看:1997
本文介绍了如何在Windows 10中创建虚拟网络摄像头?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从网络摄像头中获取视频,在框架上渲染一些文本,并进行一些运动跟踪,然后将其传递给虚拟网络摄像头,以便可以轻松地对其进行流式传输。

I would like to take video from a webcam, render some text on the frames and do some motion tracking and pass it on to a virtual webcam so it can be streamed easily.

我在stackoverflow上找到了一些答案,建议我应该使用DirectShow。根据 DirectShow文档,DirectShow SDK是Windows SDK的一部分。因此,我安装了最新的Windows SDK ,但似乎没有不包含DirectShow,因为在 C:\Program Files(x86)\Microsoft SDKs\Windows 下没有DirectShow示例。 (stackoverflow的答案也很老-大约在2010年)

I found some answers on stackoverflow suggesting that I should use DirectShow. According to information in DirectShow documentation, the DirectShow SDK is part of Windows SDK. So I installed the latest Windows SDK but it seems that it doesn't include DirectShow because there are no DirectShow samples under C:\Program Files (x86)\Microsoft SDKs\Windows. (The stackoverflow answers are also pretty old - dated around 2010)

您能提出一种使DirectShow正常工作的方法(包括在Visual Studio 2015上运行的示例)的方法吗?到DirectShow,这将有助于我创建虚拟网络摄像头?

Can you suggest a way to make DirectShow work (including samples working on Visual Studio 2015) or some other alternative to DirectShow, that would help me create a virtual webcam?

推荐答案

虚拟网络摄像头通常是应用程序发现的唯一软件实现,就像它是具有物理表示的设备。上面提到的应用程序使用API​​来与网络摄像机配合使用,并且能够扩展API并添加自己的视频源是创建虚拟网络摄像机的方法。

Virtual webcam is typically a software only implementation that application discover as if it is a device with physical representation. The mentioned applications use APIs to work with web cameras and ability to extend the APIs and add your own video source is the way to create a virtual web camera.

在Windows中,以下是一些使用视频资源的API:Windows视频,DirectShow,Media Foundation(按时间顺序)。

In Windows there are a few APIs to consume video sources: Video for Windows, DirectShow, Media Foundation (in chronological order).

Windows视频并不是真正可扩展的,并且整体功能受到限制。如果为虚拟摄像机提供了内核模式驱动程序,它将看到一个虚拟设备。

Video for Windows is not really extensible and limited in capabilities overall. It will see a virtual device if you provide a kernel mode driver for a virtual camera.

DirectShow是大多数启用了视频捕获功能的Windows应用程序使用的API,它存在于所有Windows版本,包括Windows 10(仅Windows RT)。然后,它可以完美地扩展,并且在大多数情况下,术语虚拟网络摄像头是指DirectShow虚拟网络摄像头。对于许多使用DirectShow实施视频捕获的应用程序,在许多StackOverflow问题中讨论的创建DirectShow虚拟网络摄像头的方法对于Windows 10仍然完全有效:

DirectShow is the API used by most video capture enabled Windows applications and it is present in all Windows versions including Windows 10 (except just Windows RT). Then it's perfectly extensible and in most cases the term "virtual webcam" refers to DirectShow virtual webcam. Methods to create DirectShow virtual webcam discussed in many StackOverflow questions remain perfectly valid for Windows 10, for applications that implement video capture using DirectShow:


  • < a href = https://stackoverflow.com/questions/8557723/virtual-webcam-input-as-byte-stream>将虚拟摄像头输入作为字节流

  • 模拟DirectShow网络摄像头

  • Virtual webcam input as byte stream
  • Simulate a DirectShow Webcam

DirectShow示例已从Windows SDK中删除,但您仍可以在较早的版本中找到它们:

DirectShow samples were removed from Windows SDK but you can still find them in older releases:

  • Getting DirectShow Samples on Windows 8

如果您为摄像机设备(通过自定义内核驱动程序提供的虚拟网络摄像机)提供了内核模式驱动程序,则DirectShow也会像其他视频API一样看到它。

If you provide a kernel mode driver for video camera device (your virtual webcam through custom kernel driver), DirectShow would also see it just like other video APIs.

找到媒体该产品应该是DirectShow的继任者,但它在扩展性方面的视频捕获功能根本不存在。微软决定不允许自定义视频源应用程序能够发现与网络摄像机相同的方式。由于Media Foundation的复杂性,开销和总体上的不友好性,适量的应用程序会使用它。要再次为Media Foundation应用程序实现虚拟网络摄像头,就像在Windows Video中一样,您必须实现内核模式驱动程序。

Media Foundation is a supposed successor of DirectShow but its video capture capabilities in the part of extensibility simply do not exist. Microsoft decided to not allow custom video sources application would be able to discover the same way as web cameras. Due to Media Foundation complexity, and overhead and overall unfriendliness it is used by modest amount of applications. To implement a virtual webcam for Media Foundation application you again, like in case of Video for Windows, have to implement a kernel mode driver.

这篇关于如何在Windows 10中创建虚拟网络摄像头?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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