Which API to use for creating virtual webcam

Davit Sargsyan 41 Reputation points
2022-06-01T10:06:38.727+00:00

Dear all,

I want to create a virtual webcam so multiple applications can use the webcam simultaneously. According to stackoverflow answer here:

https://stackoverflow.com/questions/33693131/how-to-create-virtual-webcam-in-windows-10

DirectShow should be used, because Media Foundation (MF) lacks the functionality. But it seems the answer is outdated:

https://learn.microsoft.com/en-us/windows/win32/api/mfvirtualcamera/nf-mfvirtualcamera-mfcreatevirtualcamera

https://github.com/microsoft/Windows-Camera/tree/4825decdbfa8b9ee8ec9d214612874ede9cc2dc7/Samples/VirtualCamera

So my question is, can I use MF for my project? Will the virtual camera built with MF be visible to applications that consume video using DirectShow API? Because, as I understood, if I create my vcam with DirectShow API, applications built with MF will not see the virtual camera, which is not what I'd like.

Thanks and Best Regards,
Davit

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,749 questions
Windows Hardware Performance
Windows Hardware Performance
Windows: A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.Hardware Performance: Delivering / providing hardware or hardware systems or adjusting / adapting hardware or hardware systems.
1,678 questions
0 comments No comments
{count} votes

Accepted answer
  1. Jeanine Zhang-MSFT 11,181 Reputation points Microsoft External Staff
    2022-06-02T02:25:02.407+00:00

    Hi,

    Welcome to Microsoft Q&A!

    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.

    Media Foundation API offers nothing to help with functionality of virtual webcam.

    For more details, I suggest you could refer to the thread: https://stackoverflow.com/questions/65640023/project-and-build-structure-for-microsoft-directshow-based-virtual-webcam-applic

    Best Regards,

    Jeanine


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.