Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
643 views
in Technique[技术] by (71.8m points)

directshow - Registering a network video stream as a virtual camera

So I've tried to tackle this problem for the last couple of weeks but come to a bit of a standstill. I'm trying to registering an RTSP stream from an IP address as a virtual webcam for use in another application (could be skype or similar). What I need is for my computer to add a virtual webcam to its device list. This should preferably be done through a C# script as devices could be added dynamically through a .NET program. I have found similar questions on StackOverflow, but many of these are outdated, use Linux, or receives another stream format/protocol.

My approach so far has been using DirectShow filters and so far that has worked to a degree. Using Graphedit I can see my incoming stream by using an RTSP source filter. However, there are some problems:

  • The source filter was a trial, the full version is paid and pretty expensive
  • I have no experience with DirectShow filter programming
  • I only showed the stream through GraphEdit, there was no virtual driver registered so e.g Skype couldn't use the stream

So I guess my question boils down to:

  • Is my approach with DirectShow the only way to acheive what I'd like?
  • Is a filter the correct approach to use if Windows should list the stream as a webcam device?
  • Is vcam still the best example to look at to implement something like this?
  • Does any one know of similar, open source programs that acheive what I describe?

Anyway, I appreciate any help I can get! Thanks.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The diagram below explains the applicability of virtual cameras:

enter image description here

You are trying to somehow mount a lower green or blue box so that it reads data from RTSP.

Note that more and more applications like new Skype are Media Foundation based (top right box on the diagram) and your filter based source is less and less applicable.

Creating a virtual camera which is recognized by various software assumes you are supplying a driver (red box). Even though such packages exist, I am not aware of any open source or even free which let you quickly start on this route.

DirectShow filter based sources (and you are yet to implement RTSP client there) will only be see by DirectShow based applications of the same bitness.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...