使用C#的Media Foundation [英] Media Foundation with C#

查看:55
本文介绍了使用C#的Media Foundation的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

媒体基础是Microsoft推荐的技术,它通过许多示例和说明确实支持了该技术,但是所有这些都使用本机代码

Media foundation is the recommended technology by Microsoft and it has really supported it by a lot of samples and explanation but all are with the native code

我在 sourceforge 中发现了一个包装器,使我能够将Media Foundation与C#一起使用,但是在我读人们谈论的问题时,并不是所有事情都可以由托管代码来完成

I found a wrapper in sourceforge make me able to use Media Foundation with C# but while I am reading people talk about not every thing can be done by the managed code

我有一些与MF有关的任务:

I have some tasks to do with MF:

  1. 捕获实时视频
  2. 更改分辨率和波特率
  3. 编码视频
  4. 解码视频

我可以在这些任务中使用.net还是必须使用本机代码?是否有示例帮助(请不要从其中提及msdn)?

Can I use .net in these tasks or I have to use the native code?Is there samples help (please don't mention msdn one from them)?

推荐答案

Media Foundation .NET C#包装程序可以很好地完成您提到的所有任务.我已经亲自使用它来实现捕获,调整大小和编码,而且我想解码也不应该太难.

The Media Foundation .NET C# wrapper can work well for all those tasks you mentioned. I've used it personally to implement the capture, resizing, and encoding, and I imagine decoding shouldn't be too hard either.

该项目确实提供了一些示例,您可以下载,但我发现它们相当缺乏.包装程序非常接近C ++实现,因此使用C ++示例并不难,只需将逻辑移植到C#.我使用以下内容作为参考,发现它非常有价值: https://github.com/sipsorcery/mediafoundationsamples

The project does have some examples you can download but I find them rather lacking. The wrapper is so close to the C++ implementation that it's not too hard to use C++ examples and just port the logic to C#. I used the following as a reference and found it to be very valuable: https://github.com/sipsorcery/mediafoundationsamples

这篇关于使用C#的Media Foundation的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆