Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create virtual webcam in 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.

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)

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?

like image 201
Lukáš Neoproud Avatar asked Nov 13 '15 12:11

Lukáš Neoproud


People also ask

Does Windows 10 have webcam software?

Windows 10 has an app called Camera that lets you use your webcam to record videos and take photos. It's definitely better than having to download spyware/malware-ridden third-party webcam recording software. In this article, I'll walk you through the process of using the app and adjusting the various settings.

What is a virtual camera on Windows?

e2eSoft VCam is a Webcam Emulator, which emulates a webcam in your system and works like a real one. It can be used in most of the applications which use webcam, such as IM software, video broadcasting, video conferencing, video teaching, remote education, video chatting etc.


1 Answers

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.

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

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 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:

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

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

  • Getting DirectShow Samples on Windows 8

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.

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.

like image 172
Roman R. Avatar answered Oct 04 '22 22:10

Roman R.