是否可以将视频流伪造为在 Skype、Lync 等中可见的虚拟摄像头?

发布于 2024-12-02 17:28:18 字数 7903 浏览 0 评论 0原文

我正在尝试为我的应用程序构建一个关键部分,其中我需要能够伪造虚拟摄像头视频流。我想要伪造为虚拟网络摄像头的视频流通过我的 PC 进行流式传输,我可以在其中设置来自网络摄像头或硬盘某个位置的视频源。总而言之,我可以在 WPF 中将其设置为 MediaElement.SourceProperty 或 Image.Source

我在 tmhare.com 上看到了 Vivek 的 Vcam,一个 directshow 过滤器,看起来好像是与我正在寻找的东西非常相关。但我找不到用VS2010编译它的方法,我也不知道该怎么办。我想我需要更改输入引脚,但是如何更改?

无论如何,总而言之,我正在尝试构建一个需要像 ManyCam 的小版本一样工作的部分代码。我正在构建一个 WPF 应用程序,在其中从 64 位 PC 流式传输源代码。

我也很感激过滤器的一些示例代码,因为我几乎忘记了我所知道的关于 C++ 的一切,因为 DirectShow 过滤器需要用 C++ 编写......

感谢一切!


编辑:

在此处输入图像描述

我遇到的错误;

1   IntelliSense: identifier "REFERENCE_TIME" is undefined  c:\program files (x86)\microsoft sdks\windows\v7.0a\include\dvdmedia.h  307 5 // and 6 more
6   IntelliSense: not a class or struct name    c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.h  8   22  Filters
7   IntelliSense: identifier "CUnknown" is undefined    c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.h  14  12  Filters
8   IntelliSense: identifier "IFilterGraph" is undefined    c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.h  17  5   Filters
9   IntelliSense: not a class or struct name    c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.h  23  28  Filters
10  IntelliSense: not a class or struct name    c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.h  23  50  Filters
11  IntelliSense: not a class or struct name    c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.h  23  74  Filters
12  IntelliSense: identifier "IBaseFilter" is undefined c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.h  37  25  Filters
13  IntelliSense: identifier "Quality" is undefined c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.h  37  48  Filters
14  IntelliSense: identifier "AM_MEDIA_TYPE" is undefined   c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.h  42  41  Filters // and 7 more
17  IntelliSense: identifier "IMediaSample" is undefined    c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.h  60  24  Filters
18  IntelliSense: identifier "IMemAllocator" is undefined   c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.h  61  30  Filters
19  IntelliSense: identifier "ALLOCATOR_PROPERTIES" is undefined    c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.h  61  57  Filters
20  IntelliSense: identifier "CMediaType" is undefined  c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.h  62  34  Filters
21  IntelliSense: identifier "CMediaType" is undefined  c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.h  63  41  Filters
22  IntelliSense: identifier "CMediaType" is undefined  c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.h  64  32  Filters 69  5   Filters
24  IntelliSense: identifier "CCritSec" is undefined    c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.h  71  5   Filters
25  IntelliSense: identifier "IReferenceClock" is undefined c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.h  72  5   Filters
26  IntelliSense: cannot open source file "streams.h"   c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.cpp    4   1   Filters
27  IntelliSense: identifier "CUnknown" is undefined    c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.cpp    13  1   Filters
28  IntelliSense: identifier "ASSERT" is undefined  c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.cpp    15  5   Filters
29  IntelliSense: identifier "CUnknown" is undefined    c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.cpp    16  5   Filters
30  IntelliSense: identifier "punk" is undefined    c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.cpp    16  15  Filters
31  IntelliSense: "CSource" is not a nonstatic data member or base class of class "CVCam"   c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.cpp    21  5   Filters
32  IntelliSense: identifier "NAME" is undefined    c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.cpp    21  13  Filters
33  IntelliSense: expected a ')'    c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.cpp    21  32  Filters
34  IntelliSense: identifier "ASSERT" is undefined  c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.cpp    23  5   Filters
35  IntelliSense: identifier "CAutoLock" is undefined   c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.cpp    24  5   Filters
36  IntelliSense: identifier "m_cStateLock" is undefined    c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.cpp    24  26  Filters
37  IntelliSense: identifier "m_paStreams" is undefined c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.cpp    26  5   Filters
38  IntelliSense: identifier "CSourceStream" is undefined   c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.cpp    26  20  Filters
39  IntelliSense: expected an expression    c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.cpp    26  36  Filters
40  IntelliSense: expected a ';'    c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.cpp    26  38  Filters
41  IntelliSense: identifier "IAMStreamConfig" is undefined c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.cpp    33  24  Filters
42  IntelliSense: identifier "IKsPropertySet" is undefined  c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.cpp    33  60  Filters
43  IntelliSense: identifier "m_paStreams" is undefined c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.cpp    34  16  Filters
44  IntelliSense: name followed by '::' must be a class or namespace name   c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.cpp    36  16  Filters
45  IntelliSense: identifier "IMediaSample" is undefined    c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.cpp    74  33  Filters
46  IntelliSense: identifier "IBaseFilter" is undefined c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.cpp    99  34  Filters
47  IntelliSense: identifier "Quality" is undefined c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.cpp    99  57  Filters
48  IntelliSense: identifier "CMediaType" is undefined  c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.cpp    107 41  Filters // and 3 more
51  IntelliSense: identifier "IMemAllocator" is undefined   c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.cpp    166 39  Filters
52  IntelliSense: identifier "ALLOCATOR_PROPERTIES" is undefined    c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.cpp    166 62  Filters

I'm trying to build a crucial part for my application in which I need to be able to fake a virtual cam video stream. The video stream that I want to fake as a virtual webcam is streamed through my PC, where I can set the video source from my webcam or somewhere from my hdd. To sum up, something I can set as MediaElement.SourceProperty or Image.Source in WPF.

I've seen Vivek's Vcam, a directshow filter here in tmhare.com which seems like it is extremely related to what I'm looking for. But I couldn't find a way to compile it with VS2010, I also don't really know what to do with it. I think I need to change the input pin but how?

Anyhow, to sum up, I'm trying to build a partial code that needs to work like a small version of ManyCam. I'm building a WPF application where I stream the source from a 64 bit PC.

I would also appreciate some sample code for the filter since I have nearly forgotten everything I ever knew about C++ since DirectShow filter needs to be written in C++...

Thanks for everything!


Edit:

enter image description here

errors i got;

1   IntelliSense: identifier "REFERENCE_TIME" is undefined  c:\program files (x86)\microsoft sdks\windows\v7.0a\include\dvdmedia.h  307 5 // and 6 more
6   IntelliSense: not a class or struct name    c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.h  8   22  Filters
7   IntelliSense: identifier "CUnknown" is undefined    c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.h  14  12  Filters
8   IntelliSense: identifier "IFilterGraph" is undefined    c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.h  17  5   Filters
9   IntelliSense: not a class or struct name    c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.h  23  28  Filters
10  IntelliSense: not a class or struct name    c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.h  23  50  Filters
11  IntelliSense: not a class or struct name    c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.h  23  74  Filters
12  IntelliSense: identifier "IBaseFilter" is undefined c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.h  37  25  Filters
13  IntelliSense: identifier "Quality" is undefined c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.h  37  48  Filters
14  IntelliSense: identifier "AM_MEDIA_TYPE" is undefined   c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.h  42  41  Filters // and 7 more
17  IntelliSense: identifier "IMediaSample" is undefined    c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.h  60  24  Filters
18  IntelliSense: identifier "IMemAllocator" is undefined   c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.h  61  30  Filters
19  IntelliSense: identifier "ALLOCATOR_PROPERTIES" is undefined    c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.h  61  57  Filters
20  IntelliSense: identifier "CMediaType" is undefined  c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.h  62  34  Filters
21  IntelliSense: identifier "CMediaType" is undefined  c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.h  63  41  Filters
22  IntelliSense: identifier "CMediaType" is undefined  c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.h  64  32  Filters 69  5   Filters
24  IntelliSense: identifier "CCritSec" is undefined    c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.h  71  5   Filters
25  IntelliSense: identifier "IReferenceClock" is undefined c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.h  72  5   Filters
26  IntelliSense: cannot open source file "streams.h"   c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.cpp    4   1   Filters
27  IntelliSense: identifier "CUnknown" is undefined    c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.cpp    13  1   Filters
28  IntelliSense: identifier "ASSERT" is undefined  c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.cpp    15  5   Filters
29  IntelliSense: identifier "CUnknown" is undefined    c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.cpp    16  5   Filters
30  IntelliSense: identifier "punk" is undefined    c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.cpp    16  15  Filters
31  IntelliSense: "CSource" is not a nonstatic data member or base class of class "CVCam"   c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.cpp    21  5   Filters
32  IntelliSense: identifier "NAME" is undefined    c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.cpp    21  13  Filters
33  IntelliSense: expected a ')'    c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.cpp    21  32  Filters
34  IntelliSense: identifier "ASSERT" is undefined  c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.cpp    23  5   Filters
35  IntelliSense: identifier "CAutoLock" is undefined   c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.cpp    24  5   Filters
36  IntelliSense: identifier "m_cStateLock" is undefined    c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.cpp    24  26  Filters
37  IntelliSense: identifier "m_paStreams" is undefined c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.cpp    26  5   Filters
38  IntelliSense: identifier "CSourceStream" is undefined   c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.cpp    26  20  Filters
39  IntelliSense: expected an expression    c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.cpp    26  36  Filters
40  IntelliSense: expected a ';'    c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.cpp    26  38  Filters
41  IntelliSense: identifier "IAMStreamConfig" is undefined c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.cpp    33  24  Filters
42  IntelliSense: identifier "IKsPropertySet" is undefined  c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.cpp    33  60  Filters
43  IntelliSense: identifier "m_paStreams" is undefined c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.cpp    34  16  Filters
44  IntelliSense: name followed by '::' must be a class or namespace name   c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.cpp    36  16  Filters
45  IntelliSense: identifier "IMediaSample" is undefined    c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.cpp    74  33  Filters
46  IntelliSense: identifier "IBaseFilter" is undefined c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.cpp    99  34  Filters
47  IntelliSense: identifier "Quality" is undefined c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.cpp    99  57  Filters
48  IntelliSense: identifier "CMediaType" is undefined  c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.cpp    107 41  Filters // and 3 more
51  IntelliSense: identifier "IMemAllocator" is undefined   c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.cpp    166 39  Filters
52  IntelliSense: identifier "ALLOCATOR_PROPERTIES" is undefined    c:\users\umutto\desktop\projects\src\directshowwizardinstaller\vcam\vcam\filters\filters.cpp    166 62  Filters

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

吾性傲以野 2024-12-09 17:28:18

为了使用 directshow 过滤器,您需要安装 Windows SDK 并编译 BaseClasses 解决方案。
查看: C:\Program Files\Microsoft SDKs\Windows\v7.0\Samples\multimedia\directshow\baseclasses

然后,您需要将 BaseClasses 头文件和 libs 目录添加到项目属性中。

现在您的项目将了解 DirectShow 类,并且您可以开始更改 VCam 源过滤器引脚。

In order to work with directshow filters, you need to have the Windows SDK installed and comiple the BaseClasses solution.
look at: C:\Program Files\Microsoft SDKs\Windows\v7.0\Samples\multimedia\directshow\baseclasses

Afterward you need to add the BaseClasses header files and libs directories to your project properties.

Now your project will know the DirectShow classes and you can start changing the VCam source filter pin.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文