0

I want to make a virtual web cam application. so I find out all pages that had written before 2010. But there was no result. All the projects are old even I open and some parts of methods of codeproject's sources is doesn't useful now.

So I'm looking for a replacement of DirectShow. I tried following directshow guide even the getting started guide in docs.ms didn't work.

What should I do?...

Roman R.
  • 68,205
  • 6
  • 94
  • 158
Minwoo Yu
  • 360
  • 2
  • 13
  • What do you mean with virtual web cam application? Shall it display videos of web cams in the internet? Or stream into the internet? From a web cam? – Werner Henze May 11 '20 at 17:53
  • Um.. I mean a.. It is a webcam that display some image or video. But it does not exist real deviece. It is "virtual". – Minwoo Yu May 11 '20 at 17:55
  • Did you read https://learn.microsoft.com/en-us/windows/win32/medfound/whats-new-for-media-foundation? – Werner Henze May 11 '20 at 17:55
  • So i got a virtual webcam, then I will use it in opencv – Minwoo Yu May 11 '20 at 17:55
  • No i did not. I will read it right now thank u – Minwoo Yu May 11 '20 at 17:56
  • I still don't understand. Your program is software, it can't be a web cam. For me a web cam consists of a hardware cam, a software that gets the video from the cam and a web server that delivers the image or video. Which part do you want to replace? Every part? – Werner Henze May 11 '20 at 17:57
  • 1
    Yep. Um... In short, I make a streamming program which system think "I think it is webcam". So I can use it anywhere that needs a webcam such as "skype" or Opencv Develop – Minwoo Yu May 11 '20 at 17:59
  • 1
    https://youtu.be/tyqEFMLBldU Like this. I think it may help ur undetstand what i am saying. – Minwoo Yu May 11 '20 at 18:00
  • I think that depends on the programs that shall use your virtual cam - on the APIs that they use. The cleanest way might be a virtual camera device (driver) so that all other APIs just use that driver. But I don't know if you can do what you want to do in a driver. Also maybe a DirectShow Capture Source filter is the simpler solution. – Werner Henze May 11 '20 at 18:11
  • As i said that directshow samples too old and too unkind ... alright Thank you for the informations – Minwoo Yu May 11 '20 at 18:12

1 Answers1

4

So this is an AB question: you need one thing and instead you ask for another.

Yes, there is replacement for DirectShow. DirectShow is a previous multimedia API in Windows, and its successor API and current API in Windows is Media Foundation. This will however get you not an inch closer to the solution of your original problem.

The concept of virtual camera is abstract: Windows operating system does not offer a solid extensibility point to add virtual video input devices such that they are visible to application equally to real cameras. To achieve this you are basically supposed to develop and fully featured driver which is not what you want to do.

I covered details in multiple questions here on StackOverflow, I will just mention a few to start reading from:

If you want some application designed to work with cameras to "see" your virtual camera as if it was a real camera, you are interested in finding out what API the application is using and if you could submit your virtual implementation as another camera option.

If the application is DirectShow based, you are rather lucky and you can take the path of virtual DirectShow camera (see links above). If the application uses Media Foundation, you are pretty much in a dead end and hooking or API detouring is probably your best option.

Or you have an option to develop a camera driver, which is most likely is not realistic due to required effort (even though such implementations do exist).

Long story short if your target application is consuming cameras via DirectShow API, you are lucky enough and you don't need DirectShow replacement. Virtual camera code and knowledge accumulated over last 20 years is still in good standing.

Roman R.
  • 68,205
  • 6
  • 94
  • 158