Virtual Camera - Capture Image frame from Opencv and pass to Directshow Filter for virtual Camera application

zulfiker shishir 1 Reputation point
2021-02-11T13:17:44.303+00:00

I am working on a virtual camera application . This virtual camera should be able to shown under the list of available camera device from application like Zoom . Now in my application there are two part . One part is Directshow capture source filter and other part is an c# application .

Now my idea is to capture video from the c# application, process those video frame with opencv and pass those video frame to directshow filter through some inter process communication .this video will be relayed in zoom in realtime .

I have tried and successfully installed popular vivek vcam thanks to this link https://github.com/roman380/tmhare.mvps.org-vcam . After registering this dll i can see this virtual camera under the avialble list under zoom . it currently only shows random data .

But i am new to diretshow and thus have some confusion. Here the question goes

  1. Inter process communication is the way to pass frame from application to directshow filter according to some stackoverflow answer . I am capturing video frame from webcam by opencv in c# application . vcam project has a fillbuffer() method from which data is populated . is it enough if i pass those frame to vcam filters fillbuffer() method directly ? or do i need to add samplegrabber and null render also . what would be flow here ?
  2. if i pass the frame how can convert from Opencv Mat type to directsow equivalent type ? what type should i consider ?

thanks for reading this question .

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,678 questions
{count} votes

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.