Hello
I created a directshow filter to create a virtual webcam device. It works with most software (VLC, Virtools, GraphEdit). But when I try to use it in Unity with WebcamTexture, it doesn’t works.
-
The device is present in the array provided by WebcamTexture.devices
-
Creation of the WebcamTexture works. (For information, if I tried to create a WebcamTexture with an invalid device name, I would get this error :
Cannot find webcam device BadName.
) -
When I try to use
myWebCamTexture.Play()
, I get this error :ERROR - Could not find specified video device
So, Unity sees my device (it appears in WebcamTexture.devices) but seems unable to use it. Why?
The very same scipt works perfectly with real webcams, and with other virtual cams (ex : e2esoft VCam).
I know this is a very specific question, but does anyone knows how does Unity handle webcam? (in particular, what in the difference with how other softwares handle it).
Edit :
My directshow filter implement these interfaces
- IAMStreamConfig
- IBaseFilter
- IKsPropertySet
- IMediaFilter
- IPersist
- ISpecifyPropertyPages
While another directshow filter (e2esoft vcam) that works within Unity implement these ones :
- IAMFilterMiscFlags
- IAMVideoControl
- IAMVideoProcAmp
- IBaseFilter
- IKSPropertySet
- IMediaFilter
- IMediaSeeking
- IPersist
- IPersistStream
- ISpecifyPropertyPages
In bold are the interfaces that are missing in my filter. Are these all required to be used as webcam by Unity? Or do I only need to implement a specific one?