是否可以用 C# 编写 DirectShow 过滤器(而不是 c\c++)?
是否可以用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
Maxim Kartavenkov 在 codeproject.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.
是的。您可以使用 DirectShow.net Lib 来帮助弥补这一差距。
他们甚至有一个样本,如果你向下看页面,你会看到 GSSF 样本描述:
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:
可以,但除非您非常了解 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
我认为在 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.
基本上,您可以将 .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.