How to introduce a Custom Media Source as Video capture device like DirectShow filter?

Dear experts,

MSDN has document about writing Custom Media Source for Media foundation.
But I want other third-party app see my Custom Media Source as a Video capture device.
I know DirectShow can do that with its filters.
How can I do that with Media foundation?

I’ve just found out that there is no exist approach to create virtual camera on Windows 10 using Media foundation.
We must implement that driver in kernel driver.

However, there is a new API on Media Foundation. It is MFCreateVirtualCamera but it is seem for Windows 11.

So far, I have not found anything Media Foundation can do that DirectShow can’t. The mechanism for creating a fake video camera in DShow is well-understood. Why not just do it in DShow?

Clearly, it is possible to write a Media Source or Source Reader object to produce a camera-like video stream, and the magic to get a filter recognized as a video camera is mostly registry entries, so it’s probably possible.

Just because Microsoft said that Directshow is obsolete and MF support more kinds of video format.
I am in investigate stage to decide which one Directshow or MF will be used in my project.
Thank you very much for your advice.

Just because Microsoft said that Directshow is obsolete…

No, Microsoft said that DirectShow is “deprecated”, which is a word that has virtually no meaning. It’s still alive and vibrant. Video For Windows and the waveIn and waveOut APIs have been deprecated for decades. They still work exactly like they did in 1994.

MF support more kinds of video format.

I have heard that said before. I’ve never found an example.

Now, let’s be honest, I’m just being obstinate. I fully understand that some companies do not want to fund efforts on a technology that is not the latest, shiny model with finely polished chrome. I happen to be a huge fan of DirectShow (designed in 1994 and still alive and functional in 2021).

This post from 2016 (https://alax.info/blog/1626) says that it’s not possible to build a virtual camera in MF. Apparently, the registry magic that works for DShow doesn’t work with MF.

1 Like

I’ve learned a lot from your feedback.
I’ve chosen Directshow for my project without any doubts. Thank you so much.