是否可以用 C# 编写 DirectShow 过滤器(而不是 c\c++)?

发布于 2024-08-21 04:57:45 字数 81 浏览 7 评论 0原文

是否可以用 C#(而不是 c\c++)编写 DirectShow 过滤器?

我的意思是不仅要创建源过滤器,还要创建渲染器或压缩器等?

Is it possible to write DirectShow filters in C# (not in c\c++)?

I mean not only to create source filters but renderers or compressors etc?

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

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

发布评论

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

评论(5

瞎闹 2024-08-28 04:57:45

Maxim Kartavenkovcodeproject.com。看一下这篇文章:纯 .NET DirectShow 过滤器C#。它不仅包含源过滤器,还包含变换过滤器、渲染器、编码器等。

他的文章中的代码不是基于 directshow.net 库,这是一件好事。

Maxim Kartavenkov has written a lot of useful DirectShow articles on codeproject.com. Take a look at this article: Pure .NET DirectShow Filters in C#. It not only contains source filters, but also transform filters, renderers, encoders etc.

The code in his articles are not based on the directshow.net library, which is a good thing.

ι不睡觉的鱼゛ 2024-08-28 04:57:45

是的。您可以使用 DirectShow.net Lib 来帮助弥补这一差距。

他们甚至有一个样本,如果你向下看页面,你会看到 GSSF 样本描述:

GSSF – 通用示例源
过滤器——一种实现源的方法
C# 中的过滤器。如果您有样品(对于
来自位图的示例视频帧
文件)您想要用作
图表中的源,此过滤器将
向您展示如何操作。

Yes it is. You can use the DirectShow.net Lib to help bridge the gap.

They even have a sample, if you look down the page you will see the GSSF sample description:

GSSF – The Generic Sample Source
Filter – A way to implement a source
filter in c#. If you have samples (for
example video frames from bitmap
files) that you want to use as a
source in a graph, this filter will
show you how.

萌化 2024-08-28 04:57:45

可以,但除非您非常了解 DirectShow 和 .NET 本机互操作,否则这可能会很困难。即便如此,它也可能有点艰难。

下面是一个示例:http://www.sichbo.ca/Free_Code/100_C_Sharp_directshow_filters

You can, but it can be difficult unless you know DirectShow and .NET native interop pretty well. Even then it can be a little uphill.

Here is an example of it being done: http://www.sichbo.ca/Free_Code/100_C_Sharp_directshow_filters

兔小萌 2024-08-28 04:57:45

我认为在 C# 中实现完整的 DirectShow-Filter 是一个坏主意。 C++ DirectShowBaseClasses 非常有帮助。重新实施这些将导致一团糟。

如果您想实现解码器/编码器或某些音频/视频效果,那么您可以创建一个 DMO(也许用 C# 编写,但 C++ 会更好)。如果您需要源过滤器,请获取球样本并对其进行修改。如果您需要其他类型的过滤器,请查看示例 (http://msdn.microsoft.com/en-us/library/windows/desktop/dd375468(v=vs.85).aspx) 并修改一个。

I think implementing a complete DirectShow-Filter in C# is a bad idea. The C++ DirectShowBaseClasses are so helpful. To re-implement these will result in a complete mess.

If you want to implement a decoder/encoder or some audio/video-effect then you can create a DMO (maybe in C# but C++ would be better). If you need a Source-Filter, take the Ball-Sample and modify it. If you need other types of filters, then take a look at the samples (http://msdn.microsoft.com/en-us/library/windows/desktop/dd375468(v=vs.85).aspx) and modify one.

小帐篷 2024-08-28 04:57:45

基本上,您可以将 .NET 类导出为 COM。要使用 DShow 接口,只需从 .NET 项目链接到 CM 对象即可。无论如何,在没有 C++ BaseClasses 等库的支持的情况下,在 .NET 中编写 DShow 过滤器可能具有挑战性。

Basically you can export you .NET classes as COM. TO use DShow interfaces, simply link to CM objects from your .NET projects. Anyway, writing DShow filters in .NET without some support of libraries like BaseClasses for C++ could be challenging.

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