这是来自 DirectShowNet 库的代码片段,用于打开视频文件:
this.graphBuilder = (IGraphBuilder) new FilterGraph();
// Have the graph builder construct its the appropriate graph automatically
hr = this.graphBuilder.RenderFile(filename, null);
但 RenderFile 方法失败。同时,Windows Media Player 也能很好地打开同一个文件。可能是什么问题。
我在没有 DirectShowNet 的情况下得到了相同的行为,但是使用了本机 C++ 代码......