代码之家  ›  专栏  ›  技术社区  ›  Aleksandar Vucetic

DirectShow.net打开Windows Media Player可以打开的任何文件

  •  0
  • Aleksandar Vucetic  · 技术社区  · 15 年前

    以下是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可以很好地打开同一个文件。可能有什么问题。

    我得到了相同的行为没有直接显示,但使用本地C++代码…

    2 回复  |  直到 15 年前
        1
  •  0
  •   Geraint Davies    15 年前

    Windows Media Player使用WMF SDK和MF以及DirectShow。

        2
  •  0
  •   Aleksandar Vucetic    15 年前

    正如GeraintDavies在评论中指出的:“graphedt的“渲染文件”菜单选项调用了render file。如果这些行为不同,那么您可能在不同的环境中运行(例如,x64与x86或admin与non-admin)。“…实际上,问题不在于体系结构或特权,而是与在视频中查找相关的代码的其他部分,这在我测试过的视频上没有很好地执行。