Media Foundation with C#

时光总嘲笑我的痴心妄想 提交于 2019-12-13 12:28:17

问题


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

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

I have some tasks to do with MF:

  1. Capture alive video
  2. change resolution and baud rate
  3. Encode video
  4. decode video

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)?


回答1:


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.

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



来源:https://stackoverflow.com/questions/28261101/media-foundation-with-c-sharp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!